query-49aaae1435ec2621e2484dc004618e4f
Jura1Bouzinac
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?EU_member ?EU_memberLabel ?population (COUNT(?found_larger_population) + 1 AS ?population_rank)
WHERE
{
{
SELECT ?EU_member ?population
WHERE
{
wd:Q458 wdt:P150 ?EU_member .
?EU_member wdt:P1082 ?population .
}
} {
SELECT (?population AS ?population2)
WHERE
{
{
SELECT ?EU_member ?population
WHERE
{
wd:Q458 wdt:P150 ?EU_member .
?EU_member wdt:P1082 ?population .
}
} }
}
BIND (IF(?population2 > ?population, true, 1/0) AS ?found_larger_population)
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
GROUP BY ?EU_member ?EU_memberLabel ?population
ORDER BY DESC(?population)
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?EU_member"):::projected
v4("?found_larger_population")
v1("?population"):::projected
v3("?population2")
v5("?population_rank")
c5(["bd:serviceParam"]):::iri
c1(["wd:Q458"]):::iri
c7(["#91;AUTO_LANGUAGE#93;,en"]):::literal
c1 --"wdt:P150"--> v2
v2 --"wdt:P1082"--> v1
c1 --"wdt:P150"--> v2
v2 --"wdt:P1082"--> v1
bind0[/"?population"/]
v1 --o bind0
bind0 --as--o v3
bind1[/"if(?population2 > ?population,'true^^xsd:boolean','1^^xsd:integer' / '0^^xsd:integer')"/]
v3 --o bind1
v1 --o bind1
bind1 --as--o v4
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c5 --"wikibase:language"--> c7
end
bind3[/" + '1^^xsd:integer'"/]
null --o bind3
bind3 --as--o v5