query-43587e2a1d61b2f521fae01b2bc2b548

rq turtle/ttl

Get airports which do not have an ICAO set, or do not have an ICAO set to select ?item where { ?item wdt:P31/wdt:P279* wd:Q1248784. FILTER NOT EXISTS { ?item wdt:P239 ?icao . } # we do not want the ?item if it has a valid ICAO code FILTER NOT EXISTS { ?item p:P239 [rdf:type wdno:P239] . } # we do not want the ?item if it has a
}

Use at

PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wdno: <http://www.wikidata.org/prop/novalue/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX p: <http://www.wikidata.org/prop/>
# Get airports which do not have an ICAO set, or do not have an ICAO set to <no value>
select ?item where {
  ?item wdt:P31/wdt:P279* wd:Q1248784.
  FILTER NOT EXISTS { ?item wdt:P239 ?icao . }               # we do not want the ?item if it has a valid ICAO code
  FILTER NOT EXISTS { ?item p:P239 [rdf:type wdno:P239] . }  # we do not want the ?item if it has a <no value>        
  }

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v2("?icao") v1("?item"):::projected a2((" ")) a1((" ")) c2(["p:novalue/P239"]):::iri c7(["wd:Q1248784"]):::iri f0[["not "]] subgraph f0e0["Exists Clause"] e0a1 --"a"--> e0c2 e0v1 --"p:P239"--> e0a1 e0v1("?item"):::projected e0a1((" ")):::projected e0c2(["p:novalue/P239"]):::iri end f0--EXISTS--> f0e0 f0 --> a1 f0 --> c1 f0 --> c2 f0 --> v1 f0 --> c3 a1 --"a"--> c2 v1 --"p:P239"--> a1 f1[["not "]] subgraph f1e1["Exists Clause"] e1v1 --"p:direct/P239"--> e1v2 e1v2("?icao"):::projected e1v1("?item"):::projected end f1--EXISTS--> f1e1 f1 --> v1 f1 --> c4 f1 --> v2 v1 --"p:direct/P239"--> v2 v1 --"p:direct/P31"--> a2 a2 --"p:direct/P279"--> c7