Wikidata:Property proposal/constraint scope

constraint scope edit

Originally proposed at Wikidata:Property proposal/Property metadata

Descriptiondefines the scope where a constraint is checked – on the main value of a statement, on qualifiers, and/or on references
Data typeItem
DomainWikidata property (Q18616576)
Allowed values“main value”, “qualifier”, “reference” (there are items for the first two – Wikibase value (Q19798642) and Wikidata qualifier (Q15720608) – but I’m not sure if it’s correct to use them, so perhaps it would be better to create three fresh values that are only used to define constraints)
Examplestart time (P580)property constraint (P2302)subject type constraint (Q21503250)constraint scopeWikidata qualifier (Q15720608)
Planned usechange the WikibaseQualityConstraints extension (which powers the checkConstraints gadget) to respect the scope when deciding which constraints to check where
Robot and gadget jobsKrBot could ignore constraints without “main value” scope
See alsoproperty constraint (P2302)
Motivation

The checkConstraints gadget checks some constraints on qualifiers and references; however, determining which constraints to check on qualifiers and references and which not to check is difficult, and I have now come to the conclusion that it’s not possible at all to make a satisfactory decision purely on the constraint type: for instance, some type constraints make sense in qualifiers (taxon author (P405) as a qualifier of taxon name (P225) should only be used on items of the class taxon (Q16521)), but others do not (the type constraint for time interval (Q186081) on start time (P580) makes sense when start time (P580) is used in a main statement, but not when it is used as a qualifier). Therefore, I propose the introduction of a constraint scope constraint parameter, which declares explicitly where a constraint should and shouldn’t be checked.

Note: Jura1 has observed that we might want other kinds of “scopes” as well – for instance, criterion used (P1013) is used on many properties, but the values that make sense vary depending on the main property. So we might want to call this property something more specific, perhaps “constraint scope type”, so that other parameters that define the scope in a different way can also be defined.

Some previous discussion on this can be found on Wikidata talk:WikiProject property constraints. Lucas Werkmeister (WMDE) (talk) 17:42, 12 December 2017 (UTC)[reply]

Discussion

  Notified participants of WikiProject property constraints

  WikiProject Properties has more than 50 participants and couldn't be pinged. Please post on the WikiProject's talk page instead.

  1. Which values should be used? Wikibase value (Q19798642), Wikidata qualifier (Q15720608), and a new item for “reference”, or three new items specifically for constraint scopes?
  2. Should this be labeled just “constraint scope” or something more specific, like “constraint scope type”, to leave room for other kinds of constraint scopes to be added in the future?