query-b29eb8aa97cdf4eb9882f067835935b9

rq turtle/ttl

Abfrage mit möglichem Zeitpunkt aus der Vergangenheit und Gemeindeschlüssel:

Use at

PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
PREFIX v: <http://www.wikidata.org/prop/statement/>
SELECT ?muni ?key ?muniLabel ?instanceLabel WHERE {
  ?muni wdt:P439 ?key .
  BIND("2022-12-31"^^xsd:date AS ?day) . 
  VALUES ?instance {wd:Q116457956 wd:Q42744322} .
  ?muni p:P31 ?instanceBlock . 
  ?instanceBlock v:P31 ?instance .
  FILTER NOT EXISTS {?instanceBlock pq:P580 ?start FILTER(?start > ?day)} .
  FILTER NOT EXISTS {?instanceBlock pq:P582 ?end FILTER(?end < ?day)}  
  SERVICE wikibase:label{bd:serviceParam wikibase:language "de"}
}
ORDER BY ?muniLabel DESC(?instanceLabel) ?muni

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v9("?day") v4("?end") v9("?instance") v6("?instanceBlock") v2("?instanceLabel"):::projected v8("?key"):::projected v3("?muni"):::projected v1("?muniLabel"):::projected v7("?start") c9(["de"]):::literal c7(["bd:serviceParam"]):::iri f0[["not "]] subgraph f0e0["Exists Clause"] e0f0[["?end < ?day"]] e0f0 --> e0v1 e0f0 --> e0v2 e0v3 --"p:qualifier/P582"--> e0v1 e0v2("?day"):::projected e0v1("?end"):::projected e0v3("?instanceBlock"):::projected end f0--EXISTS--> f0e0 f0 --> v4 f0 --> v9 f0 --> v6 f0 --> c1 f1[["?end < ?day"]] f1 --> v4 f1 --> v9 v6 --"p:qualifier/P582"--> v4 f2[["not "]] subgraph f2e1["Exists Clause"] e1f0[["?start > ?day"]] e1f0 --> e1v1 e1f0 --> e1v2 e1v3 --"p:qualifier/P580"--> e1v1 e1v2("?day"):::projected e1v3("?instanceBlock"):::projected e1v1("?start"):::projected end f2--EXISTS--> f2e1 f2 --> v7 f2 --> v9 f2 --> v6 f2 --> c2 f3[["?start > ?day"]] f3 --> v7 f3 --> v9 v6 --"p:qualifier/P580"--> v7 v3 --"p:direct/P439"--> v8 bind4[/"'2022-12-31^^xsd:date'"/] bind4 --as--o v9 bind5[/VALUES ?instance/] bind5-->v9 bind50(["wd:Q116457956"]) bind50 --> bind5 bind51(["wd:Q42744322"]) bind51 --> bind5 v3 --"p:P31"--> v6 v6 --"p:statement/P31"--> v9 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c7 --"wikibase:language"--> c9 end