On 23/06/14 19:44, Jeroen De Dauw wrote:
Hey,
Question 1: Why don't we also have some
information about
statement/claim order? This seems to be necessary for using the
API JSON
internally as planned.
To answer the first part: probably because no one got to that yet. As
for the second part: how so? The internal format also does not have this.
I would have thought that the answer to your second point is that
Wikibase also needs to preserve the order, and JSON parsers do not
guarantee this for maps. Maybe I am miunderstanding this, but how can
the client-side Javascript build the statements in the correct order if
it just gets a map? Is there some built-in order in JSON maps after all?
Then we could just drop the other order fields too.
Question 2: Wouldn't it be more convenient to
store lists of things
in all cases, and have the "map" version just as an
optional API switch
for users who don't care about order (it could remain the default)? This
would help to retrieve order information more easily.
That would better serve the WDTK use case, and those who do a full
deserialization. I strongly suspect most users of the JSON do not fall
into that category.
My suggestion serves all users, since it gives you the old and the new
behaviour. Anyway, the requirements of WDTK are not any stronger than
the requirements of Wikibase itself -- information not available to
Wikibase won't need to be available to WDTK either.
Cheers,
Markus