query-89c85a1ede885fee1fa958ab910b9540
Military airbases
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#>
SELECT DISTINCT ?item ?itemLabel ?operator ?operatorLabel
WHERE
{
?item wdt:P31 / wdt:P279 * wd:Q62447 . # item is aerodrome
MINUS { ?item wdt:P31 / wdt:P279 * wd:Q695850 . } # but not airbase
OPTIONAL { ?item wdt:P137 ?operator . }
?item rdfs:label ?label .
FILTER
(
CONTAINS(LCASE(?label), "air force base")||
CONTAINS(?label, "AFB") || CONTAINS(?label, "AFLB") ||CONTAINS(?label, "mil ") ||
CONTAINS(?label, "CFB") ||
CONTAINS(LCASE(?label), "base aérienne") ||
CONTAINS(LCASE(?label), "base aérea") ||
CONTAINS(?label, "Militärflugplatz")
)
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,fr". } }
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?item"):::projected
v1("?label")
v3("?operator"):::projected
a1((" "))
a2((" "))
c18(["#91;AUTO_LANGUAGE#93;,en,fr"]):::literal
c11(["wd:Q62447"]):::iri
c16(["bd:serviceParam"]):::iri
c12(["wd:Q695850"]):::iri
f0[["(contains(lower-case(?label),'air force base') || (contains(?label,'AFB') || (contains(?label,'AFLB') || (contains(?label,'mil ') || (contains(?label,'CFB') || (contains(lower-case(?label),'base aérienne') || (contains(lower-case(?label),'base aérea') || contains(?label,'Militärflugplatz'))))))))"]]
f0 --> v1
v2 --"wdt:P31"--> a1
a1 --"wdt:P279"--> c11
subgraph minus1["MINUS"]
style minus1 stroke-width:6px,fill:pink,stroke:red;
v2 --"wdt:P31"--> a2
a2 --"wdt:P279"--> c12
end
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v2 -."wdt:P137".-> v3
end
v2 --"rdfs:label"--> v1
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c16 --"wikibase:language"--> c18
end