Last modified: 2014-11-03 14:26:36 UTC
The structures returned by the API are optimized for "raw" API usage (e.g. via Bots). Statements grouped by property as well as qualifiers and reference snaks are returned as maps. While there are awkward "qualifiers-order" and "snaks-order" attributes for qualifiers and reference snaks, there is no way to determine the order of statements via the API. Consequently, no reliable mechanism to manually order statements can be implemented. Instead of having to apply complex logic evaluating special attributes like "qualifiers-order" and "snaks-order", there should be a way to retrieve natively ordered structures from the API. The proposal is to provide a flag that, when submitted to API modules, will make lists instead of maps getting returned.
Currently we get our data from wbEntity, too, so that would have to have this grouping, too.
Of course, the front-end needs to be able to submit order changes to the API as well. At the moment, this can be done by submitting a plain "index" parameter which, probably, is not the most robust solution.