Community Wishlist/Wishes/Wikidata: Enable the "class" and "relation" parameters on more constraint types

Wikidata: Enable the class and relation parameters on more constraint types

Submitted

< All wishes

Description

Problem: Some extremely useful constraints cannot currently be created. Where a workaround is feasible, it results in large, difficult-to-maintain, and often incomplete constraints (examples below).

Proposed solution: Add support for the parameters P2308 (class) and P2309 (relation) to the none-of, item-requires-statement, and conflicts-with constraint types, to specify classes that property values may or may not belong to. (These parameters are already supported by subject-type and value-type constraints.) Or alternately, create three new constraint types with this functionality.

More details: These three constraint types support allowing or disallowing specific property values using P2305 (item of property constraint), but they do not support allowing or disallowing classes of values. This leads to 1) the creation of large, difficult-to-maintain, and often incomplete constraints (examples 1-3 below) that attempt to list every applicable property value, and 2) the absence of useful constraints when the values are just too numerous to list (example 4).

The effect of the solution will be to natively enable the three forms of constraint in green in the lower right of this table:

...one of these items, use: ...a member or subclass of these classes, use:
If the value of the statement... should be... one-of value-type
should not be... none-of none-of w/class+relation
If the value of another statement on the item... should be... item-requires-statement item-requires-statement w/class+relation
should not be... conflicts-with conflicts-with w/class+relation

Examples:

  1. This none-of constraint has 33 values of "item of property constraint", which are meant to include all recurring events, but are certainly not exhaustive. Instead, these could all be replaced with class = recurring event (Q15275719), relation = instance or subclass of, which would be exhaustive. This query gives more constraints that may be candidates for this sort of simplification.
  2. This item-requires-statement constraint has 39 values of "item of property constraint", which are meant to include all filmmaking occupations, but are likely not exhaustive. Instead, these entries could be replaced with class = filmmaking occupation (Q4220920), relation = instance of, which would be exhaustive. This query gives more such constraints.
  3. This conflicts-with constraint has 27 values of "item of property constraint", which are meant to include all types of crime, but are likely not exhaustive. Instead, these could all be replaced with class = crime (Q83267), relation = subclass of, which would be exhaustive. This query gives more such constraints.
  4. (new constraint): The value of instance of (P31) should not be a taxon (Q16521). (If the item is an individual organism (Q110224119), it should use individual of taxon (P10241); if the item is a taxon, it should use parent taxon (P171).) As of writing, 18,080 items violated this rule: (query). Obviously, we can't list all taxons in a constraint. Under the proposal, this rule could be expressed with a none-of constraint on instance of (P31), with class = taxon (Q16521) and relation = instance of.

Assigned focus area

Unassigned.

Type of wish

Feature request

Wikidata

Affected users

Wikidata users and editors 

Phabricator tasks

T293487, T347628

Other details

  • Created: 18:32, 15 July 2024 (UTC)
  • Last updated: 03:02, 16 July 2024 (UTC)
  • Author: Swpb (talk)