Function "enableSemantics"

From semantic-mediawiki.org

enableSemantics is a convenience function to be added to the "LocalSettings.php" file of a wiki configuration to ensure that:

It is strongly recommended to not change the setting of this function after the initial setup of the wiki, not even if you switch from http to https, since the URI from configuration parameter $smwgNamespaceSets the namespace of exported URIs is used as an identifier that should not change. A change would turn the respective URI into a different entity which in fact it is not.12

Example

If changes to the configuration parameter $smwgNamespaceIndexSets the index of the first namespace to be used by Semantic MediaWiki are necessary, please follow the instructions in connection with enableSemantics.3

  • The first parameter represents the URI-namespace
  • The second parameter indicates whether the URI namespace is completed or not
enableSemantics( 'https://example.org/id/', true );

Alternatively a setting like the following is possible:

enableSemantics( 'example.org/id/' );

See also