SPARQL cast tests

I've been implementing the casts in SPARQL (again), and I think there  
a need for more tests in this area, for example:


:a :p "12.3"^^xsd:integer .
:b :p "12.3" .


WHERE { ?x ?y ?z . FILTER(xsd:decimal(?z) = 12.3) }

from my reading of the spec that will return ?x = :a and :b, which  
might surprise anyone who's not familiar with the way RDF doesn't  
handle numbers.


FILTER(xsd:decimal(xsd:integer(?z)) = 12.3)

for which I can't work out what the correct answer is, as it seems  
unlikely that "12.3" is a valid lexical value for an xsd:integer, but  
it's a bit odd if that gives a different result to the other test.

Also, and I'm sure I've asked this before, but 11.5 seems to indicate  
that its legal to cast an IRI to an xsd:string without mentioning STR 
(), which is not how I remembered that part of the design.

- Steve

Received on Monday, 10 April 2006 08:17:36 UTC