query-23074a1607e32d22bce20e529ec14ddd

rq turtle/ttl

20:04, 18 April 2018 (UTC)) talk (Infovarius is somehow lost... --(Q656)Saint Petersburg works almost good but (Q159)Russia The same query for : that's an error, thanks! And it helps with Q159, but there is still only 1 result for Q15180:Larske@ 15:35, 20 April 2018 (UTC)) talk (LarskeI think you should have wdt:P279 (not wd:P279) in your query. --

Use at

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 ?countryLabel ?population WHERE {
  ?country (wdt:P31/wdt:P279*) wd:Q515.
  ?country wdt:P17 wd:Q15180.
  ?country wdt:P1082 ?population.
  SERVICE wikibase:label { bd:serviceParam wikibase:language "ru". }
}
GROUP BY ?population ?countryLabel
ORDER BY DESC(?population)
LIMIT 20

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v2("?country") v1("?population"):::projected a1((" ")) c5(["wd:Q15180"]):::iri c8(["bd:serviceParam"]):::iri c10(["ru"]):::literal c3(["wd:Q515"]):::iri v2 --"wdt:P31"--> a1 a1 --"wdt:P279"--> c3 v2 --"wdt:P17"--> c5 v2 --"wdt:P1082"--> v1 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c8 --"wikibase:language"--> c10 end