Help:Configuration parameter "$smwgDVFeatures"

Jump to: navigation, search
edit with form (experimental)

Title $smwgDVFeatures
Description Sets the available features regarding property data values
Default setting See below
Software Semantic MediaWiki
First version supported 2.4.0
Last version supported still available
Configuration Installation
Keyword Output · Display · DataValue

$smwgDVFeatures is a configuration parameter that sets the available features regarding property data values. The setting was introduced in Semantic MediaWiki

Default setting


Available options

  • SMW_DV_NONE – Disables features to property data values
  • 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 behaviour is not expected to be altered, nevertheless it is recommended that the setting is enabled to improve user friendliness in terms of query execution.
  • 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
  • SMW_DV_PVAP (Allows pattern) to allow regular expression pattern matching when `Allows pattern` property is assigned to user-defined property
  • 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
  • SMW_DV_PROV_DTITLE (PropertyValue) in combination with SMW_DV_WPV_DTITLE, If enabled it will attempt to resolve a property label by matching it against a possible assigned property "Display title of" 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).
  • 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).
  • SMW_DV_TIMEV_CM (TimeValue) to indicate the CalendarModel if is not a CM_GREGORIAN
  • SMW_DV_NUMV_USPACE (Number/QuantityValue) to preserve spaces within unit labels
  • SMW_DV_PPLB to support the use of preferred property labels
  • SMW_DV_PROV_LHNT (PropertyValue) to output a p hint marker on properties that use a preferred label

Changing the default setting

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

Removing the special property "Display title of" (SMW_DV_WPV_DTITLE) feature from the default setting.
$smwgDVFeatures = $smwgDVFeatures & ~SMW_DV_WPV_DTITLE;
Enable support for special proerty "Has uniqueness constraint" (SMW_DV_PVUC) property trait.
$smwgDVFeatures = $smwgDVFeatures | SMW_DV_PVUC;
Removing the special property "Display title of" (SMW_DV_WPV_DTITLE) feature and at the same time enable support for special proerty "Has uniqueness constraint" (SMW_DV_PVUC) property trait.
$smwgDVFeatures = ( $smwgDVFeatures & ~SMW_DV_WPV_DTITLE ) | SMW_DV_PVUC;
NoteNote: Please use parentheses2 when combining different bit-operations to avoid a possible mismatch.

See also


  1. ^  Semantic MediaWiki: GitHub pull request gh:smw:1417
  2. ^  Bitwise Operators to use parentheses to ensure the desired precedence ...