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

<translate> 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 <tvar|1></>), and Template:P should not be before <tvar|2>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 <tvar|kg></>, although 500 is not within the range <tvar|noKg></>, because the range endpoints are converted to <tvar|g></>; on the other hand, a duration of 100 days will be considered to lie outside the range of <tvar|unitless></> (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:</translate>
- <translate> 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.</translate>
- <translate> It’s possible that the current item should not have the statement at all, and that the statement should be removed.</translate>
- <translate> It’s possible that the item is a rare, but legitimate exception to the constraint, and nothing should be done.</translate>
<translate>
Parameters
On “quantity”-type properties, the following two parameters are mandatory:</translate>
- Template:P
- <translate> The lower boundary of the permitted range. Template:No value can be used to specify a range with no lower boundary (<tvar|3></>). Template:Unknown value is not permitted.</translate>
- Template:P
- <translate> The upper boundary of the permitted range. Template:No value can be used to specify a range with no upper boundary (<tvar|4></>). Template:Unknown value is not permitted.</translate>
<translate> On “point in time”-type properties, following two parameters are mandatory:</translate>
- Template:P
- <translate> The lower boundary of the permitted range. Template:No value can be used to specify a range with no lower boundary (<tvar|5></>). Template:Unknown value means the current date at the time the constraint is checked.</translate>
- Template:P
- <translate> The upper boundary of the permitted range. Template:No value can be used to specify a range with no upper boundary (<tvar|6></>). Template:Unknown value means the current date at the time the constraint is checked.</translate>
<translate> In both cases, the interval is always inclusive on both ends: the minimum and maximum value are both permitted values.</translate>
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