« 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 = [ | ||
' | 'semantic-mw' => [ | ||
'SMWExternalAskQueryLookup' | |||
] | |||
]; | ]; | ||
$seqlgExternalRepositoryEndpoints = [ | $seqlgExternalRepositoryEndpoints = [ | ||
' | '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= | |source=semantic-mw | ||
|mainlabel=- | |mainlabel=- | ||
|limit=10 | |limit=10 | ||
Ligne 34 : | Ligne 36 : | ||
|?Area | |?Area | ||
|?Average rainy days | |?Average rainy days | ||
|source= | |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
Name | Population | Area | Average rainy days |
---|---|---|---|
Karlsruhe | 294,761 | 124 |
- See also