Page MenuHomePhabricator

Option to stop saving statements if there is constraint violations
Open, Needs TriagePublicFeature

Description

It is better to prevent writing some wrong values to Wikidata than fixing its after write. Data validation might be based on existing constraints system. For example Format constraints are very useful for this.

The following changes are need to be done:

  1. One more possible value should be added for https://www.wikidata.org/wiki/Property:P2316. Something like "checked before write".
  2. wbcreateclaim, wbsetclaim and other edit APIs should validate incoming value using all constraints with "checked before write" status. The APIs should fail if some constraint is violated. Error message should have details about violated constraint.
  3. The APIs user should have ability to avoid some constraints check specifying some parameter. For example ignored_constraints=Q21510855. This is needed to work with circular links and similar cases.
  4. Wikidata UI also should validate values before write. Same as edits via API.
  5. Error message on UI should have button "ignore the error and write the value anyway".

See also: T168626: Check constraints before saving statements