next up previous contents
Next: Select display Up: Header Previous: Count   Contents

Sort

Sort the results according to the value of a variable :

select sort ?name where

Sort the results according to the value of several variables :

select sort ?name sort ?firstName where

Sort the results in reverse order (the greater first) :

select sort reverse ?cost where

Sort the results in reverse order of cost and sort by name :

select sort reverse ?cost   sort ?name  where

It is possible to sort by value of the counter (count ?x)

select sort count where

Example : find the authors thas has written the most technical reports.

select  ?name  group ?x  count ?doc  sort reverse count where
?x c:hasCreated ?doc
?doc rdf:type c:TechnicalReport
?x c:FamilyName  ?name

It is also possible to sort by distance in the case of approximate search :

select sort distance where



Olivier Corby 2005-07-01