Page MenuHomePhabricator

Check constraints before saving statements
Open, LowPublic

Description

It would be great to check constraints on a new or edited statement before it is saved, so that possible errors can be corrected before the incorrect statement is added.

(I think this feature has been planned, at least as a “nice to have for the future”, for some time – I remember it came up when the API was added – but as far as I can tell we didn’t have a task for it before.)

On a more technical level, this means adding support for passing JSON snippets (for snaks, statements, of even full entities?) instead of entity or claim IDs into wbcheckconstraints (or a new API module?), which could also be used externally, e. g. before a large data import. (For instance, the HarvestTemplates tool already includes a partial implementation of constraint checks, and aborts imports which fail some constraints.)

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJun 22 2017, 1:52 PM

Let's please only do this once we have the current checking in a good shape and integrated well. I want feedback for that and cleaned up constraints before we take that step. I also want to see how much bad editing is done because of them before we move on.

thiemowmde triaged this task as Low priority.Jul 4 2017, 8:53 AM
thiemowmde added a project: patch-welcome.
thiemowmde added a subscriber: Jonas.
Hjfocs added a subscriber: Hjfocs.Dec 4 2017, 3:52 PM
abian added a subscriber: abian.Oct 15 2019, 5:15 PM

One concern here (apparently not mentioned before) is that not all constraints can be satisfied by a single edit, for example “symmetric” and “inverse”.