Hi all!
This is an announcement for a breaking change to the output format of the WikibaseQualityConstraints constraint checking API, to go live on 10 October 2017. It affects all clients that use the *wbcheckconstraints* API action. (We are not aware of any such clients apart from the *checkConstraints* gadget, which has been adapted.)
We are soon going to check constraints not just on the main snak of a statement, but also on qualifiers and references (T168532 https://phabricator.wikimedia.org/T168532). However, the current API output format of the *wbcheckconstraints* API action cannot accommodate any other constraint check results. To resolve this issue, we are introducing a new, more flexible output format for the API, which can contain constraint check results on all kinds of snaks and also leaves room for future expansion (e. g. for T168626 https://phabricator.wikimedia.org/T168626). The new format is based on the Wikibase JSON format, and documented (along with the old format) on mw:Wikibase/API#wbcheckconstraints https://www.mediawiki.org/wiki/Wikibase/API#wbcheckconstraints.
If you use the *wbcheckconstraints* API action in your tools, the safest option is to make them support both output formats for the transitional period. It’s easy to determine which format the API returned, because the new format contains the fixed key "claims" on the second level, which will never happen in the old format. You can see an example of this for the *checkConstraints* gadget in change I99379a96cd https://gerrit.wikimedia.org/r/#/c/373323/, specifically the new extractResultsForStatement function.
The new API output format is already enabled on the Wikidata constraints test system https://wikidata-constraints.wmflabs.org/. You can test your tools or other code there.
Please let us know if you have any comments or objections.
-- Lucas
Relevant tickets:
- T168532 https://phabricator.wikimedia.org/T168532 - T174544 https://phabricator.wikimedia.org/T174544
Relevant patches:
- https://gerrit.wikimedia.org/r/#/c/369420 - https://gerrit.wikimedia.org/r/#/c/373323/
wikidata-tech@lists.wikimedia.org