-
Notifications
You must be signed in to change notification settings - Fork 565
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unrecognised ISO 8601 for BC years #2148
Comments
The Exception message identifies the isodate library as the cause:
There has been some discussion of helping with / taking over maintenance of isodate but there is also an alternative, metomi.isodatetime published and maintained by the UK Meteorological Office: >>> tp = "-0038"
>>> import metomi.isodatetime.parsers as parse
>>> parse.TimePointParser().parse(tp)
<metomi.isodatetime.data.TimePoint: -003800-01-01T00:00:00Z> |
I see, thank you! |
The in-code documentation for isodate acknowledges a lack of support for dates before "0000-01-01"
At present, Literal values are implemented as Python datatypes ... >>> Literal("0001", datatype=XSD.gYear)
Literal('0001', datatype=URIRef('http://www.w3.org/2001/XMLSchema#gYear'))
>>> Literal("0001", datatype=XSD.gYear).value
datetime.date(1, 1, 1) So, given that the basic limitation is Python itself and because integrating/switching to metomi.isodatetime would entail a fundamental change to the way Literal values are handled, it would likely be considered out of scope. After more detailed investigation, it would seem my mentioning it was ill-conceived. All I can suggest is that if you want to work with this dataset in RDFLib/Python, you pre-filter the statements, remapping any offending negative |
Ok I see, thank you! Then this issue has nothing to do with rdflib and can be closed |
Wouldn't you say that this still is issue with RDFLib, as it is not being conformant with ISO 8601? It is so through its choice of implementation, and |
I see your point and you are right. However, I think that I simply should raise this issue again on isodate's github page because I think that way it will be solved faster as date formats are probably not rdflib's priority. |
Following triple cannot be parsed
Error message
According to ISO 8601 BC dates should be written with a minus, e.g. "-0038". So the input should be correct
The text was updated successfully, but these errors were encountered: