« My first external query » : différence entre les versions

De Semantic MediaWiki - Sandbox

(chg)
(add)
 
(5 versions intermédiaires par le même utilisateur non affichées)
Ligne 2 : Ligne 2 :
<syntaxhighlight lang="php">
<syntaxhighlight lang="php">
$smwgQuerySources = [
$smwgQuerySources = [
'smworg' => 'SMWExternalQueryLookup',
'semantic-mw' => [
'SMWExternalAskQueryLookup'
]
];
];
$seqlgExternalRepositoryEndpoints = [
$seqlgExternalRepositoryEndpoints = [
'smworg' => [
'semantic-mw' => [
'https://www.semantic-mediawiki.org/w/index.php/$1',
'https://www.semantic-mediawiki.org/w/index.php/$1',
'https://www.semantic-mediawiki.org/w/api.php',
'https://www.semantic-mediawiki.org/w/api.php',
Ligne 21 : Ligne 23 :
  |?Area
  |?Area
  |?Average rainy days
  |?Average rainy days
  |source=smworg
  |source=semantic-mw
  |mainlabel=-
  |mainlabel=-
  |limit=10
  |limit=10
Ligne 34 : Ligne 36 :
  |?Area
  |?Area
  |?Average rainy days
  |?Average rainy days
  |source=smworg
  |source=semantic-mw
  |mainlabel=-
  |mainlabel=-
  |limit=10
  |limit=10
}}
}}
; See also
* [[My second external query]]
[[Category:Semantic External Query Lookup example]]
[[Category:Semantic External Query Lookup example]]

Dernière version du 12 août 2019 à 12:11

Configuration
$smwgQuerySources = [
	'semantic-mw' => [
		'SMWExternalAskQueryLookup'
		]
	];
$seqlgExternalRepositoryEndpoints = [
	'semantic-mw' => [
		'https://www.semantic-mediawiki.org/w/index.php/$1',
		'https://www.semantic-mediawiki.org/w/api.php',
		true
		]
	];
Syntax
{{#ask:
 [[Category:City]]
 [[Population::+]]
 |?=Name
 |?Population
 |?Area
 |?Average rainy days
 |source=semantic-mw
 |mainlabel=-
 |limit=10
}}
Result
NamePopulationAreaAverage rainy days
Karlsruhe294,761124
See also
Les cookies nous aident à fournir nos services. En utilisant nos services, vous acceptez notre utilisation de cookies.