$smwgQFeatures
From semantic-mediawiki.org
| Configuration parameter details: | |
| Name | $smwgQFeatures |
| Description | Defines which query features should be available by default. |
| Default setting | See below |
| Software | Semantic MediaWiki |
| Since version | |
| Until version | still available |
| Configuration | Query settings · inline queries |
| Keyword | inline queries · special ask · queries · query features · query performance |
$smwgQFeatures is a configuration parameter that is used to define which query features should be available by default to inline queries and special page "Ask". The parameter was introduced in Semantic MediaWiki 1.2.0.
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_*_QUERY 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.. The SMW_ANY_QUERY "all features" shortcut has been removed; list every permitted feature explicitly in the array.1
Default setting[edit]
$smwgQFeatures = [ 'property', 'category', 'concept', 'namespace', 'conjunction', 'disjunction' ];
The default setting allows all basic features.
Available options[edit]
'property'(formerlySMW_PROPERTY_QUERY) for conditions of the form[[Property::...]],'category'(formerlySMW_CATEGORY_QUERY) for conditions of the form[[Category:...]],'concept'(formerlySMW_CONCEPT_QUERY) for conditions of the form[[Concept:...]],'namespace'(formerlySMW_NAMESPACE_QUERY) for conditions of the form[[Namespace:+]],'conjunction'(formerlySMW_CONJUNCTION_QUERY) for combinations of multiple conditions in one query,'disjunction'(formerlySMW_DISJUNCTION_QUERY) for queries usingORor||.
Changing the default setting[edit]
The available features are listed as strings in an array. Examples:
- Allow only category intersections
$smwgQFeatures = [ 'category', 'conjunction' ];
- Allow only concept queries (possibly cached)
$smwgQFeatures = [ 'concept' ];
- Allow anything but disjunctions
$smwgQFeatures = [ 'property', 'category', 'concept', 'namespace', 'conjunction' ];
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
SMW_ANY_QUERY shortcut has been removed and no longer works.
The features were combined in a list separated by a pipe "|", e.g. the default:
$smwgQFeatures = SMW_PROPERTY_QUERY | SMW_CATEGORY_QUERY | SMW_CONCEPT_QUERY | SMW_NAMESPACE_QUERY | SMW_CONJUNCTION_QUERY | SMW_DISJUNCTION_QUERY;
References
- ^ | | | | | | | | | Semantic MediaWiki: GitHub pull request gh:smw:6793