query-8d6518015ca40c50a5a348e2e10e4e19

rq turtle/ttl

Map with layer of nr outdoor gyms per population in the municipal

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{"hide":["?coord"], "layer": "?per10000capita"}
#title: Map with layer of nr outdoor gyms per population in the municipal 
SELECT ?adminItem ?adminItemLabel (count(?item) as ?nr) ?pop (FLOOR(10000*?nr/?pop) AS ?per10000capita) ?coord WHERE {
    ?item wdt:P6104 wd:Q107186275;
      wdt:P131 ?adminItem.
  OPTIONAL {?adminItem wdt:P1082 ?pop}
  ?adminItem wdt:P17 wd:Q34.
  ?adminItem wdt:P625 ?coord
  SERVICE wikibase:label { bd:serviceParam wikibase:language "sv,en". }
} group by ?adminItem ?adminItemLabel ?pop ?coord
order by desc(?per10000capita)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v3("?adminItem"):::projected v5("?coord"):::projected v2("?item"):::projected v6("?nr"):::projected v7("?per10000capita") v4("?pop"):::projected c9(["bd:serviceParam"]):::iri c11(["sv,en"]):::literal c2(["wd:Q107186275"]):::iri c6(["wd:Q34"]):::iri v2 --"wdt:P6104"--> c2 v2 --"wdt:P131"--> v3 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v3 -."wdt:P1082".-> v4 end v3 --"wdt:P17"--> c6 v3 --"wdt:P625"--> v5 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c9 --"wikibase:language"--> c11 end bind1[/"count(?item)"/] v2 --o bind1 bind1 --as--o v6 bind2[/"numeric-floor('10000^^xsd:integer' * ?nr / ?pop)"/] v6 --o bind2 v4 --o bind2 bind2 --as--o v7