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

Configuration parameter details:
Name $smwgNamespacesWithSemanticLinks
Description Defines for which namespaces the semantic links and annotations are to be evaluated
Default setting See below
Software Semantic MediaWiki
Since version
Until version still available
Configuration Installation · Namespace
Keyword namespace

$smwgNamespacesWithSemanticLinks is a configuration parameter that is used to define for which namespaces the semantic links and annotations are to be evaluated. Usually this setting gets changed if the respective wiki contains custom namespaces, which should use semantic functionality. The configuration parameter was introduced in Semantic MediaWiki 0.7.

On pages within namespaces which are disabled with false with the default setting or for custom namespaces explicitly not activated by adding it to the parameter, annotations can be given but are silently ignored. This is useful since, e.g., talk pages usually do not have attributes and the like. Pages without annotations will also be ignored during full RDF export, unless they are referred to from another page.

Default setting[edit]

$smwgNamespacesWithSemanticLinks = array(
	NS_MAIN => true,
	NS_TALK => false,
	NS_USER => true,
	NS_USER_TALK => false,
	NS_PROJECT => true,
	NS_PROJECT_TALK => false,
	NS_IMAGE => true,
	NS_IMAGE_TALK => false,
	NS_MEDIAWIKI => false,
	NS_TEMPLATE => false,
	NS_HELP => true,
	NS_HELP_TALK => false,
	NS_CATEGORY => true,

The default setting was last changed with SMW 1.9.0 by removing the namespaces "Property", "Type" and "Concept" from the array.

Changing the default setting[edit]

To add a custom namespace, e.g. "Foo" insert

$smwgNamespacesWithSemanticLinks[NS_FOO] = true;

into your "LocalSettings.php" file after enabling semantics with

enableSemantics( '' );

where [NS_FOO] is the namespace constant that was defined for namespace "Foo".

If you insert a namespace defined by an extension the namespace constant set by the respective extension will have to be used, e.g.

$smwgNamespacesWithSemanticLinks[NS_PROPERTY] = true;

for namespace "Property" defined by Semantic MediaWiki.

In case you would like to add several namespaces insert them line by line e.g.

$smwgNamespacesWithSemanticLinks[NS_FOO] = true;
$smwgNamespacesWithSemanticLinks[NS_PROPERTY] = true;

If the behaviour for the namespaces covered by the default setting should be changed insert e.g.

$smwgNamespacesWithSemanticLinks[NS_USER] = false;

to disable semantic for the "User" namespace.

See also[edit]