RDFLib / rdflib

RDFLib is a Python library for working with RDF, a simple yet powerful language for representing information.
https://rdflib.readthedocs.org
BSD 3-Clause "New" or "Revised" License
2.14k stars 555 forks source link

Add xsd:duration sparql functionality #2865

Closed cameronmore closed 1 month ago

cameronmore commented 1 month ago

Are you able to add xsd:duration functionality to the SPARQL function?

nicholascar commented 1 month ago

Do you mean does RDFLib's SPARQL processing support the TIMEZONE SPARQL function as per https://www.w3.org/TR/sparql12-query/#func-timezone? That's the only reference to "duration" I can find in SPARQL.

Or do you mean can RDFLib support date arithmetic?

If you mean can you use duration as a datatype then yes: Literal("P20M", datatype=XSD.duration) which is 20 months

cameronmore commented 1 month ago

I think I meant arithmetic, adding some "P20M"^^xsd:duration to "2018-05-28T12:14:45Z"^^xsd:datetime, described here, but now I realize I may be looking for something which is not outlined in sparql 1.1