Page MenuHomePhabricator

[SMW] Separator for multiple values per property in subobjects
Closed, ResolvedPublic

Description

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=value1value2value3

}}

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|}}}
}}
  1. 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)


Version: unspecified
Severity: normal

Details

Reference
bz39019

Related Objects

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 12:55 AM
bzimport set Reference to bz39019.
bzimport added a subscriber: Unknown Object (MLST).
Unknown Object (User) added a comment.Nov 13 2012, 4:25 PM

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 1Example 2Example 3Example 4

}}

[1] https://gerrit.wikimedia.org/r/#/c/33193

Unknown Object (User) added a comment.Nov 21 2012, 10:33 AM

Merged with 1.9 branch