query-16e189344084dc1ecd3cc417121d59f2
Bouzinac(Q31354462)Republic of Abkhazia
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 ?countryA ?countryALabel ?countryB ?countryBLabel ?border ?borderLabel ?closed_start ?closed_end
WHERE
{
?border wdt:P31 wd:Q12413618.
?border wdt:P17 ?countryA.
?border wdt:P17 ?countryB.
FILTER (STR(?countryA) < STR(?countryB))
?countryA wdt:P30 wd:Q46. # continent is Europe
?countryB wdt:P30 wd:Q46. # continent is Europe
FILTER NOT EXISTS { ?countryA wdt:P576 ?dissolved. } # No date for dissolved
FILTER NOT EXISTS { ?countryB wdt:P576 ?dissolved. } # No date for dissolved
OPTIONAL
{
?border p:P31 ?instanceOfStatement.
?instanceOfStatement ps:P31 wd:Q87443571.
OPTIONAL { ?instanceOfStatement pq:P580 ?closed_start. }
OPTIONAL { ?instanceOfStatement pq:P582 ?closed_end. }
}
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v4("?border"):::projected
v7("?closed_end"):::projected
v6("?closed_start"):::projected
v3("?countryA"):::projected
v1("?countryB"):::projected
v2("?dissolved")
v5("?instanceOfStatement")
c9(["wd:Q87443571"]):::iri
c3(["wd:Q12413618"]):::iri
c6(["wd:Q46"]):::iri
c13(["bd:serviceParam"]):::iri
c15(["#91;AUTO_LANGUAGE#93;,en"]):::literal
f0[["not "]]
subgraph f0e0["Exists Clause"]
e0v1 --"p:direct/P576"--> e0v2
e0v1("?countryB"):::projected
e0v2("?dissolved"):::projected
end
f0--EXISTS--> f0e0
f0 --> v1
f0 --> c1
f0 --> v2
v1 --"p:direct/P576"--> v2
f1[["not "]]
subgraph f1e1["Exists Clause"]
e1v1 --"p:direct/P576"--> e1v2
e1v1("?countryA"):::projected
e1v2("?dissolved"):::projected
end
f1--EXISTS--> f1e1
f1 --> v3
f1 --> c1
f1 --> v2
v3 --"p:direct/P576"--> v2
f2[["str(?countryA) < str(?countryB)"]]
f2 --> v3
f2 --> v1
v4 --"p:direct/P31"--> c3
v4 --"p:direct/P17"--> v3
v4 --"p:direct/P17"--> v1
v3 --"p:direct/P30"--> c6
v1 --"p:direct/P30"--> c6
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v4 -."p:P31".-> v5
v5 --"p:statement/P31"--> c9
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v5 -."p:qualifier/P580".-> v6
end
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v5 -."p:qualifier/P582".-> v7
end
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c13 --"wikibase:language"--> c15
end