$smwg­Check­For­Constraint­Errors

From semantic-mediawiki.org


Configuration parameter details:
Name $smwgCheckForConstraintErrors
Description Sets whether constraint violations are shown to the user via a page indicator
Default setting See below
Software Semantic MediaWiki
Since version
Until version still available
Configuration Miscellaneous
Keyword constraint · subobject · subject · violation


$smwgCheckForConstraintErrors is a configuration parameter that sets whether constraint violations resulting from annotations (property-value pair) on page and the subobjects attached to them will be shown to the user via an indicator on the respective page. The number of constraint violations shown in the page indicator is limited to 20. The configuration parameter was introduced in Semantic MediaWiki 3.1.0Released on 23 September 2019 and compatible with MW 1.31.0 - 1.33.x..1

The indication of constraint violations is a convenience function to provided users with a help to quickly identify which constraints violation are currently exists for a viewed subject. The result of the constraint error check is cached and should therefore not negatively impact performance when viewing a page repeatedly.

Default setting[edit]

$smwgCheckForConstraintErrors = SMW_CONSTRAINT_ERR_CHECK_ALL;

This means that the main subject, i.e. the page and all subobjects attached to it are being checked for constraint errors.

Available options[edit]

The option enabled by default are highlighted bold.
  • SMW_CONSTRAINT_ERR_CHECK_ALL – The main subject, i.e. the page and all subobjects attached to it are being checked and displayed via a page indicator
  • SMW_CONSTRAINT_ERR_CHECK_MAIN – The main subject, i.e. the page but not the subobjects attached to it are being checked and displayed via a page indicator
  • SMW_CONSTRAINT_ERR_CHECK_NONE – Disables the check and display via a page indicator

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:

Disabling all checks
$smwgCheckForConstraintErrors = SMW_CONSTRAINT_ERR_CHECK_NONE;
Disabling the checks for subobjects
$smwgCheckForConstraintErrors = SMW_CONSTRAINT_ERR_CHECK_MAIN;

See also[edit]

References

  1. ^  Semantic MediaWiki: GitHub pull request gh:smw:3989