« My first external query » : différence entre les versions
De Semantic MediaWiki - Sandbox
(neu) |
(add) |
||
(10 versions intermédiaires par le même utilisateur non affichées) | |||
Ligne 1 : | Ligne 1 : | ||
; Configuration | |||
<syntaxhighlight lang="php"> | |||
$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 | |||
] | |||
]; | |||
</syntaxhighlight> | |||
; Syntax | |||
<pre> | |||
{{#ask: | {{#ask: | ||
[[ | [[Category:City]] | ||
|? | [[Population::+]] | ||
|? | |?=Name | ||
|source= | |?Population | ||
|mainlabel= | |?Area | ||
| | |?Average rainy days | ||
|source=semantic-mw | |||
|mainlabel=- | |||
|limit=10 | |||
}} | }} | ||
</pre> | |||
; Result | |||
{{#ask: | |||
[[Category:City]] | |||
[[Population::+]] | |||
|?=Name | |||
|?Population | |||
|?Area | |||
|?Average rainy days | |||
|source=semantic-mw | |||
|mainlabel=- | |||
|limit=10 | |||
}} | |||
; See also | |||
* [[My second external query]] | |||
[[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