Summary
When performing SPARQL queries against Wikidata, the dates are returned in a format that does not comply with the XML Schema specifications.
Details
The curl command below queries Wikidata for Julius Caesar's birth date:
curl 'https://query.wikidata.org/sparql?query=select%20*%20where%20%7B%0A%20%20wd%3AQ1048%20wdt%3AP569%20%3Fdate%0A%7D'
select * where { wd:Q1048 wdt:P569 ?date }
Expected result
According to the XML schema specificiations:
'-'? yyyy is a four-or-more digit optionally negative-signed numeral that represents the year; if more than four digits, leading zeros are prohibited
Thus, the date should be formatted as
-0099-01-01T00:00:00Z
Notice the two leading zeroes, ensuring that the year is a "a four-or-more digit optionally negative-signed numeral".
Actual result
The date is formatted as:
-099-01-01T00:00:00Z
making it invalid.
Miscellaneous
Interestingly enough, the bug only occurs for BCE dates. For example, Caligula (Q1409)'s date of birth is correctly formatted as:
0012-08-29T00:00:00Z