Extension:Semantic Result Formats/array and hash formats

The result formats Array and Hash, both part of the Semantic Result Formats extension, are used to output query results in a way most suitable for further processing by MediaWiki templates or parser functions. They can either output the result as string with a variety of separators between different values, or store the result directly into an ArrayExtension Array or HashTables-extension Hash.

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

Define a Hash with name, Pagenames as associative keys and the value of each result page Name property as value:

Usage
The Array format is not only useful if ArrayExtension is installed, it also is a good alternative to Semantic-MediaWikis 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 and HashTable extensions or other way of processing the output, not for machine-unfriendly eye-candy like Semantic-MediaWikis proprietary list format. This means all kinds of links and generating of needless information is disabled by default, can be activated though.

The limit for array and hash query results is set to the maximum set in Semantic-MediaWikis  config variable by default.

Configuration
There are five configuration variables to configure the default separators. They can be adjusted via LocalSettings.php if required. Although they don't have the hash as part of their names, they apply for both, the array and hash formats.


 * $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: ' '

Example
These variables can be set to a normal string value or the 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:

Special:Semantic search issue
if any configuration variable is set to get a wiki page content as value, this will not work as expected on Special:Semantic search. 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 of course). This variable can be modified in LocalSettings 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.

Practical examples
To be added