特殊属性“Allows value”

From Linux Web Expert

Allows value
Lists one permissible value for a property
更多信息
提供者: extension "Semantic MediaWiki "No description was provided.
添加版本: 1.0
移除版本: 仍在使用
别名: 没有别名
可选: no
可见: yes
可注释: yes
声明性: yes
键: _PVAL
设置: 未指定
聚焦: property restriction
此wiki内: Property:Allows value
目录

Template:Interlanguagelink: en The Allows value property is a special property in Semantic MediaWiki with a built-in meaning: it lists one permissible value for a property.

You can use this special property with a property of any datatype to limit its possible values. It is similar in its functionality to special property "Allows pattern"Pattern to match a permissible value.

When [[Foo::bar]] is used to set a property to a value that is not allowed, the property will not be set, and a warning sign will be shown. When using {{#set: Foo=bar }} to set the property, the error will be silently ignored. To find all pages that use a value that is not allowed, special property "Has improper value for"Alerts in case the assigned value to a property is invalid can be used.

See the property page "Allows value" to see which pages use this special property on this wiki.

Simple

For example, the page for a "Problem severity" property might contain:

[[Allows value::Trivial]]
[[Allows value::Minor]]
[[Allows value::Normal]]
[[Allows value::Major]]
[[Allows value::Critical]]

Ordered

Enumerating several allowed values does not put the possible values of a property in that order. Properties will always sort in the natural order provided by the datatype assigned to them. You can ensure that alphabetical sort order is appropriate for properties of e.g. datatype "Text"Holds text of arbitrary length by using a prefix, for example:

[[Allows value::a - Trivial]]
[[Allows value::b - Minor]]
[[Allows value::c - Normal]]
[[Allows value::d - Major]]
[[Allows value::e - Critical]]
...

Thus you can query for greater-than-or-equal or less-than-or-equal values, for example [[property name::<c-Minor]]

Bounded intervals and ranges

Starting with Semantic MediaWiki 3.0.0Released on an unknown date unknown versions of MediaWiki bounded intervals can be specified for values to properties of datatype "Number"Holds integer and decimal numbers, with an optional exponent and datatype "Quantity"Holds values that describe quantities, containing both a number and a unit.1

A range can be defined using > and <:

[[Allows value::>100]]
or in combination
[[Allows value::>100]] [[Allows value::<200]]

An interval can be defined using the bounded range ... indicator:

[[Allows value::1...20]] [[Allows value::100...200]]
Note that [[Allows value::1...20]] is equivalent to [[Allows value::>0]] [[Allows value::<21]]. Using a range with > and < notation more than once per property specification is not supported. Therefore the ... notation should be used to create numeric intervals.

另见


#scite could not render a citation text for reference "gh:smw:3292" because type "pullrequest" was not assigned to a template.

References

  1. ^ gh:smw:3292