Peter,
you might be looking for this:
https://www.mediawiki.org/wiki/Wikibase/DataModel#Dates_and_times
Cheers, Denny
On Wed, Jul 1, 2015 at 9:48 AM Peter F. Patel-Schneider < pfpschneider@gmail.com> wrote:
Thanks.
This helps in finding out how to reproduce the numbers.
However, I'm still confused as to how these bits of data are part of the Wikidata data/knowledge model. Where is the description of getPreferredCalendarModel, for example?
http://javadox.com/org.wikidata.wdtk/wdtk-datamodel/0.1.0/org/wikidata/wdtk/... Is a *partial* description of what is going on. Changes to this document would be somewhat useful. However, what I'm really looking for is a description of how time works in Wikidata.
peter
PS: I note that there are lots of aspects of TimeValue that are only suitable for the Gregorian and Julian calendars.
On 07/01/2015 09:24 AM, Markus Krötzsch wrote:
On 01.07.2015 18:03, Peter F. Patel-Schneider wrote: ...
Even the very nice email from Markus that gives numbers does not provide any information on where the numbers come from.
I just ran a simple Java program based on Wikidata Toolkit to count the date values. The features I used for counting are all part of the data (concretely I accessed: year number, precision, and calendar model). I used the JSON dump of 22 June 2015. The program counted all dates that occur in any place (main values of statements, qualifiers, and references). No other special processing was done.
Below is the main code snippet that did the counting, in case my description was too vague. If you want to get your own numbers, it does not require much (I just modified one of the example programs in Wikidata Toolkit that gathers general statistics). Running the code took about 25min on my laptop (the initial dump download took longer though). The SPARQL endpoint at https://wdqs-beta.wmflabs.org/ should also return useful counts if it does not time out on the very large numbers. It uses life data.
Best regards,
Markus
// after determining that snak is of appropriate type: String cm = ((TimeValue) ((ValueSnak) snak).getValue()) .getPreferredCalendarModel(); if (TimeValue.CM_GREGORIAN_PRO.equals(cm)) { this.countGregDates++; } else if (TimeValue.CM_JULIAN_PRO.equals(cm)) { this.countJulDates++; } else { System.err.println("Weird calendar model: " + ((ValueSnak) snak).getValue()); }
if (((TimeValue) ((ValueSnak) snak).getValue()).getPrecision() <= TimeValue.PREC_MONTH) { return; }
long year = ((TimeValue) ((ValueSnak) snak).getValue()).getYear(); if (year >= 1923) { this.countModernDates++; } else if (year >= 1753) { this.countAlmostModernDates++; } else if (year >= 1582) { this.countTransitionDates++; } else { this.countOldenDates++; }
_______________________________________________ Wikidata mailing list Wikidata@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikidata
Wikidata mailing list Wikidata@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikidata