$smwgEntityCollation

From semantic-mediawiki.org


Configuration parameter details:
Name $smwgEntityCollation
Description Sets which collation entities in Semantic MediaWiki should sort with
Default setting
identity
Software Semantic MediaWiki
Since version
Until version still available
Configuration Installation
Keyword collation · sorting


$smwgEntityCollation is a configuration parameter that sets the collation entities with which Semantic MediaWiki should sort. The configuration parameter was introduced in Semantic MediaWiki 3.0.0Released on 11 October 2018 and compatible with MW 1.27.0 - 1.31.x..1

The setting to this configuration parameter is "global" and applies to any entity that is maintained for a wiki. In being global means that it cannot be selective (use one collation for one query and use another collation for a different query) because the field ("smw_sort") contains a computed representation of the sort value.

Default setting[edit]

$smwgEntityCollation = 'identity';

This means that by default it uses the collation defined by configuration parameter $wgCategoryCollation (MediaWiki.org) for sorting and will produce the same sorting results as without the presence of this configuration parameter, i.e. releases prior to Semantic MediaWiki 3.0.0Released on 11 October 2018 and compatible with MW 1.27.0 - 1.31.x..

Available options[edit]

All collation options as provided by configuration parameter $wgCategoryCollation (MediaWiki.org) are supported:

  • uppercase − make everything uppercase, then sort by binary value of string when stored as UTF-8. Essentially case-insensitive sort by code point
  • numeric − same as uppercase, but with numeric sorting (since MediaWiki 1.28.0)
  • identity − sort by binary value of string when stored as UTF-8 without converting to uppercase. Essentially sort by code point (since MediaWiki 1.18.0)
  • uca-default − Unicode collation algorithm. This is a complex and much more multilingual-friendly category collation (since MediaWiki 1.17.0)
  • uca-default-u-kn − same as uca-default with numeric sorting (since MediaWiki 1.28.0)
  • uca-<langcode> − same as uca-default with language-specific adjustments (since MediaWiki 1.21.0)
  • uca-<langcode>-u-kn − same as uca-<langcode> with numeric sorting. (since MediaWiki 1.28.0)

See the list of available language codes (<langcode>) on MediaWiki.org for further information.

Changing the default setting[edit]

→ The setting of this configuration parameter should correspond to the setting of configuration parameter $wgCategoryCollation (MediaWiki.org) also in regards to selected argument values, yet it is kept separate to have a better control over changes in regards to the collation, sorting, and display of values.

Maintenance script "updateEntityCollation.php"Allows to do mass updates of database field "smw_sort" on the occasion that setting for the entity collation was changed has to be run after changing the stetting of this configuration parameter.

To modify the setting to this configuration parameter, add one of the following lines to your "LocalSettings.php" file after the enableSemantics() call:

Switch to Standard German of Germany with numeric sorting as sorting collation
$smwgEntityCollation = 'uca-de-u-kn';

This means that Semantic MediaWiki itself will now use Standard German of Germany with numeric sorting as sorting collation.

See also[edit]

References

  1. ^  Semantic MediaWiki: GitHub pull request gh:smw:2429