Hi,

On 05.09.2012 10:39, John Erling Blad wrote:
Please note that this is a breaking change for bots!

It is decided that the module wbsetitem will change from the present
"short form" in the json structure to a "long form". Exactly how the
long form will be is still a bit open, but it will be closer to the
json output format. The changes also makes it possible to use a
key-less format as the language and site id will be available inside
the long form.

The following short form will be WRONG in the future
{
   "labels":{
     "de":"Foo",
     "en":"Bar"
   }
}

Here we have the Problem, that we cannot add additional information, like a short description or anything similar. So this is absolutely necessary.

This long form will be RIGHT in the future
{
   "labels":{
     "de":{"value":"Foo","language":"de"},
     "en":{"value":"Bar","language":"en"}
   }
}

do you really want redundant information?

And also this will be RIGHT
{
   "labels":[
     {"value":"Foo","language":"de"},
     {"value":"Bar","language":"en"}
   ]
}

Not easy browsable by using labels[lang] or labels.lang. Iterating through different labels is needed.

so why not using:

{
  labels:[
    de:{value:"Foo", source:whatever_de},
    en:{value:"Bar", source:whatever_en}
  ]
}

Here you can iterate through all items using their key and the value object:

for (key in labels) {
  console.log(labels[key])
}

Marco

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

Reply via email to