$smwgLinksInValues

From Linux Web Expert


Template:Interlanguagelink: en
Configuration parameter details:
Name $smwgLinksInValues
Description Property "Has description" (as page type) with input value "Sets whether internal links in values for properties of datatype "Text" may be stored within property values" contains invalid characters or is incomplete and therefore can cause unexpected results during a query or annotation process.
Default setting false
Software Semantic MediaWiki
Since version
Until version still available
Configuration Installation
Keyword property · property value · displaying values · annotation · interface


__NOBREADCRUMBLINKS__

$smwgLinksInValues is a configuration parameter that sets whether internal links within property values for properties of datatype "Text"Holds text of arbitrary length such as e.g. [[Property::Some [[internal link]] in property value.]] may be resolved. The configuration parameter was introduced in Semantic MediaWiki 1.3.0Released on an unknown date unknown versions of MediaWiki. Starting with Semantic MediaWiki 2.5.0Released on an unknown date unknown versions of MediaWiki1 the settings to this configuration parameter and the underlying behaviour of the wiki was changed to eliminate the deficiency caused by the earlier PCRE approach as described below as legacy behaviour.

This configuration parameter's option SMW_LINV_OBFU was deprecated with Semantic MediaWiki 3.0.0Released on an unknown date unknown versions of MediaWiki in favour of option SMW_PARSER_LINV to configuration parameter $smwgParserFeaturesSets the behaviour of features related to text and annotation parsing streamlining the overall configuration of Semantic MediaWiki. The legacy option SMW_LINV_PCRE to this configuration parameter is no longer supported.2 Thus you are advised to migrate your settings in "LocalSettings.php" to the new configuration parameter since this one will be removed with the release of Semantic MediaWiki 3.1.0Released on an unknown date unknown versions of MediaWiki in 2019.

Default setting

$smwgLinksInValues = false;

This means that links in values for datatype "Text"Holds text of arbitrary length are not allowed.

Available options

This option moreover supports resolving of in-text annotations within a text element such as e.g. [[Has text::[[Lorem ipsum]] dolor sit amet, [[Has page::consectetur adipiscing elit]]]].
  • SMW_LINV_PCRE - Allows to avoid breakages for existing wikis by retaining the behaviour formerly set with "true" retained as a legacy setting.
    Setting "true" to this configuration parameter is still supported as a legacy setting and identical to setting this option.

Changing the default setting

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

Enable extended use cases, better performance and less issues
$smwgLinksInValues = SMW_LINV_OBFU;

This means that links in values for datatype "Text"Holds text of arbitrary length are allowed. This is the recommended setting for this configuration parameter.

Retain the deprecated PCRE approach as described below
$smwgLinksInValues = SMW_LINV_PCRE;

or

$smwgLinksInValues = true;

This means that links in values for datatype "Text"Holds text of arbitrary length are allowed however using the deprecated PCRC approach as described below as legacy behaviour. This is the recommended setting for this configuration parameter.

Legacy behaviour

The results of a query displayed on special page "Ask"Provides an interface that assists users with creating and executing semantic queries are not parsed further even if this setting is enabled. This means that results for properties of datatype "Text"Holds text of arbitrary length containing links will be displayed as-is, i.e. links like SMW Project within the data value will be displayed as [[Help:SMW Project|SMW Project]].

If enabled, this may lead to PHP crashes (!) when very long texts are used as values. This is due to limitations in earlier versions of the library PCRE that PHP uses for pattern matching. The provoked PHP crashes will prevent requests from being completed - usually clients will receive server errors like e.g. "invalid response" or be offered to download "index.php". In later versions this may cause the maintenance script "rebuildData.php" to fail.5 It might however be okay to enable this if such problems are not observed in your wiki.
Probably starting with Semantic MediaWiki 1.9.0Released on an unknown date unknown versions of MediaWiki it is possible to use the #set parser function to annotate links in values without the need to change this configuration parameter. See also the demo page on how to do this. - Use the SMW_LINV_OBFU option instead starting with Semantic MediaWiki 2.5.0Released on an unknown date unknown versions of MediaWiki.

See also

#scite could not render a citation text for reference "gh:smw:1963" because type "issue" was not assigned to a template.
#scite could not render a citation text for reference "gh:smw:2153" because type "pullrequest" was not assigned to a template.
#scite could not render a citation text for reference "gh:smw:2153:271164759" because type "issuecomment" was not assigned to a template.
#scite could not render a citation text for reference "gh:smw:2267" because type "pullrequest" was not assigned to a template.
#scite could not render a citation text for reference "gh:smw:2841" because type "pullrequest" was not assigned to a template.

References

  1. a b gh:smw:2153 
  2. ^ gh:smw:2841 
  3. ^ gh:smw:2153:271164759 
  4. ^ gh:smw:2267 
  5. ^ gh:smw:1963