query-79d438b97e717f724ed9f3d5530bc968

rq turtle/ttl

In city comparisonSee also Statistic 1.

Use at

PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT ?sector ?sectorLabel (COUNT(?_city) AS ?count) (SAMPLE(?_cityLabel) AS ?label) WHERE {
  ?item wdt:P31 wd:Q4830453;
    wdt:P2868 wd:Q19287329;
    wdt:P452 ?sector;
    wdt:P159 ?_city.
  ?_city wdt:P31 wd:Q42744322;
    rdfs:label ?_cityLabel.
  ?sector rdfs:label ?sectorLabel.
  FILTER((LANG(?sectorLabel)) = "de")
  FILTER((LANG(?_cityLabel)) = "de")
}
GROUP BY ?_cityLabel ?sector ?sectorLabel

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v5("?_city"):::projected v1("?_cityLabel"):::projected v6("?count") v3("?item") v7("?label") v4("?sector"):::projected v2("?sectorLabel"):::projected c5(["wd:Q19287329"]):::iri c8(["wd:Q42744322"]):::iri c3(["wd:Q4830453"]):::iri f0[["?_cityLabel = 'de'"]] f0 --> v1 f1[["?sectorLabel = 'de'"]] f1 --> v2 v3 --"wdt:P31"--> c3 v3 --"wdt:P2868"--> c5 v3 --"wdt:P452"--> v4 v3 --"wdt:P159"--> v5 v5 --"wdt:P31"--> c8 v5 --"rdfs:label"--> v1 v4 --"rdfs:label"--> v2 bind4[/"count(?_city)"/] v5 --o bind4 bind4 --as--o v6 bind5[/"sample(?_cityLabel)"/] v1 --o bind5 bind5 --as--o v7