[Wikidata-bugs] [Maniphest] [Updated] T189746: Have a calendar converter for input dates at wikidata

2018-10-17 Thread Jc3s5h
Jc3s5h added a comment.
@Huji The task description talks about inputting data, not reading data that is already present.

When it comes to Wikidata, ISO is a dirty word. First of all, Wikidata supports two calendars, Gregorian and Julian. ISO 8601 only allows Gregorian. So whenever you write ISO, you are writing that you are going to ignore all Julian dates that have been entered into WIkidata, or you are going to falsify them by pretending they are Gregorian when they are not.

Using Isaac Newton as an example, his birthdate is December 25, 1642, Julian. Looking at the page source, one find this (just cut and paste, no attempt to get the whole statement, whatever that is)

{\"mainsnak\":{\"snaktype\":\"value\",\"property\":\"P569\",\"datavalue\":{\"value\":{\"time\":\"+1642-12-25T00:00:00Z\",\"timezone\":0,\"before\":0,\"after\":0,\"precision\":11,\"calendarmodel\":\"http://www.wikidata.org/entity/Q1985786\"}

If one interprets the "1642-12-25" but ignores "http://www.wikidata.org/entity/Q1985786\" one gets the wrong answer.TASK DETAILhttps://phabricator.wikimedia.org/T189746EMAIL PREFERENCEShttps://phabricator.wikimedia.org/settings/panel/emailpreferences/To: Jc3s5hCc: Huji, Jc3s5h, Mehdi, Doostdar, alanajjar, Aklapper, Yamaha5, Nandana, Lahi, Gq86, GoranSMilovanovic, QZanden, dachary, LawExplorer, Wikidata-bugs, aude, Ricordisamoa, Sjoerddebruin, Mbch331___
Wikidata-bugs mailing list
Wikidata-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs


[Wikidata-bugs] [Maniphest] [Updated] T189746: Have a calendar converter for input dates at wikidata

2018-10-16 Thread Huji
Huji added a comment.
There seems to be some miscommunication and misunderstanding here that I might be able to clarify.

MediaWiki supports several calendars in addition to what PHP supports itself (through strtotime() etc.) For instance, MediaWiki has supported for Solar Hijri calendar (aka Iranian calendar) since 827d6dcd86bf5bc3340ac5556b757434710691c2 (which I committed in 2007) and similarly for several other calendar systems (the Lunar Hujri calendar, aka Arabic calendar, the Hebrew calendar, and so forth).

What is being asked here, I believe, is that users of Wikidata can look at an item that has some date attributes, and instead of (or in addition to) seeing the dates in their original format (which is a data type of "Point in time" shown as a Gregorian date, see for instance P569) they would like to have the ability to see that date converted into a different calendar system.

None of the algorithms we have for converting between calendar systems are 100% accurate (for reasons that go beyond this discussion), and they are especially inaccurate for dates that are one or more centuries in the past or in the future. We are using them in MediaWiki to show the current date in a different calendar system, for which they tend to be much more accurate. In Wikidata, however, I would venture a guess that many/most dates are not for relatively current events.

Additionally, the data in Wikidata is also probably subject to similar inaccuracies. What you find as the date of birth of Ibn Arabi (10 November 1240) is probably based on some conversion someone did from the Lunar Hijri calendar to the Gregorian calendar (as the original documents about him in which his date of birth is mentioned are in Arabic and mention it in the Lunar Hijri calendar only). As stated above, all of these conversions are subject to assumptions and inaccuracies, and converting them back to the Lunar Hijri calendar might give a result different form the original date (e.g. because different algorithms were used for each of the two date conversions).

So all in all, I am not in favor of making this a core feature. Instead, I think what we should do is (a) make sure that date fields contain meta-data that shows that date in some standard format (e.g. an ISO 8601) and (b) create front-end gadgets for Wikidata that can consume this metadata and show the date in any additional calendar systems.

So for instance, when you go to Ibn Arabi and look at the HTML source of the page for the DIV element that contains the date of birth, you should find some attribute like data-date-ISO-value="1165-07-28" so that a JS-based gadget then be able to find all fields with a data-date-ISO-value attribute and run conversion as desired by the user. (Of note, JS-based conversion for all these calendar systems exist, and they are pretty light to run on the client-side).TASK DETAILhttps://phabricator.wikimedia.org/T189746EMAIL PREFERENCEShttps://phabricator.wikimedia.org/settings/panel/emailpreferences/To: HujiCc: Huji, Jc3s5h, Mehdi, Doostdar, alanajjar, Aklapper, Yamaha5, Nandana, Lahi, Gq86, GoranSMilovanovic, QZanden, dachary, LawExplorer, Wikidata-bugs, aude, Ricordisamoa, Sjoerddebruin, Mbch331___
Wikidata-bugs mailing list
Wikidata-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs


[Wikidata-bugs] [Maniphest] [Updated] T189746: Have a calendar converter for input dates at wikidata

2018-10-16 Thread Lydia_Pintscher
Lydia_Pintscher added a project: Wikidata.
TASK DETAILhttps://phabricator.wikimedia.org/T189746EMAIL PREFERENCEShttps://phabricator.wikimedia.org/settings/panel/emailpreferences/To: Lydia_PintscherCc: Jc3s5h, 4nn1l2, Mehdi, Doostdar, alanajjar, Aklapper, Yamaha5, Nandana, Lahi, Gq86, GoranSMilovanovic, QZanden, dachary, LawExplorer, Wikidata-bugs, aude, Ricordisamoa, Sjoerddebruin, Mbch331___
Wikidata-bugs mailing list
Wikidata-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs


[Wikidata-bugs] [Maniphest] [Updated] T189746: Have a calendar converter for input dates at wikidata

2018-10-15 Thread Yamaha5
Yamaha5 added a parent task: T87764: Bugs related to time datatype (tracking).
TASK DETAILhttps://phabricator.wikimedia.org/T189746EMAIL PREFERENCEShttps://phabricator.wikimedia.org/settings/panel/emailpreferences/To: Yamaha5Cc: 4nn1l2, Mehdi, Doostdar, alanajjar, Aklapper, Yamaha5, dachary, Wikidata-bugs, Ricordisamoa, Sjoerddebruin, Mbch331___
Wikidata-bugs mailing list
Wikidata-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs


[Wikidata-bugs] [Maniphest] [Updated] T189746: Have a calendar converter for input dates at wikidata

2018-10-15 Thread Yamaha5
Yamaha5 removed a subtask: T87764: Bugs related to time datatype (tracking).
TASK DETAILhttps://phabricator.wikimedia.org/T189746EMAIL PREFERENCEShttps://phabricator.wikimedia.org/settings/panel/emailpreferences/To: Yamaha5Cc: 4nn1l2, Mehdi, Doostdar, alanajjar, Aklapper, Yamaha5, dachary, Wikidata-bugs, Ricordisamoa, Sjoerddebruin, Mbch331___
Wikidata-bugs mailing list
Wikidata-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs


[Wikidata-bugs] [Maniphest] [Updated] T189746: Have a calendar converter for input dates at wikidata

2018-10-15 Thread Yamaha5
Yamaha5 added a subtask: T87764: Bugs related to time datatype (tracking).
TASK DETAILhttps://phabricator.wikimedia.org/T189746EMAIL PREFERENCEShttps://phabricator.wikimedia.org/settings/panel/emailpreferences/To: Yamaha5Cc: 4nn1l2, Mehdi, Doostdar, alanajjar, Aklapper, Yamaha5, dachary, Wikidata-bugs, Ricordisamoa, Sjoerddebruin, Mbch331___
Wikidata-bugs mailing list
Wikidata-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs


[Wikidata-bugs] [Maniphest] [Updated] T189746: Have a calendar converter for input dates at wikidata

2018-10-15 Thread Yamaha5
Yamaha5 edited projects, added MediaWiki-extensions-WikibaseClient; removed Wikidata.
TASK DETAILhttps://phabricator.wikimedia.org/T189746EMAIL PREFERENCEShttps://phabricator.wikimedia.org/settings/panel/emailpreferences/To: Yamaha5Cc: alanajjar, Aklapper, Yamaha5, dachary, Wikidata-bugs, Ricordisamoa, Sjoerddebruin, Mbch331, Nandana, Lahi, Gq86, GoranSMilovanovic, QZanden, LawExplorer, aude___
Wikidata-bugs mailing list
Wikidata-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs