A date of +0000-01-01 is allowed in wikibase but has no meaning.
This is a follow up on T92006.
Details:
XSD 1.0 BC 1 is year -1
"[ISO 8601] makes no mention of the year 0; in [ISO 8601:1998 Draft Revision] the form '0000' was disallowed and this recommendation disallows it as well. However, [ISO 8601:2000 Second Edition], which became available just as we were completing version 1.0, allows the form '0000', representing the year 1 BCE."
[ISO 8601] refers to the one from 1988-06-15. The ISO references are non-normative.
XSD 1.1 BC 1 is year 0
"is consistent with the current edition of [ISO 8601]."
[ISO 8601] here also links to the one from 1988-06-15. But the references also list ISO 8601:2000 Second Edition which is never linked to in the rest of the spec. The ISO references are non-normative.
Both have the same namespace.
https://docs.oracle.com/javase/8/docs/api/index.html?javax/xml/datatype/XMLGregorianCalendar.html says it follows XSD 1.0 and ISO-8601-1988 and allows year 0. It allows conversion to GergorianCalendar but doesn't explicitly say how negative years are converted
https://docs.oracle.com/javase/8/docs/api/java/util/GregorianCalendar.html BC 1 is year 0
SPARQL 1.1 has XSD 1.0 as a normative reference.
Seems only way to know if it works is to actually test each implementation. (As the specs and documentation are too broken to rely on.)
Tests on Blazegraph:
prefix xsd: <http://www.w3.org/2001/XMLSchema#> SELECT ?date WHERE { BIND ( year("0000-01-01T00:00:00"^^xsd:dateTime) AS ?date) }
MalformedQueryException: "0000-01-01T00:00:00" is not a valid representation of an XML Gregorian Calendar value.
prefix xsd: <http://www.w3.org/2001/XMLSchema#> SELECT ?date WHERE { BIND ( "0001-01-01T00:00:00"^^xsd:dateTime - "-0001-01-01T00:00:00"^^xsd:dateTime AS ?date) }
366.0
It seems Blazegraph does not support subtracting a duration from a dateTime:
prefix xsd: <http://www.w3.org/2001/XMLSchema#> SELECT ?date WHERE { BIND ( "0001-01-01T00:00:00"^^xsd:dateTime - "P1Y"^^xsd:duration AS ?date) }
Cannot add process datatype literals:"0001-01-01T00:00:00"^^:"P1Y"^^