query-1b19cbdb98632828ba3fa3b2f5c9d58d

rq turtle/ttl

Die größten Gemeinden mit gegebenem Gemeindenanfangsbuchstaben

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#>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
SELECT ?firstLetter ?muni ?key ?muniName ?population WHERE {
  VALUES ?instance {wd:Q262166 wd:Q42744322} .
  ?muni wdt:P439 ?key .
  ?muni p:P31 ?instanceBlock . 
  ?instanceBlock ps:P31 ?instance .
  FILTER NOT EXISTS {?instanceBlock pq:P582 ?end} .
  ?muni wdt:P1082 ?population .
  ?muni rdfs:label ?muniName . FILTER(lang(?muniName) = "de") .
  BIND(STR(SUBSTR(?muniName,1,1)) AS ?firstLetter) . FILTER(?firstLetter="B")
}
ORDER BY DESC(?population)
LIMIT 5

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v5("?end") v9("?firstLetter"):::projected v6("?instance") v4("?instanceBlock") v8("?key"):::projected v7("?muni"):::projected v3("?muniName"):::projected v1("?population"):::projected f0[["?firstLetter = 'B'"]] f0 --> v9 f1[["?muniName = 'de'"]] f1 --> v3 f2[["not "]] subgraph f2e0["Exists Clause"] e0v1 --"p:qualifier/P582"--> e0v2 e0v2("?end"):::projected e0v1("?instanceBlock"):::projected end f2--EXISTS--> f2e0 f2 --> v4 f2 --> c3 f2 --> v5 v4 --"p:qualifier/P582"--> v5 bind3[/VALUES ?instance/] bind3-->v6 bind30(["wd:Q262166"]) bind30 --> bind3 bind31(["wd:Q42744322"]) bind31 --> bind3 v7 --"p:direct/P439"--> v8 v7 --"p:P31"--> v4 v4 --"p:statement/P31"--> v6 v7 --"p:direct/P1082"--> v1 v7 --"rdfs:label"--> v3 bind4[/"str(substring(?muniName,'1^^xsd:integer','1^^xsd:integer'))"/] v3 --o bind4 bind4 --as--o v9