Hello everybody,

Since I am working on the conversion from the dump files to the wdtk data model, I will have to take apart the "refs" section of the JSON representing the stored items.

Now a "refs"-section most likely looks like this:
(Tried to format it for readability)

"refs":
   [
     [
       [
      "value",248,
"wikibase-entityid",{"entity-type":"item","numeric-id":15241312}
      ],
      [
      "value",577,
"time",{"time":"+00000002013-10-28T00:00:00Z","timezone":0,"before":0,"after":0,"precision":11,"calendarmodel":"http:\/\/www.wikidata.org\/entity\/Q1985727"}
      ]
    ]
  ]

So I figured out the following: The outer array groups all references. The second level array groups information about one reference (so if we had multiple references, we would also have multiple second-level arrays) and the inner arrays each group one specific information about one specific reference (as determined by the second level array they are nested in).
Am I correct so far?

The integer following the "value"-string denotes what the following information is about. So if I read that the value is 577, I know that there must be a specification of time, don't I?

Is there any specific reason, why this is done in array form and not in a JSON object? (Since the "value"-key is always there one could know from its value, what other keys must be available.)
If yes, why mention the type of information (e.g. "time") again?
Am I overlooking something?

Thanks so far,
-- Fredo Erxleben

_______________________________________________
Wikidata-tech mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikidata-tech

Reply via email to