Help:Setting values using #set

Help:Setting values using #setWorking with the #set "separator" parameter
Setting values
Silently set semantic data in a wiki page
Further Information
Provided by: Semantic MediaWiki
Minimum version: 2.3.0
Maximum version: still supported
Function: yes
Tag: no
Name: #set
Table of Contents

The parser function #set allows the author to annotate data, i.e. assign values to a property. 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.0 onwards the #set parser function also provides special parameters that provides many more features.

So on the page for Paris, there may be the following annotation:

 Has population=2,229,621
 |Located in country=France

This parser function actually does not return anything, 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 needed doing it like this, you can just use a #set call as shown in the example above.

It is also possible to set multiple values to the same property:

 Has postcode=75001
 |Has postcode=75002

NoteNote:  Starting with Semantic MediaWiki 1.9.01 you may use the separator parameter to assign multiple values to a property. See the respective help page for further information.

Special parameters

See also

This documentation page applies to all SMW versions from 1.4.0 to the most current version.
      Other languages: dezh-hans

Help:Setting values using #set en 1.4.0