Skip to content

xsd:date literals with negative years raise ISO8601Error due to isodate limitation #3116

Open
@ch-sander

Description

@ch-sander

when parsing RDF data containing valid xsd:date literals with years before 0000 (e.g. "-0012-11-29"^^xsd:date), rdflib raises an exception:

isodate.isoerror.ISO8601Error: Unrecognised ISO 8601 date format: '-0012-11-29'

According to ISO 8601 and XML Schema, negative years are allowed and represent years BCE using a proleptic Gregorian calendar. The literal above correctly represents 13 BCE.

The error occurs because rdflib relies on the isodate package for parsing, which does not support negative years.

Any workaround or fix?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions