Hi all!

This is an announcement for a breaking change to the output format of the WikibaseQualityConstraints constraint checking API, to go live on . 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). 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). The new format is based on the Wikibase JSON format, and documented (along with the old format) on mw: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, specifically the new extractResultsForStatement function.

The new API output format is already enabled on the Wikidata constraints test system. You can test your tools or other code there.

Please let us know if you have any comments or objections.

-- Lucas

Relevant tickets:

Relevant patches:

--
Lucas Werkmeister
Software Developer (Intern)

Wikimedia Deutschland e. V. | Tempelhofer Ufer 23-24 | 10963 Berlin
Phone: +49 (0)30 219 158 26-0
https://wikimedia.de

Imagine a world, in which every single human being can freely share in the sum of all knowledge. That‘s our commitment.

Wikimedia Deutschland - Gesellschaft zur Förderung Freien Wissens e. V. Eingetragen im Vereinsregister des Amtsgerichts Berlin-Charlottenburg unter der Nummer 23855 B. Als gemeinnützig anerkannt durch das Finanzamt für Körperschaften I Berlin, Steuernummer 27/029/42207.