This page is a translated version of the page Help:Property constraints portal/Unique value and the translation is 13% complete.

distinct-values constraint (Q21502410) specifies that values for this property should be unique across all of Wikidata, and no other entity should have the same value in a statement for this property.

Almost all (external) identifier properties have such a constraint, since an ISBN-13 (P212) or Freebase ID (P646) should uniquely identify an entity. Other examples include flag (P163) and anthem (P85). Also Commons category (P373) should be unique because those categories typically have a unique Commons sitelink.

Properties with this constraint usually also have single-value constraint (Q19474404).

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

A qualifier can be defined as separator (P4155). This allows the same value on multiple entities as long as the separator qualifier is different.

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

  • It’s possible that the conflicting items are duplicates and should be merged.
  • It’s possible that the property value is erroneous on one of the conflicting items (e. g. a typo, accidentally transposed digits, etc.) and should be fixed.
  • It is possible that a separator (P4155) (or several of them) should be defined for the constraint, to declare that multiple items sharing a value are acceptable as long as they have certain different qualifiers.
  • It’s possible that the conflicting items are a rare, but legitimate exception to the constraint, and nothing should be done.

参数

This constraint has one optional parameter:

separator (P4155): Contains the separators. May contain one or more properties. If specified, multiple statements with the same value do not constitute a violation of this constraint as long as they have different qualifiers for the properties specified here.

示例

property constraint
  distinct-values constraint
0 references
add reference


add value

模板

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.

Distinct values: this property likely contains a value that is different from all other items. (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/P236#Unique value, SPARQL (every item), SPARQL (by value)

Exceptions

Cases where uniqueness should or could be evaluated differently and ways to handle such exceptions:

  • list exceptions as such on property constraints: available [1]
  • indicate that an identifier is shared with another item: not available [2]
  • indicate that an identifier was reassigned: not available
  • distinct best value constraint: not available [3]
  • distinct case insensitive: not available, handling attempted by normalizing values [4]
  • distinct value including uses in references: available [5]
  • define uniqueness per namespace: not available [6]
  • define uniqueness per entity type (e.g. lexeme and item): not available

Lists

Lists of properties which are set distinct values constraint.

Notes