[redland-dev] Does Rasqal support xsd:dataType?
Seaborne, Andy
andy.seaborne at hp.com
Mon Apr 24 15:26:13 BST 2006
-------- Original Message --------
> From: Christopher Schmidt <>
> Date: 24 April 2006 13:55
>
> On Mon, Apr 24, 2006 at 05:14:55PM +0900, Hyunki Kim wrote:
> > Hi,
> >
> > After inserting a RDF document to the mysql, I had a problem in
> > querying with the following SPARQL statement.
>
> Use this instead:
>
> 1. SPARQL Query
> prefix dc: <http://purl.org/dc/elements/1.1/>
> PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
> SELECT ?d
> WHERE { ?x dc:date ?d^^<xsd:dateTime> . }#
The SPARQL idiom would be:
{ ?x dc:date ?d . FILTER ( datatype(?d) = <xsd:dateTime> ) }
but note that the <> is an absolute URI, and not a qname related to the
XSD datatype dateTime.
The SPARQL grammar does not allow ?d^^<....>
In full:
prefix dc: <http://purl.org/dc/elements/1.1/>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
SELECT ?d
WHERE {
?x dc:date ?d .
FILTER ( datatype(?d) = xsd:dateTime )
}
removing the <> on the prefixed name to get
http://www.w3.org/2001/XMLSchema#dateTime
Andy
>
>
> or similar ... I'm not actually sure what the format for rdf datatypes
> is with NS prefixes: you can definitely use:
>
> WHERE { ?x dc:date ?d^^<http://www.w3.org/2001/XMLSchema#dateTime> .
}
>
> If the above doesn't work.
>
> --
> Christopher Schmidt
> Web Developer
More information about the redland-dev
mailing list