You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the rdflib.Literal.toPython conversion of xsd:gYear and xsd:gYearMonth-typed rdflib.Literals returns datetime.date objects with the day (xsd:gYearMonth) or day and month (xsd:gYear) arguments set to 1.
I think this is plain wrong, xsd:gYear is not equivalent to datetime.date(2025, 1, 1).
Note that issue #1379 addressed this already, but focused more on a serialization problem and was then closed without really discussing the datetime conversion of xsd:gYear and xsd:gYearMonth.
A practical solution for this would be to just return an rdflib.Literal with the datatype property set; this way, the XSD type information would still be available.
I would be happy to implement the necessary changes and open a PR if this the suggested/some solution is agreed upon.