Con­figu­ration para­meter "$smwg­Namespace­Index"

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
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"Semantic MediaWiki (SMW) is a free, open-source extension to MediaWiki that lets you store and query data within the wiki's pages. Semantic MediaWiki is also a full-fledged framework, in conjunction with many spinoff extensions, that can turn a wiki into a powerful and flexible knowledge management system. All data created within SMW can easily be published via the Semantic Web, allowing other systems to use this data seamlessly.. 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 and 113) and extension "Page Forms"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 and 114.

Changing the default setting[edit]

To modify this configuration setting, 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 and 125.

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"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]