query-9ecc94605b869ef1593932923a76b940

rq turtle/ttl

TODO

Use at

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, "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((" ")) c16(["#91;AUTO_LANGUAGE#93;,en,fr"]):::literal c9(["wd:Q62447"]):::iri c14(["bd:serviceParam"]):::iri c10(["wd:Q695850"]):::iri f0[["(contains(lower-case(?label),'air force base') || (contains(?label,'AFB') || (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"--> c9 subgraph minus1["MINUS"] style minus1 stroke-width:6px,fill:pink,stroke:red; v2 --"wdt:P31"--> a2 a2 --"wdt:P279"--> c10 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; c14 --"wikibase:language"--> c16 end