- From: John Snelson <john.snelson@marklogic.com>
- Date: Wed, 21 Nov 2012 19:38:25 +0000
- To: Gregory Williams <greg@evilfunhouse.com>
- CC: "public-rdf-dawg-comments@w3.org" <public-rdf-dawg-comments@w3.org>
On 21/11/12 17:34, Gregory Williams wrote: > On Nov 6, 2012, at 7:29 PM, John Snelson wrote: > >> The specification for "ORDER BY"[1] contains the following sentence: >> >> "A plain literal is lower than an RDF literal with type xsd:string of the same lexical form." >> >> Since the definition of the DATATYPE() function [2] describes the type of a simple literal as xsd:string, this sentence does not make any sense. >> >> I suggest that the sentence quoted above be removed. In addition, the entries in the "variable bindings in ascending order" table relating to simple literals and literals typed explicitly as xsd:string needs to be revised. > > > John, > > The values that SPARQL's DATATYPE() function returns are similar to, but not exactly the same as the datatype of a literal. In cases where DATATYPE() is called with a typed literal[1], it returns the datatype of the literal. However, the DATATYPE() function definition also defines two cases in which a value is returned when the literal *isn't* a typed literal: > > """ > * If the literal is a simple literal, return xsd:string > * If the literal is literal with a language tag, return rdf:langString > """ > > In both of these cases, the literal in question is a plain literal[2], not a typed literal. With that in mind, hopefully the language used in describing ORDER BY is more clear (that is, "an RDF literal with type xsd:string" is merely one of two possibly argument types for which DATATYPE() may return xsd:string). > > I hope this clarifies the issue. > > thanks, > gregory williams > > [1] http://www.w3.org/TR/2004/REC-rdf-concepts-20040210/#dfn-typed-literal > [2] http://www.w3.org/TR/2004/REC-rdf-concepts-20040210/#dfn-plain-literal Let me address your answer from two perspectives: 1) Clearly the spec is inconsistent in the way that it sometimes treats plain literals as equivalent to literals typed as xsd:string, and sometimes doesn't. Saying that this is the way it is defined in the specification is true, but not helpful. Keeping the specification logically consistent makes learning and understanding the language easier. 2) We all know that the datatype() function has been changed in SPARQL 1.1 to reflect the expected reality of RDF 1.1 typing. However the job is half finished - if ORDER BY remains unchanged, then there exists a way to tell the difference between plain literals and literals typed as xsd:string. This is not just inconsistent - it's also not forwards compatible with the way that RDF 1.1 is expected to change. Clearly the two logical solutions to this problem are to undo the changes to the datatype() function, or to also make changes to ORDER BY. Either way changes are necessary. Personally, I would prefer ORDER BY to be updated to sort plain literals in the same way as xsd:string literals. John -- John Snelson, Lead Engineer http://twitter.com/jpcs MarkLogic Corporation http://www.marklogic.com
Received on Wednesday, 21 November 2012 19:42:04 UTC