$smwgDVFeatures

From semantic-mediawiki.org


Configuration parameter details:
Name $smwgDVFeatures
Description Sets the available features regarding property data values
Default setting See below
Software Semantic MediaWiki
Since version
Until version still available
Configuration Installation
Keyword output · display · datavalue


$smwgDVFeatures is a configuration parameter that sets the available features regarding property data values. The configuration parameter was introduced in Semantic MediaWiki 2.4.0Released on 9 July 2016 and compatible with MW 1.19.0 - 1.27.x..1

Starting with Semantic MediaWiki 7.0.0Released on 4 June 2026 and compatible with MW 1.43.x - 1.46.x. this parameter accepts an array of plain string keys instead of the SMW_DV_* constants. The constant form still works but is deprecated and will be removed in Semantic MediaWiki 8.0.0Released on an unknown date and compatible with unknown versions of MediaWiki..2

Default setting[edit]

$smwgDVFeatures = [ 'provider-redirect', 'monolingual-langcode', 'pattern-validation', 'wpv-display-title', 'time-calendar-model', 'preferred-label', 'provider-link-hint' ];

Available options[edit]

The options enabled by default are highlighted bold.
  • 'provider-redirect' (formerly SMW_DV_PROV_REDI) (PropertyValue) If a property is redirected to a different target (Foo -> Bar) then follow it by default in order to allow query results to be displayed equivalent for both queries without having to adjust (or change) query. This flag is mainly provided to restore backwards compatibility where behavior is not expected to be altered, nevertheless it is recommended that the setting is enabled to improve user friendliness in terms of query execution.
  • 'monolingual-langcode' (formerly SMW_DV_MLTV_LCODE) (MonolingualTextValue) is to require a language code in order for a DV to be completed otherwise a MLTV can operate without a language code.
NoteNote: If this options is missing, property links will stop working as tooltips, and become plain links to the property, instead.3
  • 'pattern-validation' (formerly SMW_DV_PVAP) (Allows pattern) to allow regular expression pattern matching when special property "Allows pattern"Pattern to match a permissible value is assigned to user-defined property
  • 'wpv-display-title' (formerly SMW_DV_WPV_DTITLE) (WikiPageValue) is to allow requesting a lookup for a display title and if present will be used as caption for the invoked subject
  • 'provider-display-title' (formerly SMW_DV_PROV_DTITLE) (PropertyValue) in combination with 'wpv-display-title', If enabled it will attempt to resolve a property label by matching it against a possible assigned special property "Display title of"Holds a specific denote title for an entity value. For example, property "Foo" has "Display title of" "hasFoolishFoo" where "hasFoolishFoo" is being resolved as "Foo" when creating annotations. Currently, this uses an uncached lookup and therefore is disabled by default to avoid a possible performance impact (which has not been established or analyzed).
  • 'unique-constraint' (formerly SMW_DV_PVUC) (Uniqueness constraint) to specify that a property can only assign a value that is unique in its literal representation (the state of uniqueness for a value is established by the fact that it is assigned before any other value of the same representation to a property).
  • 'time-calendar-model' (formerly SMW_DV_TIMEV_CM) (TimeValue) to indicate the CalendarModel if is not a CM_GREGORIAN
  • 'number-value-usespaces' (formerly SMW_DV_NUMV_USPACE) (Number/QuantityValue) to preserve spaces within unit labels4 (since Semantic MediaWiki 2.5.0Released on 14 March 2017 and compatible with MW 1.23.0 - 1.29.x.
  • 'preferred-label' (formerly SMW_DV_PPLB) to support the use of preferred property labels
  • 'provider-link-hint' (formerly SMW_DV_PROV_LHNT) (PropertyValue) to output a p hint marker on properties that use a preferred label
  • 'wpv-pipetrick' (formerly SMW_DV_WPV_PIPETRICK) (WikiPageValue) uses a full pipe trick when rendering its caption

Changing the default setting[edit]

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

Removing the special property "Display title of"Holds a specific denote title for an entity feature from the default setting
$smwgDVFeatures = [ 'provider-redirect', 'monolingual-langcode', 'pattern-validation', 'time-calendar-model', 'preferred-label', 'provider-link-hint' ];
Enable support for the special property "Has uniqueness constraint"Allows to restrict value annotation to be unique property trait
$smwgDVFeatures = [ 'provider-redirect', 'monolingual-langcode', 'pattern-validation', 'wpv-display-title', 'time-calendar-model', 'preferred-label', 'provider-link-hint', 'unique-constraint' ];
Removing all data value related features

To remove all data value related features set an empty array:

$smwgDVFeatures = [];

Legacy constant form (deprecated since 7.0.0)[edit]

The constant form below is deprecated since Semantic MediaWiki 7.0.0Released on 4 June 2026 and compatible with MW 1.43.x - 1.46.x. and will be removed in Semantic MediaWiki 8.0.0Released on an unknown date and compatible with unknown versions of MediaWiki.. Use the string-array form shown above instead. It is documented here for wikis still running the constant form.

The default expressed with constants:

$smwgDVFeatures = SMW_DV_PROV_REDI | SMW_DV_MLTV_LCODE | SMW_DV_PVAP | SMW_DV_WPV_DTITLE | SMW_DV_TIMEV_CM | SMW_DV_PPLB | SMW_DV_PROV_LHNT;

Features can be combined with bit-operations, e.g. removing the special property "Display title of"Holds a specific denote title for an entity feature and at the same time enabling the special property "Has uniqueness constraint"Allows to restrict value annotation to be unique trait:

$smwgDVFeatures = ( $smwgDVFeatures & ~SMW_DV_WPV_DTITLE ) | SMW_DV_PVUC;
NoteNote: Please use parentheses5 when combining different bit-operations to avoid a possible mismatch.

To remove all data value related features with the constant form, use SMW_DV_NONE:

$smwgDVFeatures = SMW_DV_NONE;

See also[edit]


References

  1. ^  Semantic MediaWiki: GitHub pull request gh:smw:1417
  2. ^  | | | | | | | | |  Semantic MediaWiki: GitHub pull request gh:smw:6793
  3. ^  Semantic MediaWiki: GitHub issue gh:smw:3562
  4. ^  |  Semantic MediaWiki: GitHub pull request gh:smw:1718
  5. ^  Bitwise Operators to use parentheses to ensure the desired precedence ...