Special property "Allows value list"

From Linux Web Expert

Revision as of 04:57, 17 December 2018 by >Kghbln (→‎Usage: chg)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Allows value list
Adds a reference to a list of permissible values for a property
Further Information
Provided by: extension "Semantic MediaWiki "No description was provided.
Added: 2.5.0
Removed: still in use
Alias: has no alias
Optional: no
Visible: yes
Annotable: yes
Declarative: yes
Key: _PVALI
Setting: not specified
Focus: property restriction
In this wiki: Property:Allows value list
Table of Contents

Template:Interlanguagelink: en The Allows value list property is a special property in Semantic MediaWiki with a built-in meaning: it assigns a reference which is used to define a page which allows to map a list of permissible values to the referencing property. It was introduced with Semantic MediaWiki 2.5.0Released on an unknown date unknown versions of MediaWiki.1

The referenced page is located like a system message in the "MediaWiki" namespace and consists of the string "Smw_allows_list_" and the stored reference as a suffix to it, e.g. "MediaWiki:Smw_allows_list_..." with "..." being replaced by the reference added to this special property.2

Starting with Semantic MediaWiki 3.0.0Released on an unknown date unknown versions of MediaWiki it is possible to add values lists in JSON format to improve handling of lengthy and challenging to edit via wikitext lists.3 The value list is using a simple key, value assignment with the key (e.g. "CC BY 2.5") being used as constraint value with the assigned value argument is there only to described the key and has for the validation no specific relevance.4

Usage

Two steps have to be taken to use this special property when choosing the wikiktext or json approach:

Wikitext

  1. Add [[Allows value list::...]] to a property page for defining a page reference, e.g. [[Allows value list::licenses]] will define page "MediaWiki:Smw_allows_list_licenses".
  2. Add permissible values as listed items starting either with "*" or "**" to the "MediaWiki:Smw_allows_list_..." page, e.g.
* CC BY 2.5
* CC BY-SA 2.5
* CC BY-ND 2.5
* CC BY-NC 2.5
* CC BY-NC-SA 2.5
* CC BY-ND-SA 2.5

JSON

  1. Add [[Allows value list::...]] to a property page for defining a page reference, e.g. [[Allows value list::licenses.json]] will define page "MediaWiki:Smw_allows_list_licenses.json".
  2. Add permissible values as listed items in JSON-format to the "MediaWiki:Smw_allows_list_..." page, e.g.
{
    "CC BY 2.5": "Creative Commons Attribution 2.5",
    "CC BY-SA 2.5": "Creative Commons Attribution-ShareAlike 2.5",
    "CC BY-ND 2.5": "Creative Commons Attribution-NoDerivs 2.5",
    "CC BY-NC 2.5": "Creative Commons Attribution-NonCommercial 2.5",
    "CC BY-NC-SA 2.5": "Creative Commons Attribution-NonCommercial-ShareAlike 2.5",
    "CC BY-ND-SA 2.5": "Creative Commons Attribution-NonCommercial-NoDerivs 2.5"
}

Note

See also

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

References

  1. ^ gh:smw:2295 
  2. ^ sb:smw:2295 
  3. ^ gh:smw:3289 
  4. ^ sb:smw:3289