From Semantic Portal Wiki
Description
- description: Add a SMW annotation with (i)parse mode; (ii)length limit
- module: Help:SMW API
- version: 0.1
- status: unstable
- author: Li Ding
Usage
{{sbp.tag
|PROPERTY # must be the 1st parameter {{{1}}}
|VALUE # must be the 2nd parameter {{{2}}}
|mode = # the choice of parsing mode;
allowed values: 'text' - no SMW parsing, ignore NAMESPACE, print VALUE as String
'one' - SMW parsing, treat VALUE as one value.
'list' - SMW parsing, treat VALUE as a list of values;
default delimiter is ','
alternative delimiter is ';'
default value: 'one'.
|namespace # the namespace attached before each parsed item of VALUE
possible values: {'category', 'property'};
|length = # the max length limit of a value string;
allowed values: -1 for no length limit,
0 for do not show,
any positive number otherwise;
default value: '-1'.
}}
Examples
Example 1. Typical Use
Example 2. Special case when VALUE is empty
Template:Sbp.tag.mode
Example 3. Special treatment on delimiter when mode=list
- list items are delimited by either ';' or ','
- ';' has higher priority than ',' when they co-exist in one VALUE
- ',' is the default delimiter
Example 4. Regression Test
passing namesapce
Template:Sbp.tag.mode
Template:Sbp.tag.mode