query-e27c4cc30f82745f1b978684ab6406cc
Check wiki airport element having neither IATA nor ICAO nor FAA LID
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
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/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT DISTINCT ?airport ?airportlabel ?pays ?paysLabel WHERE {
?airport (wdt:P31/wdt:P279*) wd:Q62447.
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,fr,de,kk". }
FILTER(NOT EXISTS { ?airport wdt:P239 ?icao. })
FILTER(NOT EXISTS { ?airport wdt:P238 ?iata. })
FILTER(NOT EXISTS { ?airport wdt:P240 ?FAA. })
FILTER(NOT EXISTS { ?airport wdt:P5699 ?tc_cad.})
FILTER(NOT EXISTS { ?airport wdt:P5746 ?DGAC.})
FILTER(NOT EXISTS { ?airport wdt:P5851 ?russ. })
FILTER(NOT EXISTS { ?airport wdt:P6120 ?argent. })
MINUS { ?airport (wdt:P576|wdt:P582|wdt:P3999) ?dispar. }# remove items with P576 (dissolved, abolished or demolished) as a main property
MINUS {
?airport wdt:P5817 ?interdit.
VALUES ?interdit {
wd:Q811683
wd:Q63065035
wd:Q12377751
wd:Q55653430
wd:Q30108381
wd:Q55570340
wd:Q11639308
}
}
FILTER NOT EXISTS { ?airport p:P239 [rdf:type wdno:P239].} #we do not want the ?item if ICAO has a <no value>
MINUS {?airport wdt:P31/wdt:P279* wd:Q695850.} # exclude military airports
MINUS {?airport wdt:P31/wdt:P279* wd:Q2265915.} # exclude vol à voile
MINUS {?airport wdt:P31/wdt:P279* wd:Q1311670.} # exclude railways stations
MINUS {?airport a wdno:P17.} #exclude airports that aren't physically based in a country
MINUS {?airport wdt:P31/wdt:P279* wd:Q7373622.} # exclude Royal Air Force
MINUS {?airport (wdt:P31/wdt:P279*) wd:Q782667. } # exclude motorways where plane can land
minus {?airport wdt:P31/wdt:P279* wd:Q502074.} # exclude héliports
minus {?airport wdt:P31/wdt:P279* wd:Q44665966.} # exclude airports in project
OPTIONAL {?airport wdt:P17 ?pays. }
} order by ?paysLabel
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v5("?DGAC")
v7("?FAA")
v2("?airport"):::projected
v3("?argent")
v10("?dispar")
v8("?iata")
v9("?icao")
v12("?interdit")
v12("?pays"):::projected
v1("?paysLabel"):::projected
v4("?russ")
v6("?tc_cad")
a2((" "))
a1((" "))
a3((" "))
a4((" "))
a5((" "))
a6((" "))
a7((" "))
a8((" "))
a9((" "))
c26(["wd:Q7373622"]):::iri
c23(["wd:Q2265915"]):::iri
c2(["p:novalue/P239"]):::iri
c25(["p:novalue/P17"]):::iri
c13(["wd:Q62447"]):::iri
c17(["#91;AUTO_LANGUAGE#93;,en,fr,de,kk"]):::literal
c15(["bd:serviceParam"]):::iri
c24(["wd:Q1311670"]):::iri
c22(["wd:Q695850"]):::iri
c28(["wd:Q502074"]):::iri
c27(["wd:Q782667"]):::iri
c29(["wd:Q44665966"]):::iri
f0[["not "]]
subgraph f0e0["Exists Clause"]
e0a1 --"a"--> e0c2
e0v1 --"p:P239"--> e0a1
e0v1("?airport"):::projected
e0a1((" ")):::projected
e0c2(["p:novalue/P239"]):::iri
end
f0--EXISTS--> f0e0
f0 --> a1
f0 --> c1
f0 --> c2
f0 --> v2
f0 --> c3
a1 --"a"--> c2
v2 --"p:P239"--> a1
f1[["not "]]
subgraph f1e1["Exists Clause"]
e1v1 --"p:direct/P6120"--> e1v2
e1v1("?airport"):::projected
e1v2("?argent"):::projected
end
f1--EXISTS--> f1e1
f1 --> v2
f1 --> c4
f1 --> v3
v2 --"p:direct/P6120"--> v3
f2[["not "]]
subgraph f2e2["Exists Clause"]
e2v1 --"p:direct/P5851"--> e2v2
e2v1("?airport"):::projected
e2v2("?russ"):::projected
end
f2--EXISTS--> f2e2
f2 --> v2
f2 --> c5
f2 --> v4
v2 --"p:direct/P5851"--> v4
f3[["not "]]
subgraph f3e3["Exists Clause"]
e3v1 --"p:direct/P5746"--> e3v2
e3v2("?DGAC"):::projected
e3v1("?airport"):::projected
end
f3--EXISTS--> f3e3
f3 --> v2
f3 --> c6
f3 --> v5
v2 --"p:direct/P5746"--> v5
f4[["not "]]
subgraph f4e4["Exists Clause"]
e4v1 --"p:direct/P5699"--> e4v2
e4v1("?airport"):::projected
e4v2("?tc_cad"):::projected
end
f4--EXISTS--> f4e4
f4 --> v2
f4 --> c7
f4 --> v6
v2 --"p:direct/P5699"--> v6
f5[["not "]]
subgraph f5e5["Exists Clause"]
e5v1 --"p:direct/P240"--> e5v2
e5v2("?FAA"):::projected
e5v1("?airport"):::projected
end
f5--EXISTS--> f5e5
f5 --> v2
f5 --> c8
f5 --> v7
v2 --"p:direct/P240"--> v7
f6[["not "]]
subgraph f6e6["Exists Clause"]
e6v1 --"p:direct/P238"--> e6v2
e6v1("?airport"):::projected
e6v2("?iata"):::projected
end
f6--EXISTS--> f6e6
f6 --> v2
f6 --> c9
f6 --> v8
v2 --"p:direct/P238"--> v8
f7[["not "]]
subgraph f7e7["Exists Clause"]
e7v1 --"p:direct/P239"--> e7v2
e7v1("?airport"):::projected
e7v2("?icao"):::projected
end
f7--EXISTS--> f7e7
f7 --> v2
f7 --> c10
f7 --> v9
v2 --"p:direct/P239"--> v9
v2 --"p:direct/P31"--> a2
a2 --"p:direct/P279"--> c13
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c15 --"wikibase:language"--> c17
end
subgraph minus8["MINUS"]
style minus8 stroke-width:6px,fill:pink,stroke:red;
subgraph union0[" Union "]
subgraph union0l[" "]
style union0l fill:#abf,stroke-dasharray: 3 3;
subgraph union1[" Union "]
subgraph union1l[" "]
style union1l fill:#abf,stroke-dasharray: 3 3;
v2 --"p:direct/P3999"--> v10
end
subgraph union1r[" "]
style union1r fill:#abf,stroke-dasharray: 3 3;
v2 --"p:direct/P582"--> v10
end
union1r <== or ==> union1l
end
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
v2 --"p:direct/P576"--> v10
end
union0r <== or ==> union0l
end
end
subgraph minus9["MINUS"]
style minus9 stroke-width:6px,fill:pink,stroke:red;
v2 --"p:direct/P5817"--> v12
bind10[/VALUES ?interdit/]
bind10-->v12
bind100(["wd:Q811683"])
bind100 --> bind10
bind101(["wd:Q63065035"])
bind101 --> bind10
bind102(["wd:Q12377751"])
bind102 --> bind10
bind103(["wd:Q55653430"])
bind103 --> bind10
bind104(["wd:Q30108381"])
bind104 --> bind10
bind105(["wd:Q55570340"])
bind105 --> bind10
bind106(["wd:Q11639308"])
bind106 --> bind10
end
subgraph minus11["MINUS"]
style minus11 stroke-width:6px,fill:pink,stroke:red;
v2 --"p:direct/P31"--> a3
a3 --"p:direct/P279"--> c22
end
subgraph minus12["MINUS"]
style minus12 stroke-width:6px,fill:pink,stroke:red;
v2 --"p:direct/P31"--> a4
a4 --"p:direct/P279"--> c23
end
subgraph minus13["MINUS"]
style minus13 stroke-width:6px,fill:pink,stroke:red;
v2 --"p:direct/P31"--> a5
a5 --"p:direct/P279"--> c24
end
subgraph minus14["MINUS"]
style minus14 stroke-width:6px,fill:pink,stroke:red;
v2 --"a"--> c25
end
subgraph minus15["MINUS"]
style minus15 stroke-width:6px,fill:pink,stroke:red;
v2 --"p:direct/P31"--> a6
a6 --"p:direct/P279"--> c26
end
subgraph minus16["MINUS"]
style minus16 stroke-width:6px,fill:pink,stroke:red;
v2 --"p:direct/P31"--> a7
a7 --"p:direct/P279"--> c27
end
subgraph minus17["MINUS"]
style minus17 stroke-width:6px,fill:pink,stroke:red;
v2 --"p:direct/P31"--> a8
a8 --"p:direct/P279"--> c28
end
subgraph minus18["MINUS"]
style minus18 stroke-width:6px,fill:pink,stroke:red;
v2 --"p:direct/P31"--> a9
a9 --"p:direct/P279"--> c29
end
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v2 -."p:direct/P17".-> v12
end