$smwgQuerySources

From semantic-mediawiki.org


Configuration parameter details:
Name $smwgQuerySources
Description Sets a list of sources, i.e. query back-ends that can return query results
Default setting
Software Semantic MediaWiki
Since version
Until version still available
Configuration Query settings
Keyword query routing · query settings · remote query · remote request · remote source
Referenced by SMWQueryProcessor


$smwgQuerySources is a configuration parameter that sets a list of sources, i.e. query back-ends that can return query results. The configuration parameter was introduced in Semantic MediaWiki 1.8.0Released on 2 December 2012 and compatible with MW 1.17.0 - 1.22.x
(except 1.22.1).
.

It can be set to an array of multiple available sources for answering queries which can be redefined in the settings to register new sources (usually an extension will do so on installation). Unknown source will be rerouted to the local wiki. Query routing allows extensions to provide alternative stores as data sources.

For best results the website configured needs run Semantic MediaWiki however it is also possible to configure a website not using Semantic MediaWiki but providing results in a compatible format.1

The basic installation of Semantic MediaWiki ships with no additional source besides the local source, which in turn cannot be disabled or set explicitly.

Default setting[edit]

$smwgQuerySources = '';

This means that no other sources are available for inline queries.

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:

Add the wiki at <example.org> as remote queryable wiki
$smwgQuerySources = [
	'exampleorg' => [
		'\SMW\Query\RemoteRequest',
		'url' => 'https://example.org/w/index.php',
		'cache' => 3600
	]
];

This means that <example.org> will be using Semantic MediaWiki's "RemoteRequest" feature.

Add the wikis at <example.org> and <example.net> as remote queryable wikis
$smwgQuerySources = [
	'exampleorg' => [
		'\SMW\Query\RemoteRequest',
		'url' => 'https://example.org/w/index.php',
		'cache' => 3600
	],
	'examplenet' => [
		'\SMW\Query\RemoteRequest',
		'url' => 'https://example.net/w/index.php',
		'cache' => 3600
	]
];

This means that <example.org> and <example.net> will be using Semantic MediaWiki's "RemoteRequest" feature.

Add the wikis at <example.org>, example.net> and <example.com> as remote queryable wikis with the latter catering for extension "Semantic External Query Lookup"Allows to seamlessly integrate query results from an external query source to a local repository or wiki
$smwgQuerySources = [
	'exampleorg' => [
		'\SMW\Query\RemoteRequest',
		'url' => 'https://example.org/w/index.php',
		'cache' => 3600
	],
	'examplenet' => [
		'\SMW\Query\RemoteRequest',
		'url' => 'https://example.net/w/index.php',
		'cache' => 3600
	],
	'examplecom' => [
		'SMWExternalAskQueryLookup'
		]
];

This means that <example.org> and <example.net> will be using Semantic MediaWiki's "RemoteRequest" feature while <example.com> will be using the query feature provided by extension "Semantic External Query Lookup"Allows to seamlessly integrate query results from an external query source to a local repository or wiki which in turn may require further configuration. See this extension's documentation for further information.

See the help page on making remote requests for further information.

See also[edit]

References

  1. ^  Semantic MediaWiki: GitHub issue comment gh:smw:3167:451687962