| Status: | effective |
| Progress: | 100% |
| Version: | 7.2.0+ |
Help:Setting values using #set
#set)| Setting values | |
|---|---|
| Silently set semantic data in a wiki page | |
| Further Information | |
| Provided by: | Semantic MediaWiki |
| Minimum version: | 1.4.0 |
| Maximum version: | still supported |
| Function: | yes |
| Tag: | no |
| Name: | #set
|
| Table of Contents | |
The #set parser function allows you to annotate data, i.e., assign values to a property, silently. If you want to, you can avoid the [[Property::value]] syntax (in-text annotation) completely using a #set call. Starting with Semantic MediaWiki 1.9.0Released on 3 January 2014 and compatible with MW 1.19.0 - 1.22.x., the #set parser function also provides special parameters that provide many more features.
So on the page for Paris, there may be the following annotation:
{{#set:
Has population=2,229,621
|Located in country=France
}}
This parser function does not return anything unless the display parameter is used, but saves the very same properties as data as the following silent or hidden in-text annotation would have:
[[Has population::2,229,621| ]] [[Located in country::France| ]]
It is no longer necessary to do it this way; you can use a #set call as shown in the example above.
It is also possible to set multiple values to the same property:
{{#set:
Has postcode=75001
|Has postcode=75002
...
}}
Special parameters
- Working with the
#set"display" parameter allowing to show the assigned values right where the#setcall is made (Semantic MediaWiki 7.2.0Released on 17 July 2026 and compatible with MW 1.43.x - 1.46.x. and later) - Help:Setting values using
#setwith the "separator" parameter allowing to create multiple value assignments with#setat once - Working with the
#set"template" parameter allowing to manipulate the display characteristics of#setmade value assignments
See also
References
- ^ Semantic MediaWiki: Phabricator task mw:phab:T38309