Re: Dubious test in /cast/

Steve Harris wrote:
> 
> Most of them I agree with, but this one seems wrong:
> 
> http://www.w3.org/2001/sw/DataAccess/tests/data-r2/cast/manifest#cast-str
> 
> data:
> 
> :iri :p :z .
> :str :p "string" .
> :fltdbl :p "-10.2E3" .
> :decimal :p "+33.3300" .
> :int :p "13" .
> :dT :p "2002-10-10T17:00:00Z" .
> :bool :p "true" .
> 
> query:
> 
> SELECT ?s WHERE {
>     ?s :p ?v .
>     FILTER(datatype(xsd:string(?v)) = xsd:string) .
> }
> 
> results:
> 
> ?s
> --------
> :iri
> :str
> :fltdbl
> :decimal
> :int
> :dT
> :bool
> 
> The implication of the first result is that it's legal to case a URI to 
> an xsd:string with xsd:string(). I agree with the remainder of the test.

See http://www.w3.org/TR/rdf-sparql-query/#FunctionMapping . Specifically:

"""
XPath defines only the casts from one XML Schema datatype to another. 
The remaining casts are defined as follows:

     * Casting an IRI to an xsd:string produces a typed literal with a 
lexical value of the codepoints comprising the IRI, and a datatype of 
xsd:string.
     * Casting a simple literal to any XML Schema datatype is defined as 
the product of casting an xsd:string with the string value equal to the 
lexical value of the literal to the target datatype.
"""

Lee


> 
> It was approved here: 
> http://lists.w3.org/Archives/Public/public-rdf-dawg/2007JulSep/att-0087/14-dawg-minutes.html 
> 
> 
> - Steve
> 
> 

Received on Monday, 17 September 2007 12:58:08 UTC