- From: Lee Feigenbaum <feigenbl@us.ibm.com>
- Date: Sun, 15 Apr 2007 13:56:05 -0400
- To: "imikhailov" <imikhailov@openlinksw.com>
- Cc: public-rdf-dawg@w3.org
Ivan Mikhailov wrote on 04/15/2007 11:59:51 AM:
> Hello,
>
> I've tried data-r2 with my SPARQL-to-SQL front-end translator and I see
an
> issue with datatype(). Did I miss anything?
>
>
> Query data-r2/expr-builtin/q-datatype-2.rq
>
> PREFIX : <http://example/>
> PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
> SELECT ?x
> { ?x :p ?v .
> FILTER( datatype(?v) != <http://example/NotADataTypeIRI> )
> }
>
> Source data data-r2/expr-builtin/data-builtin-2.ttl
>
> @prefix : <http://example/> .
> @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
>
> :x1 :p "string" .
> :x2 :p "string"^^xsd:string .
> :x3 :p "string"@en .
> :x4 :p "lex"^^:unknownType .
> :x5 :p 1234 .
> :x6 :p <http://example/iri> .
> :x7 :p _:bNode .
>
>
> The expected result set does not contain binding for :x3 :p "string"@en
.
> http://www.w3.org/TR/rdf-concepts/ says that "A plain literal is a
string
> combined with an optional language tag."
> http://www.w3.org/TR/rdf-sparql-query/ , 11.4.7, says that "datatype ...
> returns the datatype IRI of typedLit; returns xsd:string if the the
> parameter is a simple literal."
Hi Ivan,
"simple literal" is defined in
http://www.w3.org/TR/rdf-sparql-query/#operandDataTypes :
"""
# simple literal denotes a plain literal with no language tag.
"""
> So I believe that "string"@en has datatype xsd:string that is not equal
to
> <http://example/NotADataTypeIRI> and it should be reflected in the
resulting
> data set.
"string"@en has a datatype, and so is not of an acceptable type for
datatype(). Therefore, datatype() returns an error which propagates to the
top of the FILTER and eliminates :x3 as a possible binding for ?x.
hope this helps,
Lee
> Query data-r2/expr-builtin/q-datatype-3.rq demonstrates the issue
similar to
> the previous one.
>
>
>
> Best Regards,
> Ivan Mikhailov
> OpenLink Software.
>
>
Received on Sunday, 15 April 2007 17:56:43 UTC