# Help:Property constraints portal/Range

Other languages:
Deutsch • ‎English • ‎Esperanto • ‎français • ‎polski • ‎русский • ‎српски / srpski • ‎العربية • ‎日本語

range constraint (Q21510860) 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, flattening (P1102) is always between 0 or 1 (within the interval ${\displaystyle [0,1]}$), and UTC date of spacecraft launch (P619) should not be before .

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 ${\displaystyle [0~\mathrm {kg} ,1~\mathrm {kg} ]}$, although 500 is not within the range ${\displaystyle [0,1]}$, because the range endpoints are converted to ${\displaystyle [0~\mathrm {g} ,1000~\mathrm {g} ]}$; on the other hand, a duration of 100 days will be considered to lie outside the range of ${\displaystyle [0,5000]}$ (note the missing units) because it is interpreted as 8640000 seconds.

If no constraint scope (P4680) 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.

## Parameters

On “quantity”-type properties, the following two parameters are mandatory:

minimum value (P2313)
The lower boundary of the permitted range. no value Help can be used to specify a range with no lower boundary (${\displaystyle (-\infty ,n]}$ ). unknown value Help is not permitted.
maximum value (P2312)
The upper boundary of the permitted range. no value Help can be used to specify a range with no upper boundary (${\displaystyle [n,+\infty )}$ ). unknown value Help is not permitted.

On “point in time”-type properties, following two parameters are mandatory:

minimum date (property constraint) (P2310)
The lower boundary of the permitted range. no value Help can be used to specify a range with no lower boundary (${\displaystyle (-\infty ,n]}$ ). unknown value Help means the current date at the time the constraint is checked.
maximum date (property constraint) (P2311)
The upper boundary of the permitted range. no value Help can be used to specify a range with no upper boundary (${\displaystyle [n,+\infty )}$ ). unknown value Help 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 atomic number (P1086).

property constraint
range constraint
 minimum value 0
 maximum value 155
0 references

### Example 2

Example setting for retrieved (P813). "15 January 2001" is the day when Wikipedia went online (Wikipedia Day). "unknown value" is added to statements by clicking on the icon beside the value field that looks like this  . "unknown value" is interpreted as "now".

property constraint
range constraint
 minimum date (property constraint) 15 January 2001
 maximum date (property constraint) unknown value
0 references