$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

Default setting[edit]

$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;

Available options[edit]

The options enabled by default are highlighted bold.
  • 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 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.
  • 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.2
  • 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
  • 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 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).
  • 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 labels3 (since Semantic MediaWiki 2.5.0Released on 14 March 2017 and compatible with MW 1.23.0 - 1.29.x.
  • 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[edit]

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

Removing the special property "Display title of"Holds a specific denote title for an entity feature from the default setting
$smwgDVFeatures = ( $smwgDVFeatures & ~SMW_DV_WPV_DTITLE );
NoteNote: Please use parentheses4 when combining different bit-operations to avoid a possible mismatch.
Enable support for the special property "Has uniqueness constraint"Allows to restrict value annotation to be unique property trait
$smwgDVFeatures = $smwgDVFeatures | SMW_DV_PVUC;
Removing the special property "Display title of"Holds a specific denote title for an entity feature and at the same time enable support for the special property "Has uniqueness constraint"Allows to restrict value annotation to be unique property trait
$smwgDVFeatures = ( $smwgDVFeatures & ~SMW_DV_WPV_DTITLE ) | SMW_DV_PVUC;
NoteNote: Please use parentheses4 when combining different bit-operations to avoid a possible mismatch.
Removing all data value related features

To remove all data value related features just replace all constants with the one as shown below:

$smwgDVFeatures = SMW_DV_NONE;

See also[edit]


References

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