Advanced Features of SPARQL

Limits and ordering

Suppose we want to know the movies that James Dean played in, and the dates they were released:

image
?movie?date
Giant1956
EastOfEden1955
RebelWithoutaCause1955

These answers come back in no particular order; different SPARQL implementations (and even the same implementation, at different times) are free to produce the results in any order they like.

We can specify an ordering in the query for the results using the directive ORDER BY. The ORDER BY directive comes after the graph pattern, and specifies one or more variables to use to determine the order in which the results are returned. The following ...

Get Semantic Web for the Working Ontologist, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.