Help:Property constraints portal/Diff within range
|This is the documentation page for a particular constraint type. See Help:Property constraints portal for a general overview of property constraints.|
difference within range constraint (Q21510854) specifies that the difference between the values for two properties should be within a certain range or interval. This constraint is available for quantity or date properties.
WikibaseQualityConstraints normalizes the range endpoints before checking this constraint; for example, the intervals and are equivalent.
If no constraint scope (P4680) is specified, this constraint is only checked on the main value of a statement. This is also the only currently supported scope.
There are several possible ways to address a violation of this constraint:
- It’s possible that the value in the statement with the constraint is incorrect and should be fixed.
- It’s possible that the value in the other statement is incorrect and should be fixed.
- It’s possible that one of the two statements should be removed completely.
- It’s possible that the item is a rare, but legitimate exception to the constraint, and nothing should be done.
This constraint has three mandatory parameters:
- property (P2306)
- Contains the related property. Must contain exactly one property (no value Help or unknown value Help is not permitted), which must have the same data type as the property on which the constraint is placed. The difference is calculated as the value for the property with the constraint minus the value for the property given in this parameter, so usually the constraint is placed on the “upper” property (e. g. date of death (P570)), and the parameter specifies the “lower” property (e. g. date of birth (P569)).
- minimum value (P2313)
- The lower boundary of the permitted range. The unit of the boundary value should match the unit of the two properties (e. g. year (Q577) for date of birth (P569) and date of death (P570)). no value Help can be used to specify a range with no lower boundary ( ). unknown value Help is not permitted.
- maximum value (P2312)
- The upper boundary of the permitted range. The unit of the boundary value should match the unit of the two properties (e. g. year (Q577) for date of birth (P569) and date of death (P570)). no value Help can be used to specify a range with no upper boundary ( ). unknown value Help is not permitted.
Example setting for date of birth (P569).
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.
Difference with “date of birth (P569)” within range [-1, 150]: the difference with property “date of birth (P569)” should be in the range from “-1” to “150”. (Help)Exceptions are possible as rare values may exist. Known exceptions: Zaro Aga (Q148028), Thomas Parr (Q657399), Shirali Muslimov (Q2349607), Mahmud Eyvazov (Q4529980), Kyle Reese (Q592358)
List of this constraint violations: Database reports/Constraint violations/P570#Diff within range, SPARQL (new)
Lists of properties which are set difference within range constraint.
- Category:Properties with difference within range constraints
- SPARQL query - click the execute button at the linked page to see the query result.