Help:Using a space to separate multiple values in set/subobject

From semantic-mediawiki.org
Jump to: navigation, search
Using a space to separate multiple values in setHelp:Using a space to separate multiple values in set/subobject

Semantic extension(s): Semantic MediaWiki

Further extension(s): -/-

Keyword(s): separator, delimiter,

  1. set

,

  1. subobject

,

  1. arraymap


Description:

How to separate multiple values in #set/#subobject using a space as delimiter

The problem

Some property values are best delimited using a space (or a new line). To separate URLs you can write something like

{{#arraymap:https://www.semantic-mediawiki.org https://www.mediawiki.org http://sandbox.semantic-mediawiki.org/wiki/| |@@|[[URLtypeproperty::@@|link]]}}

(The #arraymap parser comes with Semantic Forms)

So far so good, but how does it work for #set and #subobject notations? The following will not work since the space is interpreted as %20.

{{#subobject:
|URLtypeproperty=https://www.semantic-mediawiki.org https://www.mediawiki.org http://sandbox.semantic-mediawiki.org/wiki/|+sep=< nowiki> </nowiki>
}}

The solution

The solution is to use a combination of both:

{{#subobject:
|URLtypeproperty={{#arraymap:https://www.semantic-mediawiki.org https://www.mediawiki.org http://sandbox.semantic-mediawiki.org/wiki/| |@@|@@|SOMETHINGYOUWOULDNOTEXPECTTOSEEINAURL}}|+sep=SOMETHINGYOUWOULDNOTEXPECTTOSEEINAURL
}}

Source