Extended Temporal Datatype Support

by James

Dydra recently extended its native support to cover the full XSD temporal data type complement. This means not only that our platform continues to provide compact native representations for the core data types:

  • xsd:date
  • xsd:dateTime
  • xsd:time

where each term requires one cell – that is, eight bytes, but, in addition, SPOCQ, Dydra’s SPARQL processor, implements internal data classes for the remaining types:

  • xsd:dayTimeDuration
  • xsd:yearMonthDuration
  • xsd:gDay
  • xsd:gMonth
  • xsd:gMonthDay
  • xsd:gYear
  • xsd:gYearMonth

As one aspect of this support, we have extended the value domain for the native xsd:dateTime form to cover the interval ca. two hundred thousand years each way from the epoch.

As the second, we extend the SPARQL 1.1 functions on dates and times, based upon this storage model, with the respective temporal operators, as defined by “XPath and XQuery Functions and Operators 3.0”.

The SPARQL 1.1 recommendation requires support for xsd:dateTime data as an operand to the functions YEAR, MONTH, DAY, HOURS, MINUTES, SECONDS, TIMEZONE and TZ, as the result type from the constructor NOW and their admissibility to the ORDER operation.

Dydra extends the generic behavior of the component accessors, as appropriate to the respective datatype, orders those for which a relation is defined for durations and for locations, and provides the respective construction operators and implicit casting.

Given this facility, temporal data is amenable to aggregation and ordering. In addition, although the respective domains are not fully commensurable, we augment the rules which SPARQL requires to order among kinds of RDF terms to include the temporal types as well as to accommodate other literal types

  1. unbound
  2. blank node
  3. xsd:anyURI
  4. rdf:langString
  5. xsd:string
  6. xsd:boolean
  7. number
  8. gregorian
  9. xsd:dayTimeDuration
  10. xsd:yearMonthDuration
  11. xsd:duration
  12. xsd:date
  13. xsd:time
  14. xsd:dateTime
  15. other literal types
blog comments powered by Disqus