Re: ORDER BY and literals

On 21/11/12 19:38, John Snelson wrote:
> We all know that the datatype() function has been changed in SPARQL 1.1
> to reflect the expected reality of RDF 1.1 typing.

Clarification:

This aspect of datatype() has not changed in SPARQL 1.1.

http://www.w3.org/TR/rdf-sparql-query/#func-datatype

Only the datatype of literals-with-language tag has changed (which was 
an error in SPARQL 1.0 and replacing errors by results is an extension 
route for SPARQL expressions).

> to reflect the expected reality of RDF 1.1 typing.
> ... I would prefer ORDER BY to be updated to sort plain literals in
> the same way as xsd:string literals.

Plain literals covers

   + simple literals
     (literals without datatype and without language tag
      it's SPARQL terminology as there was no RDF term for it.

   + literals with a language tag.

There are no simple literals (strings with no language tag and no 
datatype) in RDF 1.1 parsed data.  So the issue of sorting is simplified 
in RDF 1.1 - the case of two RDF terms having the same value (simple 
literal and xsd:string) does not arise.  By giving an ordering to the 
same value but different terms items we get a consistent sort for such 
items.

Plain literals with language tag will have SPARQL DATATYPE of 
rdf:langString where previously datatype() caused an error.

The rule for plain literals does at least mean the ordering between 
literals-with-language lag and xsd:string is defined (they do not have 
the same value).

	Andy

Received on Thursday, 22 November 2012 22:15:29 UTC