query-7f4fa7ec290a5fee7f0c0fd158402333
clause.) LIMIT of results, which might cause trouble for your browser. You might want to add a lot(Note: that query returns a clause. SELECT) in the MAX block, and an aggregate function (WHERE clause below the GROUP BY all the individual population values into one value: the maximum. This is done with a aggregate, and groupSince we’re ordering the results by country, all cities belonging to a country form one contiguous block in the results. To find the highest population within that block, we want to consider the block as a
Use at
- https://query.wikidata.org/sparql
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
SELECT ?kraj (MAX(?populacja) AS ?maxPopulation)
WHERE
{
?miasto wdt:P31/wdt:P279* wd:Q515;
wdt:P17 ?kraj;
wdt:P1082 ?populacja.
}
GROUP BY ?kraj
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?kraj"):::projected
v4("?maxPopulation")
v1("?miasto")
v3("?populacja"):::projected
a1((" "))
c3(["wd:Q515"]):::iri
v1 --"wdt:P31"--> a1
a1 --"wdt:P279"--> c3
v1 --"wdt:P17"--> v2
v1 --"wdt:P1082"--> v3
bind1[/"max(?populacja)"/]
v3 --o bind1
bind1 --as--o v4