W3C home > Mailing lists > Public > public-rdf-dawg@w3.org > April to June 2006

SPARQL cast tests

From: Steve Harris <steve.harris@richmondinformatics.com>
Date: Mon, 10 Apr 2006 09:17:21 +0100
Message-Id: <8BA6A243-C0FE-4C45-B6A9-A72D833C6F85@richmondinformatics.com>
To: RDF Data Access Working Group <public-rdf-dawg@w3.org>

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

data:

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

query:

SELECT ?x
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.

Also,

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 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 16:15:26 GMT