Page MenuHomePhabricator

Wrong birthday in result list of SPARQL when person was born before 1580 (Julian vs Gregorian calendar?)
Closed, InvalidPublic

Description

  1. Go to https://query.wikidata.org/ and send the following SPARQL Query
## Frage nach Physiker, die eine Seite auf de.wiki und en.wiki haben, und ordne 
# das Datum nach dem Geburtstag im Jahr
# 
#SELECT ( COUNT(?item) as ?numberOfPhysicists ) # result 4981 (in 28s) at 2019-09-08
#
SELECT DISTINCT ?item ?itemLabel ?sitelink (YEAR(?date) as ?year) ?date 
WHERE 
{
  ?item wdt:P106/wdt:P279* wd:Q169470.   # Tätigkeit '?classPhys', mit "property path" S 62-65
  ?sitelink schema:isPartOf <https://de.wikipedia.org/>;
     schema:about ?item. 
  ?site2link schema:isPartOf <https://en.wikipedia.org/>;
     schema:about ?item. 
  ?item wdt:P569 ?date .
  BIND( 100*MONTH(?date) + DAY(?date) AS ?monthday )
  BIND( YEAR( ?date ) AS ?xyear )
  FILTER( ?xyear < 1580 )
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
ORDER BY ?monthday
LIMIT 6000
  1. send search in the result list "wd:Q619", that is Nikolaus Kopernikus,
  2. The birthday of Nikolaus Kopernikus is shown to be the 28. Februar 1473
  3. Now select the page "https://www.wikidata.org/wiki/Q619" the property "P569" (date of birth) shows 19 February 1473 which differs from the number in the result list by 9 days.
  4. This error happens also with other persons and with the date of death
  5. To me it seems that this error ist related to a wrong handling of Julian and Gregorian calender, may be in the MONTH- and DAY-Function of the SPARQL- implementation and in the formating of dates in the SPARQL-result- list.

I hope a correction will soon result to the same and correct date values for dates earlier than 1580

See also the discussion in the German Wikipedia

Wikidata-Abfragen#Todestag_von_Kopernikus

Event Timeline

As mentioned in the RDF documentation, for the query service timestamps are always converted to the proleptic Gregorian calendar, even if the original value was in the Julian calendar. So unless I’m mistaken, this is correct handling of Julian and Gregorian dates (you can compare them in the query without caring about what the original calendar was), just maybe not what you expected.

Aklapper renamed this task from Wrong birthday in result list of SPARQL when person was born before 1580 to Wrong birthday in result list of SPARQL when person was born before 1580 (Julian vs Gregorian calendar?).Oct 11 2019, 5:27 PM

See also T59704 and T98194

Closing per my comment above, since there was no reply. (But feel free to reopen.)