query-5a6c80f3e5e53514f95a38dc18ec7713
TODO
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 ps: <http://www.wikidata.org/prop/statement/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?municipality ?municipalityLabel ?begindatum ?einddatum ?CBS_gemeentecode ?Amsterdamse_code WHERE {
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
?municipality p:P31 ?statement.
?statement ps:P31 wd:Q2039348.
{ ?statement pq:P582 ?einddatum . }
OPTIONAL { ?municipality wdt:P382 ?CBS_gemeentecode. }
OPTIONAL { ?municipality wdt:P6434 ?Amsterdamse_code. }
MINUS { ?municipality wdt:P131/wdt:P31 wd:Q134390 }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v5("?Amsterdamse_code"):::projected
v4("?CBS_gemeentecode"):::projected
v3("?einddatum"):::projected
v1("?municipality"):::projected
v2("?statement")
a1((" "))
c2(["bd:serviceParam"]):::iri
c13(["wd:Q134390"]):::iri
c7(["wd:Q2039348"]):::iri
c4(["#91;AUTO_LANGUAGE#93;,en"]):::literal
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c2 --"wikibase:language"--> c4
end
v1 --"p:P31"--> v2
v2 --"p:statement/P31"--> c7
v2 --"p:qualifier/P582"--> v3
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v1 -."p:direct/P382".-> v4
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v1 -."p:direct/P6434".-> v5
end
subgraph minus0["MINUS"]
style minus0 stroke-width:6px,fill:pink,stroke:red;
v1 --"p:direct/P131"--> a1
a1 --"p:direct/P31"--> c13
end