Help:Ограничения свойств/Наличие свойства

This page is a translated version of the page Help:Property constraints portal/Item and the translation is 54% complete.

item-requires-statement constraint (Q21503247) specifies that items using this property should have a certain other statement. The equivalent constraint for the value of a statement is value requires claim.

For example, items that have a killed by (P157) statement should also have statements for place of death (P20) and date of death (P570), as well as the statement manner of death (P1196)homicide (Q149086).

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

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

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

  • Наиболее вероятный случай: к элементу должны быть добавлены недостающие утверждения.
  • Возможно, текущий элемент вообще не должен содержать такого утверждения, и это утверждение следует удалить.
  • Возможно, что элемент является редким, но обоснованным исключением из ограничения, и нет необходимости что-либо делать.

Параметры

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

property (P2306)
Contains the property of the missing statement. Must contain exactly one property (no value Help or unknown value Help is not permitted). To add multiple required statements, add multiple constraints of this type.
item of property constraint (P2305)
Optional; contains the allowed values. no value Help and unknown value Help are interpreted literally, like any normal value (statements with no value Help or unknown value Help are only allowed if these special values are also given in the allowed values).
If this parameter is missing, the constraint only requires that a statement with the given property exists, but places no restriction on the value of that statement.

Примеры

Пример 1

Example setting for killed by (P157).

property constraint
  item-requires-statement constraint
property place of death
0 references
add reference
  item-requires-statement constraint
property date of death
0 references
add reference
  item-requires-statement constraint
property manner of death
item of property constraint homicide
0 references
add reference


add value

Пример 2

Example setting for Quebec cultural heritage directory ID (P633) which is identifier for the cultural heritage of Quebec. So if certain item has this identifier, the item should be in Canada.

Automatic violations fix

KrBot automatically fixes this constraint violations in the following case:

Шаблон

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.

constraint “item-requires-statement constraint (Q21503247)” declaration error: “Module:Constraints/search:24: attempt to index a nil value”.

Списки

Lists of properties which are set item requires statement constraint.