query-0ff0ea098deb8baf653ee048d96110bc
Query about international border (Q12413618) and closed border (Q87443571) ]reply[15:58, 14 June 2020 (UTC)) talk (Bouzinac. Thanks ! (Q12413618)international border Hello I'd like the following table within all European 15 June 2020 10 March 2020 (Q572463)Italy–Slovenia border Slovenia Italy if they have Q87443571, their end date if they have Q87443571, their start date Their Q about shared border Country B Country A : Bouzinac @
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
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;
v3("?border"):::projected
v6("?closed_end"):::projected
v5("?closed_start"):::projected
v1("?countryA"):::projected
v2("?countryB"):::projected
v4("?instanceOfStatement")
c8(["wd:Q87443571"]):::iri
c2(["wd:Q12413618"]):::iri
c5(["wd:Q46"]):::iri
c12(["bd:serviceParam"]):::iri
c14(["#91;AUTO_LANGUAGE#93;,en"]):::literal
f0[["str(?countryA) < str(?countryB)"]]
f0 --> v1
f0 --> v2
v3 --"p:direct/P31"--> c2
v3 --"p:direct/P17"--> v1
v3 --"p:direct/P17"--> v2
v1 --"p:direct/P30"--> c5
v2 --"p:direct/P30"--> c5
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v3 -."p:P31".-> v4
v4 --"p:statement/P31"--> c8
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v4 -."p:qualifier/P580".-> v5
end
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v4 -."p:qualifier/P582".-> v6
end
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c12 --"wikibase:language"--> c14
end