Am 29.04.2014 03:53, schrieb Amir Ladsgroup:
> It's not a big deal, parsing it would be no problem, I can use it in
> parsing data from Bio template in Italian Wikipedia but I have to use
> "precision" argument in snak. Am I right?

Yes, exactly.

> what value have to set for precision if I have just year (and no month
> and day)?

If you just have they yea, the precision value would be 9. This is arbitrary and
obscure, sorry. I have filed a bug to fix this:

For reference, here is the table of precisions to be used for time values, as
defined in the TimeValue class:

        const PRECISION_Ga = 0; // Gigayear
        const PRECISION_100Ma = 1; // 100 Megayears
        const PRECISION_10Ma = 2; // 10 Megayears
        const PRECISION_Ma = 3; // Megayear
        const PRECISION_100ka = 4; // 100 Kiloyears
        const PRECISION_10ka = 5; // 10 Kiloyears
        const PRECISION_ka = 6; // Kiloyear
        const PRECISION_100a = 7; // 100 years
        const PRECISION_10a = 8; // 10 years
        const PRECISION_YEAR = 9;
        const PRECISION_MONTH = 10;
        const PRECISION_DAY = 11;
        const PRECISION_HOUR = 12;
        const PRECISION_MINUTE = 13;
        const PRECISION_SECOND = 14;

If you have something like "between 1846 and 1855", you can use the "before" and
"after" fields of the time value:

  time: "+00000001850-00-00T00:00:00Z",
  precision: 9,
  before: 4,
  after: 5

This means the "main" value is 1850, given as a year, with a lower bound four
years before and an upper bound 5 years after the "main" value (before and after
are given in the unit specified by the precision value). The "main" value is
what is going to be displayed per default; it will also be used for sorting
query results (once we have queries).

This is a bit complicated, but should allow you to actually represent uncertain
dates. We made it so you can be precise about the uncertainty :)


Daniel Kinzler
Senior Software Developer

Wikimedia Deutschland
Gesellschaft zur Förderung Freien Wissens e.V.

Wikidata-l mailing list

Reply via email to