query-861c91148ca0bb16528589d71dca6eca
Nachbarkreise seine Nachbarkreise zuzuordnen. Der Stand der Arbeit kann über die folgende Abfrage eingesehen werden. (P47)shares border with nimmt sich gerade (Anfang bis Mitte März 2020) der Arbeit an, jedem Landkreis über Balû
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
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 bd: <http://www.bigdata.com/rdf#>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX v: <http://www.wikidata.org/prop/statement/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
SELECT ?rural ?key ?ruralLabel (COUNT(?neighbor) AS ?count) (GROUP_CONCAT(?neighborName;separator=", ") AS ?neighbors) WHERE {
?rural p:P31 ?instanceBlock .
?instanceBlock v:P31 ?class .
FILTER NOT EXISTS {?instanceBlock pq:P582 ?end} .
?class wdt:P279 wd:Q106658 .
?rural wdt:P440 ?key .
OPTIONAL{?rural wdt:P47 ?neighbor . ?neighbor wdt:P31 ?nClass . ?nClass wdt:P279 wd:Q106658 . ?neighbor rdfs:label ?neighborName . FILTER(lang(?neighborName) = "de")}
SERVICE wikibase:label{bd:serviceParam wikibase:language "de"}
}
GROUP BY ?rural ?key ?ruralLabel
ORDER BY ?key
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v6("?class")
v9("?count")
v3("?end")
v2("?instanceBlock")
v1("?key"):::projected
v8("?nClass")
v7("?neighbor"):::projected
v4("?neighborName"):::projected
v10("?neighbors")
v5("?rural"):::projected
c6(["wd:Q106658"]):::iri
c2(["de"]):::literal
c12(["bd:serviceParam"]):::iri
f0[["not "]]
subgraph f0e0["Exists Clause"]
e0v1 --"p:qualifier/P582"--> e0v2
e0v2("?end"):::projected
e0v1("?instanceBlock"):::projected
end
f0--EXISTS--> f0e0
f0 --> v2
f0 --> c1
f0 --> v3
v2 --"p:qualifier/P582"--> v3
v5 --"p:P31"--> v2
v2 --"p:statement/P31"--> v6
v6 --"p:direct/P279"--> c6
v5 --"p:direct/P440"--> v1
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v5 -."p:direct/P47".-> v7
v7 --"p:direct/P31"--> v8
v8 --"p:direct/P279"--> c6
v7 --"rdfs:label"--> v4
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c12 --"wikibase:language"--> c2
end
bind3[/"count(?neighbor)"/]
v7 --o bind3
bind3 --as--o v9
bind4[/"?neighborName"/]
v4 --o bind4
bind4 --as--o v10