ORDER BY and booleans

As far as I can tell from my parser and the spec, it's perfectly  
reasonable to have an ORDER BY condition which evaluates to a  
boolean, e.g.:

ORDER BY (REGEX('[A-Z].*', ?x))

to order the results based on whether the initial letter of ?x is a  
capital.

Looking at the spec:

> The "<" operator (see the Operator Mapping) defines the relative  
> order of pairs of numerics, xsd:dateTimes and xsd:strings.
Does not apply to booleans.

> IRIs are ordered by comparing the character strings making up each  
> IRI using the "<" operator.
Does not apply to booleans, which are simple data types.

> SPARQL also defines a fixed, arbitrary order between some kinds of  
> RDF terms that would not otherwise be ordered. This arbitrary order  
> is necessary to provide slicing of query solutions by use of LIMIT  
> and OFFSET.
These only apply an ordering between the different categories -- so a  
boolean, as a typed RDF literal, ranks above an IRI, but it's unclear  
whether 'true' comes before 'false'.


What should happen in the case of values that are not in the above  
categories, particularly booleans? Intuitively, boolean values will  
be partitioned into true/false, but I'm not clear of how that chain  
of reasoning applies according to the spec. I'd like to see this  
clarified in the ORDER BY section -- and I'd quite like to know!

Thanks,
-Richard

Received on Saturday, 8 July 2006 07:27:52 UTC