On 26/04/12 18:15, E S wrote:
Hello,


If I am querying for a literal of type xsd:string, it appears that in Fuseki I 
need to always use ^^xsd:string when querying for that literal.

For example,  if I have a triple
<urn:foo:foo>  rdfs:label "foo"^^xsd:string

I need to query it using

select * where {
?s ?p "foo"^^xsd:string .
}

and querying without xsd:string won't work:


select * where {
?s ?p "foo"  .
}

in other words, "foo" and "foo"^^xsd:string are not equal.

Correct (currently!).


However, I can't find any specific documentation asserting that this is true. (I have found that in 
the book "Learning SPARQL" by Bob DuCharme, page 133. it says that "a quoted value 
is a string whether you specifically designate it xsd:string or not"). Can someone clarify 
what the correct behavior is, and reference the SPARQL 1.1 spec where this is discussed? Has this 
behavior ever changed in SPARQL 1 or 1.1?

This is defined in RDF, not SPARQL.

And in SPARQL
sameTerm("foo", "foo"^^xsd:string)   => false
"foo" = "foo"^^xsd:string    => true

i.e. string value comparison by value works.


RDF 1.1 plans to change plain literals to have a datatype of xsd:string and so "foo" and "foo"^^xsd:string will be the same term and term-equals.


On an unrelated note, it appears that SPARQL's ORDER BY provides the order of 
the character encoding (ie, case sensitive order, where 'AT' comes before 
'add'), not the true alphabetical (case-insensitive) order. Is this by design? 
I would think that a common use case would be to provide correct the 
alphabetical ordering. Is there a way to get the alphabetical ordering?

ORDER BY lcase(?foo)


Thank you!


Reply via email to