$smwg­Namespace

From semantic-mediawiki.org


Configuration parameter details:
Name $smwgNamespace
Description Sets the namespace of exported URIs
Default setting
Software Semantic MediaWiki
Since version
Until version still available
Configuration Installation · Namespace · RDF export
Keyword namespace · export · rdf · uri


$smwgNamespace is a configuration parameter that sets the namespace of exported URIs. The configuration parameter was introduced in Semantic MediaWiki 1.0Released on 31 December 2007 and compatible with MW 1.9.x - 1.12.x..

Default setting[edit]

The default setting is null. When not explicitly set, the exporter automatically derives the URI from Special:URIResolver.

Prior to Semantic MediaWiki 7.0.0Released on 4 June 2026 and compatible with MW 1.43.x - 1.46.x., this value was set automatically using the domain passed to the enableSemantics call.

To create pretty URIs, set this parameter to a custom value and configure your webserver accordingly.

Changing the default setting[edit]

To enforce a specific namespace add a line similar to this example to your "LocalSettings.php" file:

wfLoadExtension( 'SemanticMediaWiki' );
$smwgNamespace = 'https://example.org/id/';

See also[edit]