Dear D2RQ creators and users,

is there any way, how to calculate a difference (in days) between two 
datetime (or date) values over D2RQ SPARQL endpoint?

I am trying something like (on D2RQ master branch snapshot 0.8.2.-dev):

SELECT DISTINCT ?n ?p ?c ?d WHERE {
   ?s a ont:Student.
   ?s ont:personName ?n.
   ?r a ont:Registration.
   ?r ont:datePaid ?p.
   ?r ont:dateCompleted ?c.
   BIND ( ?c - ?p AS ?d).
}

This is OK with parsing, however, I get empty results for ?d:

n       p       c       d
"Dave"^^xsd:string      "2013-01-10T00:00:00"^^xsd:dateTime 
"2013-06-22T00:00:00"^^xsd:dateTime     -
"Eve"^^xsd:string       "2013-01-10T00:00:00"^^xsd:dateTime 
"2013-06-22T00:00:00"^^xsd:dateTime     -
"Charlie"^^xsd:string   "2013-01-10T00:00:00"^^xsd:dateTime 
"2013-06-22T00:00:00"^^xsd:dateTime     -
"Ivan"^^xsd:string      "2013-01-10T00:00:00"^^xsd:dateTime 
"2013-06-22T00:00:00"^^xsd:dateTime     -

It would be easy to calculate "approximate" duration values, using YEAR, 
MONTH and DATE functions; the question is, if the actual date difference 
can be computed.

Thanks,
Karlis Cerans

------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
d2rq-map-devel mailing list
d2rq-map-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/d2rq-map-devel

Reply via email to