$smwg­Namespace­Index

From semantic-mediawiki.org


Configuration parameter details:
Name $smwgNamespaceIndex
Description Sets the index of the first namespace to be used by Semantic MediaWiki
NoteNote: Avoid changing the setting of this configuration parameter if you can.
Default setting
100
Software Semantic MediaWiki
Since version
Until version still available
Configuration Installation · Namespace
Keyword namespace


$smwgNamespaceIndex is a configuration parameter that is used to set the first namespace index to be used by Semantic MediaWiki. The configuration parameter was introduced in Semantic MediaWiki 0.7Released on 28 April 2007 and compatible with MW 1.8.x - 1.10.x..

Only change the setting to this configuration parameter on initial installation of extension "Semantic MediaWiki"Allows to store and query data annotated to pages. In general you should avoid changing the setting of this configuration parameter if you can.
This configuration parameter must be used if you already have custom namespaces on your wiki, which have namespace indices colliding with the indices 102 to 111 used by Semantic MediaWiki (102, 103, 108, 109, 112, 113, 114 and 115) and extension "Page Forms"Allows to create and use forms for adding and editing pages with and without semantic data (106, 107) and other extensions.

Default setting[edit]

$smwgNamespaceIndex = 100;

This index number is set implicitly and means that the allocation of namespace indices used starts at 100 with Semantic MediaWiki using the namespace indices 102, 103, 108, 109, 112, 113, 114 and 115.

Changing the default setting[edit]

To modify the setting to this configuration parameter, add the following line to your "LocalSettings.php" file before the enableSemantics() call:

Make namespace numbering start at 112
$smwgNamespaceIndex = 112;

This means that Semantic MediaWiki will use the namespace indices 114, 115, 120, 121, 124, 125, 126 and 127.

The index number that replaces the default setting must be the smallest even namespace number that is not in use yet. However, it must be an even number and must not be smaller than 100 as well as equal to 102, 104, 106, 108 or 110. If you manually set the namespace index to e.g. 112 the actual index usage by Semantic MediaWiki will start with namespace index 114, i.e. the index will always be up by two in comparison to the setting. This behaviour used to avoid a namespace collision with a now omitted namespace called "Relation" which was supported from version 0.2 to 1.4.3 (legacy support from version 1.0 to 1.4.3) and used index 100.
Remember that the namespace indices for extension "Page Forms"Allows to create and use forms for adding and editing pages with and without semantic data will not change but stay at 106 and 107 if you change the setting of this configuration parameter. Apart from the default setting of 100 the lowest number for setting this configuration parameter should be 112 to avoid namespace conflicts with other extensions!

See also[edit]