Help:Ограничения свойств/Тип элемента

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 42% complete.
Outdated translations are marked like this.

Ограничение «subject type constraint (Q21503250)» определяет, что данное свойство должно быть только у элементов определённого типа. Это также известно как область применения свойства.

Например, у элементов со свойством date of birth (P569) должно быть указано, что instance of (P31) human (Q5) или animal (Q729), а элементы со свойством «sRGB color hex triplet (P465)» должны быть помечены как subclass of (P279) color (Q1075).

Учитываются отношения подклассов, определяемые согласно свойству «subclass of (P279)»: если ограничение требует, чтобы элемент был экземпляром «building (Q41176)», то не будет нарушением, если элемент указан как экземпляр «skyscraper (Q11303)», поскольку skyscraper (Q11303) — это subclass of (P279) building (Q41176). (Если косвенная связь не должна быть разрешена, можно использовать item-requires-statement constraint (Q21503247).)

Если constraint scope (P4680) не определена, это ограничение проверяется только для основного значения элемента.

Возможные действия

На нарушение этого ограничения можно реагировать одним из следующих способов:

Параметры

У этого ограничения два обязательных параметра:

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).

Examples

Example 1

Item which has place of birth (P19) data should be instance of human, fictional character or animal.

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


add value

Example 2

Item which has drug or therapy used for treatment (P2176) data should be subclass of disease.

Template

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.

Lists

Lists of properties which are set type constraint.