Page MenuHomePhabricator

integrate exceptions as part of Wikibase datamodel of the entity concerned
Open, Needs TriagePublic

Description

Define exceptions of constraint as qualifiers of statements with property (instead of qualifier of constraint statement)

Reason:

  1. Currently the way to store exceptions is not scalable
  2. This does not work well for federated Wikibase instance
    • Although how should constraint work with federated Wikibase instance is itself a difficult issue
  3. No easy way to mark a violation as exception, and "mark as exception" is not tracked in the item history

We probably need to extend the Wikibase DataModel. Though a qualifier may be used, there's current no way to refer to a specific statement and statement IDs are currently not considered persistent.


Note (June 2021):

this could be an alternate ways to define exceptions or a replacement for the current approach

Event Timeline

Yes this solved some of the problems but not all.

If we need to check constraints on Commons (T230314), We may create another "exception" qualifier referring to Commons media, but this will not work if Meta becomes a Wikibase instance (see T173145). Of course making constraints works in arbitrary federated Wikibase instances involved much more issues, see P9457 (this is only a draft and WIP).

An additional reason is this will be more consistent with how tainted reference works, and the way external violation (against 3rd party database) will work.

Sample usecase someone mentioned on project chat not too long ago:

Another usecase: some identifiers are sometimes reassigned. The distinct value constraint would ideally take in account start and end date. An alternative could be just use the qualifier "follows"/"followed by" to point to previous uses.

For the distinct value constraint on taxon name (P225) (mentioned above), the exception could be marked with a qualifier " different from (P1889) " pointing to the other item.

This comment was removed by Esc3300.
Esc3300 renamed this task from Move exception of constraint from qualifier of constraint statement to part of statement metadata to Define exceptions to constraint as qualifiers of statements with property (instead of as a qualifier of the constraint statement).Jun 15 2021, 7:23 AM
Esc3300 updated the task description. (Show Details)
Bugreporter renamed this task from Define exceptions to constraint as qualifiers of statements with property (instead of as a qualifier of the constraint statement) to integrate exceptions as part of Wikibase datamodel of the entity concerned.Jun 15 2021, 10:26 AM

Yes. The qualifier approach should work well for point #3 you added above: "No easy way to mark a violation as exception" when many items fail the constraints, but once in a while a value is accurate and should be marked as double-checked.

I still believe that is_exception_to_constraint in the reference section would be the best way. (I create the property proposal)

I still don't see the case against that proposal. Can someone make it here?

For me, constraints should constrain (unless they have the level of suggestion defined), and exceptions should be exceptional. Those cases where the number of exceptions ends up skyrocketing are cases where either the constraints were conceived trying to generalize too small, specific and biased a set of cases, or there's a broader underlying problem of knowledge representation that is difficult to address and users choose to add exceptions to ignore it. The first reason for this task ("Currently the way to store exceptions is not scalable") is an effect of these problems, and I think we should solve them instead of thinking of a way to add even more exceptions. The Property that motivates this task (P225) is also mentioned at Wikidata:2020_report_on_Property_constraints#Exceptions in the context of some of the problems caused by exceptions; see also T244045.

Property constraints are part of the intensional definition of each Property, and their usefulness lies in the fact that we can check their consistency with an enumerative definition, of which all uses of the Property are automatically part. A finite list of current exceptions override this automatic enumerative definition, but it does so alongside, or with reference to, the intensional definition, which applies to a generally infinite number of possible present and future entities. Ideally, the intensional definition should never refer to the enumeration or vice versa, and in the case of Wikidata it's worse because these references are not controlled: as exceptions are implemented now, I can delete a constrained statement and still have the Item listed as an exception; and, as proposed to be implemented in this task, I could delete a constraint and still have exceptions to it.

For when there are many exceptions (to a constraint that truly makes sense) I would suggest either using the suggestion level or using mechanisms other than standard Property constraints; luckily, today there are many ways to check compliance with complex rules that don't involve the Property constraint system.

I still believe that is_exception_to_constraint in the reference section would be the best way. (I create the property proposal)

I still don't see the case against that proposal. Can someone make it here?

Maybe the exception https://www.wikidata.org/wiki/Q16645 for most constraints on https://www.wikidata.org/wiki/Property:P5086 : it could be a bunch of statements on https://www.wikidata.org/wiki/Q16645 , but it's unclear if that would really be better.

OTH, for T275392 anything that is based on the items directly seems preferable, even if it may not be theoretically appealing to non-contributors. It's still a valid constraint for these items and exceptions should be double-checked.