Last modified: 2012-11-21 10:33:04 UTC
This topic was previously discussed on the SMW mailing list in July/August 2012 (look for "[Semediawiki-user] Future plans for Semantic MediaWiki #subobject and Semantic Internal Objects") Currently, subobjects can handle multiple property values in the following two ways: {{#subobject: ... |property1=value1 |property1=value2 |property1=value3 }} and more recently, {{#subobject: ... |property1=value1|value2|value3 }} However, neither approach is very suitable for embedding value parameters in templates. Using a pipe as a delimiter conflicts with parser syntax. What is needed, therefore, is an alternative way of delimiting values on the condition that it not does by default restrict the scope of usable characters (as Markus, no doubt rightly, insists). As a possible solution, Markus considers "some syntax for enabling ;-based lists or we could have another parser function that does just this." Here are two semi-concrete ideas: 1. Yaron Koren proposes adding a suffix in roughly the same way as this is done with SIO. The difference is that semicolons rather than commas would be used, as commas can be quite common in pagenames and other values. {{#subobject: ... |property1#list=value 1; value 2; value 3; |property2=value1 }} In template {{#subobject: ... |property1#list={{{property1values|}}} |property2={{{property2value|}}} }} 2. For every property in a printout statement, the Array and Hash formats use "manysep" to delimit values. Maybe something like it could be implemented for #subobject (and #set) declarations in addition to #ask queries? For some context concerning inline queries, see also bug 37899 {{#subobject: ... |property1=value 1; value 2; value 3 |property2=value 1; value 2; value 3 |manysep=; }} (There might be valid arguments against using the name "manysep", but I hope you get the idea)
Change [1] has been applied for SMW 1.9+ (This change is not valid for SMW 1.8). Supported are: {{#subobject: |has test 1=Example 1;Example 2;Example 3;Example 4|+sep=; |has test 2=Single examples |has test 3=Example 1|Example 2|Example 3|Example 4 }} [1] https://gerrit.wikimedia.org/r/#/c/33193
Merged with 1.9 branch