$smwg­Property­Invalid­Character­List

From semantic-mediawiki.org


Configuration parameter details:
Name $smwgPropertyInvalidCharacterList
Description Sets a list of invalid characters which are not allowed to be used for property naming
Default setting See below
Software Semantic MediaWiki
Since version
Until version still available
Configuration Installation
Keyword property · administration · gardening · setup


$smwgPropertyInvalidCharacterList is a configuration parameter that sets a list of invalid characters which are not allowed to be used for property naming. The configuration parameter was introduced in Semantic MediaWiki 2.5.0Released on 14 March 2017 and compatible with MW 1.23.0 - 1.29.x.1, extended in Semantic MediaWiki 3.0.0Released on 11 October 2018 and compatible with MW 1.27.0 - 1.31.x.23 and further extended in Semantic MediaWiki 3.1.0Released on 23 September 2019 and compatible with MW 1.31.0 - 1.33.x.4.

You will still be able to create properties containing the characters specified with this configuration parameter, however you will no longer be able to add an annotation using the respective property. A concise error message informing about this will be shown.5

Default setting[edit]

$smwgPropertyInvalidCharacterList = [ '[', ']' , '|' , '<' , '>', '{', '}', '+', '–', '%', '\r', '\n', '?', '*', '!' ];

This means that the specified characters are not allowed for naming properties.

The characters '.' and '#' are always checked and disallowed despite the setting for this configuration parameter.6

Changing the default setting[edit]

To modify the setting to this configuration parameter, add one of the following lines to your "LocalSettings.php" file after the enableSemantics() call:

Extend the list of disallowed characters
$smwgPropertyInvalidCharacterList = [ '[', ']' , '|' , '<' , '>', '{', '}', '+', '%', '\r', '\n', '?', '*', '!', '$', '€', '¥', '£', '@' ];

or

$smwgPropertyInvalidCharacterList = array_merge(
        $smwgPropertyInvalidCharacterList, [
                '$', '€', '¥', '£', '@'
        ]
);
Reduce the list of disallowed characters
$smwgPropertyInvalidCharacterList = [ '[', ']' , '|' , '<' , '>', '{', '}' ];
Allow all characters
$smwgPropertyInvalidCharacterList = [ ];
This is a strongly discouraged setting. Moreover the characters '.' and '#' are always checked and disallowed.

See also[edit]




References

  1. ^  Semantic MediaWiki: GitHub pull request gh:smw:2282
  2. ^  Semantic MediaWiki: GitHub pull request gh:smw:2861
  3. ^  Semantic MediaWiki: GitHub pull request gh:smw:3478
  4. ^  Semantic MediaWiki: GitHub pull request gh:smw:3751
  5. ^  Semantic MediaWiki: GitHub issue comment gh:smw:3478:423980159
  6. ^  Semantic MediaWiki: GitHub issue comment gh:smw:2282:282486798