Documentation

constraint scope
defines the scope where a constraint is checked – can specify the usage scope (main value of a statement, on qualifiers, or on references) and the datatype (Wikibase item, property, lexeme, etc.)
RepresentsWikidata constraint scope (Q54718960)
Data typeItem
Domain
According to this template: Wikidata property (Q18616576)
According to statements in the property:
Wikidata property (Q18616576)
When possible, data should only be stored as statements
Allowed valuesconstraint checked on main value (Q46466787), constraint checked on qualifiers (Q46466783), constraint checked on references (Q46466805), Wikibase item (Q29934200), Wikibase property (Q29934218), Wikibase lexeme (Q51885771), Wikibase form (Q54285143), Wikibase sense (Q54285715) or Wikibase MediaInfo (Q59712033)
Examplestart time (P580)constraint checked on qualifiers (Q46466783)
reference URL (P854)constraint checked on main value (Q46466787)
Robot and gadget jobsKrBot could ignore constraints without “main value” scope
See alsoproperty constraint (P2302), property scope (P5314)
Lists
Proposal discussionProposal discussion
Current uses
Total225
Main statement10.4% of uses
Qualifier22499.6% of uses
Search for values
[create Create a translatable help page (preferably in English) for this property to be included here]
Scope is as qualifier (Q54828449): the property must be used by specified way only (Help)
Exceptions are possible as rare values may exist. Exceptions can be specified using exception to constraint (P2303).
List of violations of this constraint: Database reports/Constraint violations/P4680#Scope, SPARQL
Allowed entity types are Wikibase property (Q29934218): the property may only be used on a certain entity type (Help)
Exceptions are possible as rare values may exist. Exceptions can be specified using exception to constraint (P2303).
List of violations of this constraint: Database reports/Constraint violations/P4680#Entity types
Type “Wikidata property (Q18616576): item must contain property “instance of (P31)” with classes “Wikidata property (Q18616576)” or their subclasses (defined using subclass of (P279)). (Help)
Exceptions are possible as rare values may exist. Exceptions can be specified using exception to constraint (P2303).
List of violations of this constraint: Database reports/Constraint violations/P4680#Type Q18616576, SPARQL
Item “property constraint (P2302): Items with this property should also have “property constraint (P2302)”. (Help)
Exceptions are possible as rare values may exist. Exceptions can be specified using exception to constraint (P2303).
List of violations of this constraint: Database reports/Constraint violations/P4680#Item P2302, search, SPARQL

values

edit

  Notified participants of WikiProject property constraints

I’ve created three new items for the values of this property, since that seemed to be the consensus on the proposal discussion: constraint checked on main value, constraint checked on qualifiers, and constraint checked on references. I’ve opted on the side of caution here, with long, unambiguous names – if you think they should be shorter (e. g. just “main value”, “qualifiers”, “references”), feel free to change them :) --Lucas Werkmeister (WMDE) (talk) 10:58, 22 December 2017 (UTC)Reply

I like the descriptive labels. —MisterSynergy (talk) 11:07, 22 December 2017 (UTC)Reply
I also prefer long less-unambiguous names over shorter names. --Jarekt (talk) 13:01, 22 December 2017 (UTC)Reply
Longer labels, please. - PKM (talk) 19:52, 22 December 2017 (UTC)Reply

not yet supported by WikibaseQualityConstraints

edit

Just for the record – the WikibaseQualityConstraints extension (and therefore the checkConstraints gadget) don’t yet support this parameter. I’ll add a comment here as soon as it does. --Lucas Werkmeister (WMDE) (talk) 11:11, 22 December 2017 (UTC)Reply

  Done Sorry, I forgot to update this… but it’s definitely supported now, and has been for a few weeks :) --Lucas Werkmeister (WMDE) (talk) 16:49, 9 February 2018 (UTC)Reply

default scope

edit

  Notified participants of WikiProject property constraints

I kinda glossed over this question in the proposal (sorry) – what should the default scope of a constraint be? Currently, WikibaseQualityConstraints hard-codes that some constraint types are also checked on qualifiers and references, and some aren’t. Should I keep it this way, with hopefully reasonable defaults, and the option to override them with constraint scope (P4680) – or would you prefer to check all constraints only on the main value by default, and always explicitly specify constraint scope (P4680) when a constraint should also be checked elsewhere?

For the record, the current status is:

Of course, that’s not necessarily the final list of defaults even if we decide to keep the defaults – for example, we could check constraint types that are purely about the value (like one-of constraint (Q21510859) or format constraint (Q21502404)) everywhere, but be more cautious about more ambiguous constraints like subject type constraint (Q21503250) (i. e., by default only check them on the main value). --Lucas Werkmeister (WMDE) (talk) 11:33, 22 December 2017 (UTC)Reply

Checking type constraint on qualifiers often doesn't make sense. When the subject doesn't match the type but the object does currently a constraint violation is thrown. This happens for example with all property examples. As long as it behaves that way I think the default should be main value/subject only. ChristianKl11:39, 22 December 2017 (UTC)Reply
There are many situations where it does make sense, though (some examples are in phabricator:T177388) – I’ve gone back and forth on this a few times, it’s not trivial :) and property examples are a completely different topic (phabricator:T183267), but in general, if the object should match the type and not the subject, then the constraint type should be value-type constraint (Q21510865)! --Lucas Werkmeister (WMDE) (talk) 15:27, 22 December 2017 (UTC)Reply

This property now supports restricting by entity type as well

edit

I've added entity types in Special:Diff/1502064197 because phab:T269724 has added support for this property to restrict constraints to specific entity types as well as to specific locations. For example, we can now say that a constraint only applies on items. - Nikki (talk) 09:20, 23 September 2021 (UTC)Reply

Return to "P4680" page.