1

Given this test data with an xsd:gYearMonth :

<http://exemple.fr/agent/123> <http://exemple.fr/ontologie/date> "2021-12"^^<http://www.w3.org/2001/XMLSchema#gYearMonth> <http://exemple.fr/graphe/testGraphe> .

This SPARQL query that compares it with xsd:gYear returns nothing in GraphDB 9.10 :

SELECT *
WHERE {
    ?x <http://exemple.fr/ontologie/date> ?date .
    FILTER(?date < "2023"^^<http://www.w3.org/2001/XMLSchema#gYear>)
}

I am aware that the SPARQL spec only defines the comparison operators for xsd:dateTime, but I am surprised that no extension has been done on this. I read here that it was done in RDF4J in "2016"^^xsd:gYear :-)

Does GraphDB support comparison between dates using different datatypes ?

Thanks !

ThomasFrancart
  • 470
  • 3
  • 13
  • 1
    I can't speak for GraphDB, but I tried with Virtuoso (via [DBpedia](https://dbpedia.org/sparql)) and it works: `SELECT * { VALUES ?date {"2022"^^xsd:gYear "2024"^^xsd:gYear "2021-12"^^xsd:gYearMonth} FILTER(?date < "2023"^^xsd:gYear) }` – UninformedUser Dec 27 '21 at 20:02
  • Link to RDF4 date comparison implementation back in 2016 : https://github.com/eclipse/rdf4j/issues/163 – ThomasFrancart Jan 04 '22 at 15:03

0 Answers0