Help:属性约束门户/单位
This is the documentation page for a particular constraint type. See Help:Property constraints portal for a general overview of property constraints. |
allowed units constraint (Q21514353) specifies that only a certain set of units may be used with a statement of the quantity data type.
例如,UTC timezone offset (P2907)的唯一有效单位是hour (Q25235)。
如果未指定constraint scope (P4680),則會在任何位置檢查此約束。
可能的操作
有幾種方法可以解決違反此約束的問題:
- It’s possible that the unit is not the correct one to use for the quantity, and a similar but different unit should be used instead. Check the list of permitted units for an applicable unit to use.
- It’s possible that the unit should not be specified at all (a dimensionless quantity), and that the unit should be removed.
- It’s possible that the unit is a rare, but legitimate exception to the constraint, and nothing should be done.
参数
此约束含一个强制参数:
- item of property constraint (P2305)
- Contains the permitted units. Must contain the allowed unit(s), which are either items or no value Help to allow dimensionless quantities. (unknown value Help is not permitted.)
示例
示例1
temperature (P2076)的单位必须是degree Celsius (Q25267)、kelvin (Q11579)或degree Fahrenheit (Q42289)之一。
property constraint |
| ||||||||||||||||
add value |
Example 2 - no value
Mohs scale of mineral hardness (Q41472) is number used to represent hardness of materials. For example, quartz is 7, and diamond is 10. As definition, Mohs' hardness (P1088) doesn't have unit. In such case, "no value" is used as follows. "no value" is added to statements by clicking on the icon beside the value field that looks like this .
property constraint |
| ||||||||||||
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.
List of violations of this constraint: Database reports/Constraint violations/P2076#Units
列表
Lists of properties which are set allowed units constraint.
- Category:Properties with units constraints
- SPARQL query - click the execute button at the linked page to see the query result.