Help talk:Array format


Is the template {{#smwdoc:array}} intended to be commented out[edit]

Is the template {{#smwdoc:array}} intended to be commented out in the section Parameters? Thanks. --Linforest 05:51, 13 March 2012 (CET)

At the time this help page was written, #smwdoc was not yet available for this result format. It works in the meantime, but so far #smwdoc has some shortcomings which I believe need to be adressed first when it comes to this format: See here for some improvements what need to be done. Cheers --[[kgh]] 16:04, 13 March 2012 (CET)
Thanks, kgh. Cheers --Linforest 17:51, 13 March 2012 (CET)

sep parameter working all right?[edit]

Hi, it seems that the 'sep' parameter is not doing anything. Could that indeed be the case?

--Ad Strack van Schijndel 13:26, 8 May 2012 (CEST)

... in a way most suitable for further processing by MediaWiki templates or parser functions[edit]

If I understand this correctly, you can use a template to post-process the query. For instance, if property values contain commas, you can use the array format to separate the results with symbols other than commas (e.g. using semi-colons) and the template format to process the results. For instance:

{{#ask: ....
|template= <sometemplate>

Yet there is nothing in the documentation about templates and I haven't succeeded to make it work either. If something else is meant by the lede, then please rephrase. Cavila 11:26, 18 May 2012 (CEST)

I just found out that the array format, even if it works, is not actually necessary for the function I just outlined. In fact, the process that once involved delimiting results and using arraymap in a template to define a new separator appears to have changed in ways I don't yet grasp. Cavila 12:10, 18 May 2012 (CEST)
This has nothing to do with the template parameter. The sentence just says that the format is very handy for having a query result in a format suitable for templates. Templates would just have to deal with arrays rather than doing a lot of string magic. --Daniel A. R. Werner (talk) 20:30, 17 October 2012 (CEST)


Thread titleRepliesLast modified
Uniqueness of Query Results104:11, 20 October 2012

Uniqueness of Query Results

Playing with the Array SRF I found that if a query result returns a list of values from a page that contains a multi-valued property, then the entire string is returned as a single value instead of a list of values that get merged into the named array.

To overcome this I return query results as a list and put the query inside the array definition, as the list of array values.

You can see an example of the difference on stratchpad.Referata, here.

15:56, 20 August 2012

I am not quite sure I understand what you mean. If there are multi-valued property results in the array, they have to share one array element, yes. But within that element, they are separated by the manysep. So if you set manysep=,, print the result array into a new array definition which uses "," as separator + unique option, then you should get your desired array. Anyhow, please take a look at again and tell me wether that solution is sufficent now :) I use <SEP> as separator there because it will allow you to have "," within the property values.

23:07, 19 October 2012