Even SPARQL 1.1 does not support arithmetic operations by default dates. See Section SPARQL Statement Mapping : Arithmetic operations are defined only in numeric data types.
Perhaps there are some implementations of SPARQL 1.1 that offer an extension for this purpose, but I do not immediately understand what is built-in now, of course, not in Python.
It is best to contact the developers of the SPARQL engine of your choice and molest them to implement such an extension, or, alternatively, turn it over yourself.
As a rule, most SPARQL engines (even 1.0) support date comparison operations, so you can do things like sort and compare, but you will have to do some custom post processing of the query result.
Update I just realized that I forgot something very important: SPARQL 1.1, of course, supports functions such as year() , month() , etc., which return the year and month components of datetime as an integer, and which you could use to do arithmetic of a roundabout by date.
source share