« QueryResultFromAnExternalRepository » : différence entre les versions

De Semantic MediaWiki - Sandbox

(Add #show example)
(Add sort example)
Ligne 58 : Ligne 58 :


Porto has a population of {{#show: Porto|?Population|source=smworg}} that covers a {{#show: Porto|?Area|source=smworg}} area.
Porto has a population of {{#show: Porto|?Population|source=smworg}} that covers a {{#show: Porto|?Area|source=smworg}} area.
== Sort example ==
<pre>
{{#ask:
[[Category:City]]
[[Population::+]]
|?=Name
|?Population
|source=smworg
|mainlabel=-
|limit=3
|sort=Population
|order=asc
}}
</pre>
{{#ask:
[[Category:City]]
[[Population::+]]
|?=Name
|?Population
|source=smworg
|mainlabel=-
|limit=3
|sort=Population
|order=asc
}}
<pre>
{{#ask:
[[Category:City]]
[[Population::+]]
|?=Name
|?Population
|source=smworg
|mainlabel=-
|limit=3
|sort=Population
|order=desc
}}
</pre>
{{#ask:
[[Category:City]]
[[Population::+]]
|?=Name
|?Population
|source=smworg
|mainlabel=-
|limit=3
|sort=Population
|order=desc
}}


[[Category:Semantic External Query Lookup example]]
[[Category:Semantic External Query Lookup example]]

Version du 19 novembre 2015 à 22:37

{{#ask:
 [[Category:City]]
 [[Population::+]]
 |?=Name
 |?Population
 |?Area
 |?Average rainy days
 |source=smworg
 |mainlabel=-
 |limit=10
}}

Results displayed on this page are queried using the external smworg source.

NamePopulationAreaAverage rainy days
Karlsruhe294,761124

See also the configuration setting for the smworg source in the respective section.

Math (sum)

{{#ask:
 [[Category:City]]
 [[Population::+]]
 |?Population
 |mainlabel=-
 |limit=5
 |format=sum
 |source=smworg
}}

Population (total of the first 5): 294,761

#show

{{#show: Porto|?Population|source=smworg}}
{{#show: Porto|?Area|source=smworg}}

Porto has a population of that covers a area.

Sort example

{{#ask:
 [[Category:City]]
 [[Population::+]]
 |?=Name
 |?Population
 |source=smworg
 |mainlabel=-
 |limit=3
 |sort=Population
 |order=asc
}}
NamePopulation
Karlsruhe294,761
{{#ask:
 [[Category:City]]
 [[Population::+]]
 |?=Name
 |?Population
 |source=smworg
 |mainlabel=-
 |limit=3
 |sort=Population
 |order=desc
}}
NamePopulation
Karlsruhe294,761
Les cookies nous aident à fournir nos services. En utilisant nos services, vous acceptez notre utilisation de cookies.