Hi. I have been trying to do some temporal arithmetic in SPARQL and have stumbled upon what I believe are time periods or time intervals. For example
SELECT ?a ?aa
WHERE {
BIND (("08:15:00"^^xsd:time - "10:15:00"^^xsd:time) AS ?a)
BIND (("2012-09-08T08:15:00"^^xsd:dateTime - "2012-09-07T10:15:00"^^xsd:dateTime) AS ?aa)
}
Results:
?a -> -P0Y0M0DT2H0M0.000S (negative 2 hours)
?aa -> P0Y0M0DT22H0M0.000S (positive 22 hours)
My question: Is there any way to operate on these time periods? In particular, suppose I want to convert the length of these these periods into seconds or minutes. smf:duration does something similar, but it works on xsd:date values, and not time periods. If smf:duration took xsd:dateTime or xsd:time arguments, that would be helpful.
Do you have any pointers to functions that extract information from these time periods? I suppose I can figure a way to do the arithmetic myself using days(), hours(), minutes() functions, but I would prefer to avoid that.
Thanks, Rich
Using TBC-SE 4.3.0