Data format format exception for xsd: dateTime in a SPARQL query with Jena?

I am trying to apply a range query for an RDF property that has a format xsd:dateTime. This is my request:

PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> 
SELECT ?x WHERE { ?y <DATE:> ?x . 
FILTER(?x>"2014-06-05T10:10:10+0530"^^xsd:dateTime) }

It gives a warning and gives nothing:

WARN [main] (Log.java:78) - Datatype format exception: "2014-06-11T12:44:22+0530"^^xsd:dateTime

I do not understand what the problem is? I saved the property in format only xsd:dateTime.

+3
source share
1 answer

I saved the property only in xsd: dateTime format.

The simple answer is no, you have not saved the value as xsd: dateTime. The standard xsd: dateTime says:

The lexical space dateTime consists of sequences of finite length form characters: '-'? yyyy '-' mm '-' dd 'T' hh ':' mm ':' ss ('.' s+)? (zzzzzz)?

dateTime , , 2014-06-05T10:10:10. ,

zzzzzz ( ) ( ).

,

: (('+' | '-') hh ':' mm) | 'Z',

  • hh - ( ), ,
  • mm - , ,
  • '+' ,
  • '-' .

. , , , +05:30. , ,

"2014-06-05T10:10:10+05:30"^^xsd:dateTime

, Jena qparse:

$ qparse --query query.rq # the original query, warnigns
14:12:22 WARN  NodeValue            :: Datatype format exception: "2014-06-05T10:10:10+0530"^^xsd:dateTime
14:12:22 WARN  NodeValue            :: Datatype format exception: "2014-06-05T10:10:10+0530"^^xsd:dateTime
14:12:22 WARN  NodeValue            :: Datatype format exception: "2014-06-05T10:10:10+0530"^^xsd:dateTime
PREFIX  xsd:  <http://www.w3.org/2001/XMLSchema#>

SELECT  ?x
WHERE
  { ?y <DATE:> ?x
    FILTER ( ?x > "2014-06-05T10:10:10+0530"^^xsd:dateTime )
  }
$ qparse --query query.rq # the updated query, no warnings
PREFIX  xsd:  <http://www.w3.org/2001/XMLSchema#>

SELECT  ?x
WHERE
  { ?y <DATE:> ?x
    FILTER ( ?x > "2014-06-05T10:10:10+05:30"^^xsd:dateTime )
  }
+2

All Articles