Help:Special property Allows value

Jump to: navigation, search
Allows value
Lists one permissible value for a property
Further Information
Provided by: Semantic MediaWiki
Added: 1.0
Removed: still in use
Alias: has no alias
Is optional: no
Label: not specified
In this wiki: Property:Allows value

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".


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

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

Ordered properties

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" by using a prefix, for example:

[[Allows value::a - Enhancement]]
[[Allows value::b - Trivial]]
[[Allows value::c - Minor]]

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

Error Handling

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, the special property "Has improper value for" can be used.

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

This documentation page applies to all SMW versions from 1.6.0 to the most current version.
Other versions: 1.0 – 1.5.6       Other languages: de

Help:Special property Allows value en 1.6.0