On 11/23/2013 12:21 PM, Andy Seaborne wrote:
On 23/11/13 17:01, David Booth wrote:
Hi Hugh,
A little correction and a further question . . .
On 11/23/2013 10:17 AM, Hugh Glaser wrote:
Pleasure.
Actually, I found this:
http://answers.semanticweb.com/questions/3530/sparql-query-filtering-by-string
I said it is a pig’s breakfast because you never know what the RDF
publisher has decided to do, and need to try everything.
So to match strings efficiently you need to do (at least) four queries:
“cat”
“cat”@en
“cat”^^xsd:string
Is that still true in SPARQL 1.1? In Turtle "cat" means the exact same
thing as "cat"^^xsd:string:
http://www.w3.org/TR/turtle/#literals
But this section of SPARQL 1.1 Section 4.1.2 "Syntax for Literals" has
no mention of them being the same:
http://www.w3.org/TR/sparql11-query/#QSynLiterals
Anyone (Andy?) know whether this was fixed in SPARQL 1.1? I thought
SPARQL 1.1 and Turtle had been pretty well aligned.
SPARQL 1.1 says nothing about it aside from (as in SPARQL 1.0)
DATATYPE("abc") is xsd:string and DATATYPE("abc"@en) is rdf:langString
(in 1.1).
What it should say, but does not because SPARQL 1.1 finished before RDF
1.1 got near sufficiently stable, is
1/ parsing "abc" and "abc"^^xsd:string is the same thing.
2/ In results formats, it's "abc" or equivalent, and no ^^xsd:String.
For matching, it falls out in the matching over RDF but actually putting
that in the text would be nice.
Ah yes, I see that in the RDF 1.1 draft now:
http://www.w3.org/TR/rdf11-concepts/#h3_section-Graph-Literal
[[
Concrete syntaxes MAY support simple literals, consisting of only a
lexical form without any datatype IRI or language tag. Simple literals
only exist in concrete syntaxes, and are treated as syntactic sugar for
abstract syntax literals with the datatype IRI
http://www.w3.org/2001/XMLSchema#string.
]]
So in effect, this was fixed at the RDF 1.1 abstract level, so even
though the SPARQL 1.1 spec did not mention it, if a SPARQL 1.1 server is
RDF 1.1 compliant, then it will treat "abc" and "abc"^^xsd:string as the
same.
Thanks!
David