$smwgSparqlQFeatures

From semantic-mediawiki.org


Configuration parameter details:
Name $smwgSparqlQFeatures
Description Sets the SPARQL query features that are expected to be supported by the repository of the identifier (graph) of the SPARQL database
Default setting
See below
(Other) available settings
SMW_SPARQL_QF_NONE

Setting to be used if your repository provider does not fully support SPARQL 1.1

SMW_SPARQL_QF_REDI

Enables the finding of redirects using inverse property paths

SMW_SPARQL_QF_SUBP

Enables resolving subproperties

SMW_SPARQL_QF_SUBC

Enables resolving subcategories

SMW_SPARQL_QF_COLLATION

Enables support of the sorting collation as maintained in configuration parameter $smwgEntityCollationSets which collation entities in Semantic MediaWiki should sort with

Software Semantic MediaWiki
Since version
Until version still available
Configuration Store settings
Keyword sparqlstore · store · rdf · sparql · query features · query performance


$smwgSparqlQFeatures is a configuration parameter that is used to define the SPARQL query features that are expected to be supported by the repository of the identifier (graph) of the SPARQL database. The configuration parameter was introduced in Semantic MediaWiki 2.3.0Released on 29 October 2015 and compatible with MW 1.19.0 - 1.25.x..1 Semantic MediaWiki 3.0.0Released on 11 October 2018 and compatible with MW 1.27.0 - 1.31.x. introduced the SMW_SPARQL_QF_COLLATION constant as configurable setting.2

Default setting[edit]

$smwgSparqlQFeatures = SMW_SPARQL_QF_REDI | SMW_SPARQL_QF_SUBP | SMW_SPARQL_QF_SUBC;

The default setting means that the SPARQL database supports finding redirects using inverse property paths as well as resolving subproperties and subcategories.

Available options[edit]

The options enabled by default are highlighted bold.
  • SMW_SPARQL_QF_NONE − Sets that the SPARQL database does not support any features as required by SPARQL 1.1 (e.g. Virtuoso 6.1 or 4Store Current: May 2015)
  • SMW_SPARQL_QF_REDI − Sets that the SPARQL database supports finding redirects using inverse property paths (can only be used for repositories with full SPARQL 1.1 support (e.g. Fuseki or Sesame Current: May 2015)
  • SMW_SPARQL_QF_SUBP − Sets that the SPARQL database supports resolving subproperties
  • SMW_SPARQL_QF_SUBC − Sets that the SPARQL database supports resolving resolve subcategories
  • SMW_SPARQL_QF_COLLATION − Sets that the SPARQL database supports the sorting collation as maintained in configuration parameter $smwgEntityCollationSets which collation entities in Semantic MediaWiki should sort with. It is not enabled by default as the uca-<langcode>-* collation generates a UTF-8 string that contains unrecognized UTF codepoints that may not be understood by the back-end hence the collator prevents and armors those unrecognized characters by replacing them with a ? to avoid a cURL communication failure. Of course this means that not all elements of the sort string can be transfered to the back-end and can therefore cause a sorting distortion for close matches as in case of for example "Ennis, Ennis Hill, Ennis Jones, Ennis-Hill, Ennis-London".

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:

Cater for repository providers that do not fully support SPARQL 1.1
$smwgSparqlQFeatures = SMW_SPARQL_QF_NONE;

This means that a repository provider may be used that does not fully support SPARQL 1.1.

Disable the finding of redirects using inverse property paths
$smwgSparqlQFeatures = SMW_SPARQL_QF_SUBP | SMW_SPARQL_QF_SUBC;

or alternatively remove the option from the existing definition of the configuration parameter like e.g.

$smwgSparqlQFeatures = ( $smwgSparqlQFeatures & ~SMW_SPARQL_QF_REDI );
NoteNote: Please use parentheses3 when combining different bit-operations to avoid a possible mismatch.
Enable the sorting collation as maintained configuration parameter $smwgEntityCollationSets which collation entities in Semantic MediaWiki should sort with
$smwgSparqlQFeatures = SMW_SPARQL_QF_REDI | SMW_SPARQL_QF_SUBP | SMW_SPARQL_QF_SUBC | SMW_SPARQL_QF_COLLATION;

or alternatively add the option to the existing definition of the configuration parameter like e.g.

$smwgSparqlQFeatures = $smwgSparqlQFeatures | SMW_SPARQL_QF_COLLATION;
Maintenance script "updateEntityCollation.php"Allows to do mass updates of database field "smw_sort" on the occasion that setting for the entity collation was changed has to be run after adding this option to the stetting of this configuration parameter.

See also[edit]

References

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