Help:Property constraints portal/Range/szl
<languages/> Help:Property constraints portal/Header constraint type

Template:Q specifies that values for a property should be within a certain range or interval. This constraint is available for quantity or date properties.
For example, Template:P is always between 0 or 1 (within the interval ), and Template:P should not be before Template:ISOdate.
WikibaseQualityConstraints normalizes all quantities (applies unit conversion) before checking this constraint. For example, a mass of 500 g will be considered to lie within the range of , although 500 is not within the range , because the range endpoints are converted to ; on the other hand, a duration of 100 days will be considered to lie outside the range of (note the missing units) because it is interpreted as 8640000 seconds.
If no Template:P is specified, this constraint is checked everywhere.
Possible actions
There are several possible ways to address a violation of this constraint:
- It’s possible that the value in the statement is incorrect (e. g. due to confusing the thousands separator with the decimal separator) and should be fixed.
- It’s possible that the current item should not have the statement at all, and that the statement should be removed.
- It’s possible that the item is a rare, but legitimate exception to the constraint, and nothing should be done.
Parametry
On “quantity”-type properties, the following two parameters are mandatory:
- Template:P
- The lower boundary of the permitted range. Template:No value can be used to specify a range with no lower boundary (). Template:Unknown value is not permitted.
- Template:P
- The upper boundary of the permitted range. Template:No value can be used to specify a range with no upper boundary (). Template:Unknown value is not permitted.
On “point in time”-type properties, following two parameters are mandatory:
- Template:P
- The lower boundary of the permitted range. Template:No value can be used to specify a range with no lower boundary (). Template:Unknown value means the current date at the time the constraint is checked.
- Template:P
- The upper boundary of the permitted range. Template:No value can be used to specify a range with no upper boundary (). Template:Unknown value means the current date at the time the constraint is checked.
In both cases, the interval is always inclusive on both ends: the minimum and maximum value are both permitted values.
Examples
Example 1
Example setting for Template:P. Template:Statement+
Example 2
Example setting for Template:P. "15 January 2001" is the day when Wikipedia went online (Wikipedia Day). "Template:Unknownvalue" is added to statements by clicking on the icon beside the value field that looks like this
. "Template:Unknownvalue" is interpreted as "now".
Template:Statement+
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.
{{#invoke:Constraints|extractIndividualConstraintTemplate|id=P813|constraint_type=Q21510860}}
Lists
Lists of properties which are set range constraint.
Template:Property constraints Template:Translation categories