On 11/10/13 18:56, Bardo Nelgen wrote:
Wrong XMLSchema-Namespace – OUCH!! Thank you. :-)
As we are at it: Shall it then be possible to also use the same
expression with the NOW function as in
FILTER ( xsd:dateTime(?Start) < now() < xsd:dateTime(?End) ) ??
(which, of course, will not return a result for the dataset provided
with this current thread…)
FILTER ( ?Start < now() && now() < ?End )
There is no need to cast if the datatype is right. You need && or ...
FILTER ( ?Start < now() )
FILTER ( now() < ?End )
(and now() returns the same value every time it is called inside obe
query execution)
Andy
I unfortunately could, however, not find a reasonably good deployment
example for such application on the net by now.
In advance – as always - thanks a lot for your help!!
– Bardo
On 11.10.13 15:59, Dave Reynolds wrote:
On 11/10/13 14:37, Bardo Nelgen wrote:
Hi Andy,
thanks for the quick reply – though I'm not yet sure I completely
understand what you're saying:
I thought that xsd:dateTime was one of the datatypes to be used for
sparql queries!?
It is but your sample data does not have xsd:dateTime values in it.
The namespace for xsd is <http://www.w3.org/2001/XMLSchema#> so the
URI for xsd:dateTime is <http://www.w3.org/2001/XMLSchema#dateTime>.
Whereas your data is using the namespace
<urn:ietf:params:xml:schema:dateTime:>
So as far as any RDF processor is concerned that's a different
datatype. Andy showed how you could work around this by coercing your
incorrectly-typed values to strings then coercing those to correct
xsd:dateTime values.
Alternatively you might fix the datatype URIs in your data.
Kindly asking for further explanation… – PLEASE!
So here, again, the complete samples:
PREFIX html: <http://www.w3.org/1999/xhtml>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX xsd: <urn:ietf:params:xml:schema:>
That should be:
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
Dave