Con­figu­ration para­meter "$smwgPropertyReservedNameList"

From semantic-mediawiki.org
Configuration parameter details:
Name $smwgPropertyReservedNameList
Description Sets which names are reserved from usage as property names
Default setting See below
Software Semantic MediaWiki
Since version
Until version still available
Configuration Miscellaneous
Keyword property · property naming

$smwgPropertyReservedNameList is a configuration parameter that sets which names are reserved from usage as property names. It was introduced in Semantic MediaWiki 3.0.0Released on an unknown date and compatible with MW 1.27.0 - 1.30.x..1

Listed names are reserved as they may interfere with MediaWiki, Semantic MediaWiki or another extension. This list is extendable and may also be used to customize use cases for an individual wiki. The creation of the property is not blocked by default (see also create protection) and a property with a reserved name can still be used. However a warning message will appear on the property page of a matchable name. The warning message that will be displayed is represented by message key "smw-property-name-reserved" in namespace "MediaWiki".

Default setting

$smwgPropertyReservedNameList => array(
	'Category',
	'smw-property-reserved-category'
);

This means that by default "Category" is reserved and should not be used as a property name.2 "smw-property-reserved-category" is the message key in namespace "MediaWiki" that holds the translatable name of the reserved name which is matched against the property name. For example if the content language is Japanese (ja) then Category as the canonical form is blocked but also カテゴリ since this is the reserved name in the corresponding language.

Changing the default setting

Removing the default setting "Category" is discouraged for the reasons stated at the top of the page.
The configuration parameter can contain simple names or identifiers as settings that start with "smw-property-reserved-". These link to a translatable representation of the name that matches a string in a content language. Thus the reserved names in all possible languages do not have to be added to this configuration parameter.

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

Make "Code" a reserved name too with the translatable name maintained at "MediaWiki:Smw-property-reserved-code"
$smwgPropertyReservedNameList = array_merge(
	$smwgPropertyReservedNameList, [
		'Code',
		'smw-property-reserved-code'
	]
);

or alternatively

$smwgPropertyReservedNameList => array(
	'Category',
	'smw-property-reserved-category',
	'Code',
	'smw-property-reserved-code'
);

See also


References

  1. ^  Semantic MediaWiki: GitHub pull request gh:smw:2840
  2. ^  Semantic MediaWiki: Sandbox example sb:smw:2840