Help:Array format

The result format array, part of the Semantic Result Formats extension, is used to format query results in a way most suitable for further processing by MediaWiki templates or parser functions. It is quite similar to the list format but allows more options for customization. It can either output the result as string with a variety of separators between different values, or store the result directly into an array.

Parameters
The Array format is not only useful if the Arrays extension extension is installed, it also is a good alternative to Semantic MediaWiki's default list format since it allows to specify a variety of separators and not just the separator between query output values per page (sep parameter of list format).

Default parameters are optimized for use with ArrayExtension extensions or other way of processing the output, not for machine-unfriendly eye-candy like Semantic MediaWiki's proprietary list format. This means all kinds of links and generating of needless information is disabled by default, but can be activated though.

 *  The limit for array query results is set to the maximum set in Semantic MediaWiki's  configuration variable by default.

Configuration
There are five configuration variables to configure the default separators. They can be adjusted via LocalSettings.php if required.


 * $srfgArraySep : Default value for the  parameter. Default: ' '
 * $srfgArrayPropSep : Default value for the  parameter. Default: ' '
 * $srfgArrayManySep : Default value for the  parameter. Default: ' '
 * $srfgArrayRecordSep : Default value for the  parameter. Default: ' '
 * $srfgArrayHeaderSep : Default value for the  parameter. Default: ' '

Examples
These variables can be set to a normal string value or they can contain an array, defining one page in the wiki. In case the later is chosen, the parsed content of this site will serve as default value. The value will only be parsed once per page rendering and shouldn't contain any very dynamic content. It is useful though to define a template which can then be used in templates processing the query result any further. Example for definition:

Issue with Special:Ask
In case any configuration variable is set to get a wiki page content as value, this will not work as expected on Special:Ask. This is because the parser is not fully running at the time the value is needed. In this case, if the query is not running in inline-mode, a fallback separator will be loaded from another configuration variable,. This is an array with the keys sep, propsep, manysep, recordsep and headersep which contain the equivalent default value from above (NOT the one set in LocalSettings.php of course). This variable can be modified in LocalSettings.php as well, though, there is no real benefit from doing so since these values are only going to be used on the semantic search spacial page anyway. One should just be aware of this to avoid confusion.

Examples
Define an Array with name, one array value per page containing the page title where the property Name was found

Practical examples
To be added