Help:Property constraints portal/Subject class/be-tarask

From Wikidata
Jump to navigation Jump to search
This page is a translated version of the page Help:Property constraints portal/Subject class and the translation is 33% complete.

subject type constraint (Q21503250) specifies that items with a given property should have a given type. This is also known as the domain of a property.

Subclass relations according to subclass of (P279) are taken into account: if a constraint demands that an item should be an instance of building (Q41176), it is not a violation if the item is an instance of skyscraper (Q11303), because there is a subclass of (P279) path from skyscraper (Q11303) to building (Q41176). (If an indirect relation should not be permitted, item-requires-statement constraint (Q21503247) can be used.)

If no constraint scope (P4680) is specified, this constraint is only checked on the main value of a statement.

Магчымыя дзеяньні

There are several possible ways to address a violation of this constraint:

Parameters

This constraint has two parameters (both mandatory):

relation (P2309)
Must be instance of (Q21503252), subclass of (Q21514624), or instance or subclass of (Q30208840). Describes whether the item should be an instance of the class(es), or a subclass of it/them, or whether both are allowed. This parameter must only be given once.
class (P2308)
Lists the classes that the item should have. Each class must be an item ID (no value Help or unknown value Help is not permitted).

Прыклады

Прыклад 1

Элемэнт, які мае зьвесткі place of birth (P19), мусіць быць прадстаўніком human, fictional character або animal.

property constraint
Normal rank subject type constraint
class human
fictional character
animal
relation instance of
0 references
add reference
add value

Прыклад 2

Элемэнт, які мае зьвесткі drug or therapy used for treatment (P2176), мусіць быць падклясам ад disease.

Шаблён

When the constraint is set to the property, the following template is automatically displayed in the property talk page. The template is created by Module:Constraints using Template:Constraint, invoked from Template:Property documentation. Translations are defined at Module:i18n/constraints.

Type “human (Q5), fictional character (Q95074): item must contain property “instance of (P31)” with classes “human (Q5), fictional character (Q95074)” 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). Known exceptions: Long Boi (Q106647853)
List of violations of this constraint: Database reports/Constraint violations/P512#Type Q5, Q95074, SPARQL

Сьпісы

Lists of properties which are set type constraint.