query-826a2c7bb941cbb03ba25ce42a414f30

rq turtle/ttl

Big cities, grouped into map layers by population Big cities, grouped into map layers by population Grandes villes groupées selon la population par niveaux géographiques Big cities, grouped into map layers by population Big cities, grouped into map layers by population Grote steden, gegroepeerd in kaartlagen op bevolkingsomvang Stora städer, grupperade i kartlager efter befolkning Big cities, grouped into map layers by population Big cities, grouped into map layers by population Big cities, grouped into map layers by population

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#>
#defaultView:Map
SELECT DISTINCT ?city ?cityLabel (SAMPLE(?location) AS ?location) (MAX(?population) AS ?population) (SAMPLE(?layer) AS ?layer)
WHERE
{
  ?city wdt:P31/wdt:P279* wd:Q515;
        wdt:P625 ?location;
        wdt:P1082 ?population.
  FILTER(?population >= 500000).
  BIND(
    IF(?population < 1000000, "<1M",
    IF(?population < 2000000, "1M-2M",
    IF(?population < 5000000, "2M-5M",
    IF(?population < 10000000, "5M-10M",
    IF(?population < 20000000, "10M-20M",
    ">20M")))))
    AS ?layer).
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
GROUP BY ?city ?cityLabel

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v2("?city"):::projected v5("?layer"):::projected v5("?location"):::projected v5("?population"):::projected a1((" ")) c8(["bd:serviceParam"]):::iri c4(["wd:Q515"]):::iri c10(["#91;AUTO_LANGUAGE#93;,en"]):::literal f0[["?population >= '500000^^xsd:integer'"]] f0 --> v5 v2 --"wdt:P31"--> a1 a1 --"wdt:P279"--> c4 v2 --"wdt:P625"--> v5 v2 --"wdt:P1082"--> v5 bind1[/"if(?population < '1000000^^xsd:integer','<1M',if(?population < '2000000^^xsd:integer','1M-2M',if(?population < '5000000^^xsd:integer','2M-5M',if(?population < '10000000^^xsd:integer','5M-10M',if(?population < '20000000^^xsd:integer','10M-20M','>20M')))))"/] v5 --o bind1 bind1 --as--o v5 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c8 --"wikibase:language"--> c10 end bind5[/"sample(?location)"/] v5 --o bind5 bind5 --as--o v5 bind6[/"max(?population)"/] v5 --o bind6 bind6 --as--o v5 bind7[/"sample(?layer)"/] v5 --o bind7 bind7 --as--o v5