query-802ee3156ae341ff0895256624bfcc5b
Whole wiki items that have an airport IATA/ICAO/FAA/DGAC/TC_LID codeBetter in Chrome navigator
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 bd: <http://www.bigdata.com/rdf#>
PREFIX schema: <http://schema.org/>
SELECT ?item ?itemLabel ?natureLabel ?countryLabel ?IATA ?ICAO (SAMPLE(?Local_Code) AS ?Local_Code)
WHERE {
OPTIONAL { ?item wdt:P238 ?IATA. }
OPTIONAL { ?item wdt:P239 ?ICAO. }
OPTIONAL { ?item wdt:P17 ?country. }
OPTIONAL { ?item wdt:P240 ?Local_Code. }
OPTIONAL { ?item wdt:P5699 ?Local_Code. }
OPTIONAL { ?item wdt:P5746 ?Local_Code. }
OPTIONAL { ?item wdt:P5851 ?Local_Code. }
OPTIONAL { ?item wdt:P6120 ?Local_Code. }
OPTIONAL { ?item wdt:P31 ?nature. }
MINUS { ?item wdt:P576 [].} # remove items with P576 (dissolved, abolished or demolished) as a main property
MINUS { ?item wdt:P582 [].} # remove items with P582 (end date) as a main property
MINUS { ?item (wdt:P31/wdt:P279*) wd:Q782667. } # exclude motorways where plane can land
MINUS { ?item wdt:P31/wdt:P279* wd:Q44665966.} # exclude airports being build
MINUS { ?item wdt:P31/wdt:P279* wd:Q2265915.} # exclude vol à voile/gliders
MINUS { ?item (wdt:P31/wdt:P279*) wd:Q502074. } # exclude héliports
MINUS { ?item a wdno:P17.} #exclude airports that aren't physically based in a country
FILTER( ?item not in
(wd:Q60972, wd:Q2886531,wd:Q176146, wd:Q323983, wd:Q388394, wd:Q472049, wd:Q473055, wd:Q576617, wd:Q577946, wd:Q619976, wd:Q649929, wd:Q761001, wd:Q768542, wd:Q939039, wd:Q955268, wd:Q1031829, wd:Q1032113, wd:Q1095676, wd:Q1148639, wd:Q1298115, wd:Q1338960, wd:Q1350451, wd:Q1403609, wd:Q1416857, wd:Q1433509, wd:Q1444594, wd:Q1493010, wd:Q1529149, wd:Q1636887, wd:Q1654635, wd:Q1656800, wd:Q1657595, wd:Q1658031, wd:Q1658500, wd:Q1751264, wd:Q1800787, wd:Q1836818, wd:Q1836849, wd:Q1893607, wd:Q2026702, wd:Q2360285, wd:Q2361539, wd:Q2371958, wd:Q2602457, wd:Q2663480, wd:Q2872473, wd:Q2886451, wd:Q2886460, wd:Q2886467, wd:Q2886488, wd:Q2886489, wd:Q2886504, wd:Q2886563, wd:Q2886566, wd:Q2886568, wd:Q2902833, wd:Q3196747, wd:Q3218170, wd:Q3499338, wd:Q3612693, wd:Q3635552, wd:Q3887690, wd:Q4115006, wd:Q4115518, wd:Q4257441, wd:Q4381026, wd:Q4402324, wd:Q5135044, wd:Q5365417, wd:Q5453767, wd:Q5607481, wd:Q5669602, wd:Q5721555, wd:Q5721576, wd:Q5733903, wd:Q5753943, wd:Q5754926, wd:Q6358138, wd:Q6413305, wd:Q6747097, wd:Q6906023, wd:Q7158431, wd:Q7188237, wd:Q7242494, wd:Q7274959, wd:Q7274976, wd:Q7277289, wd:Q7331905, wd:Q7368132, wd:Q7419397, wd:Q7419671, wd:Q7427836, wd:Q7580932, wd:Q7930596, wd:Q7942651, wd:Q7966282, wd:Q7969333, wd:Q7992372, wd:Q8243338, wd:Q8243340, wd:Q10822643, wd:Q10853535, wd:Q10860387, wd:Q10860397, wd:Q10860400, wd:Q10860405, wd:Q14679983, wd:Q14709491, wd:Q15221694, wd:Q17082712, wd:Q17512364, wd:Q18126343, wd:Q19406831, wd:Q19828268, wd:Q19873178, wd:Q21005896, wd:Q21016007
, wd:Q56289584 ,wd:Q2886531,wd:Q660972,wd:Q7960223,wd:Q801410,wd:Q801410,wd:Q3271057,wd:Q3612309,wd:Q3015996,wd:Q4860232,wd:Q4651415
,wd:Q1031183,wd:Q441476,wd:Q441476,wd:Q19574887,wd:Q7460182,wd:Q4380750,wd:Q3015119,wd:Q7275460,wd:Q10845888,wd:Q14707052,wd:Q5038426,wd:Q704394,wd:Q704394,wd:Q156971,wd:Q18618942
,wd:Q1427413,wd:Q1835479,wd:Q371816,wd:Q3274819,wd:Q1433608,wd:Q3017040,wd:Q3913284,wd:Q16899355,wd:Q1766303,wd:Q1766303,wd:Q138896,wd:Q3207485,wd:Q681505,wd:Q1433649,wd:Q12694367
,wd:Q3015575,wd:Q2900666,wd:Q3014539,wd:Q2628568,wd:Q6344047,wd:Q1082819,wd:Q325491,wd:Q5659239,wd:Q6516685,wd:Q1655754,wd:Q706994
,wd:Q706994,wd:Q2071294,wd:Q1407551,wd:Q1030738,wd:Q1030738,wd:Q1031547,wd:Q3015041,wd:Q28449604,wd:Q1031594,wd:Q1031594,wd:Q3016361
,wd:Q7275582,wd:Q1654943,wd:Q3014320,wd:Q5065943,wd:Q3015462,wd:Q1800390,wd:Q784017,wd:Q3271311,wd:Q1498314,wd:Q7199307,wd:Q4651612,wd:Q2828202,wd:Q723474,wd:Q1164127,wd:Q174247,wd:Q7275708
,wd:Q47465,wd:Q47465,wd:Q960480,wd:Q2886509,wd:Q980034,wd:Q1780219,wd:Q8190944,wd:Q1513045,wd:Q3298050
,wd:Q3271063,wd:Q3234808,wd:Q1940767,wd:Q1520213,wd:Q18157236,wd:Q18157236,wd:Q7944502,wd:Q12694595,wd:Q2625576,wd:Q7940661,wd:Q3014516,wd:Q2318365,wd:Q6694741,wd:Q3696011,wd:Q652085,wd:Q8058641,wd:Q8058641,wd:Q1030442
,wd:Q1433506,wd:Q1433636)
)#Exclude military airports sharing same IATA code than another civilian airport
FILTER( ?IATA not in ( "LON","PAR","NYC","TYO","MOW","BUH" ,"BUE" ,"CHI", "JKT" ,"MIL", "YMQ" ,"OSA", "RIO" ,"ROM" ,"SAO" ,"SPK" ,"SEL", "STO", "YTO" ,"WAS") ) #exclude metropolitan city codes
SERVICE wikibase:label { bd:serviceParam wikibase:language "fr,en". }
} GROUP BY ?item ?itemLabel ?natureLabel ?countryLabel ?ICAO ?IATA
ORDER BY ?country ?natureLabel
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v3("?IATA"):::projected
v5("?ICAO"):::projected
v8("?Local_Code"):::projected
v1("?country")
v4("?item"):::projected
v7("?nature")
v2("?natureLabel"):::projected
a1((" "))
a2((" "))
a3((" "))
a4((" "))
a5((" "))
a6((" "))
c254(["bd:serviceParam"]):::iri
c256(["fr,en"]):::literal
c248(["wd:Q44665966"]):::iri
c252(["wdno:P17"]):::iri
c249(["wd:Q2265915"]):::iri
c250(["wd:Q502074"]):::iri
c247(["wd:Q782667"]):::iri
f0[["?IATA != 'LON'?IATA != 'PAR'?IATA != 'NYC'?IATA != 'TYO'?IATA != 'MOW'?IATA != 'BUH'?IATA != 'BUE'?IATA != 'CHI'?IATA != 'JKT'?IATA != 'MIL'?IATA != 'YMQ'?IATA != 'OSA'?IATA != 'RIO'?IATA != 'ROM'?IATA != 'SAO'?IATA != 'SPK'?IATA != 'SEL'?IATA != 'STO'?IATA != 'YTO'?IATA != 'WAS'"]]
f0 --> v3
f1[["?item != 'wd:Q60972'?item != 'wd:Q2886531'?item != 'wd:Q176146'?item != 'wd:Q323983'?item != 'wd:Q388394'?item != 'wd:Q472049'?item != 'wd:Q473055'?item != 'wd:Q576617'?item != 'wd:Q577946'?item != 'wd:Q619976'?item != 'wd:Q649929'?item != 'wd:Q761001'?item != 'wd:Q768542'?item != 'wd:Q939039'?item != 'wd:Q955268'?item != 'wd:Q1031829'?item != 'wd:Q1032113'?item != 'wd:Q1095676'?item != 'wd:Q1148639'?item != 'wd:Q1298115'?item != 'wd:Q1338960'?item != 'wd:Q1350451'?item != 'wd:Q1403609'?item != 'wd:Q1416857'?item != 'wd:Q1433509'?item != 'wd:Q1444594'?item != 'wd:Q1493010'?item != 'wd:Q1529149'?item != 'wd:Q1636887'?item != 'wd:Q1654635'?item != 'wd:Q1656800'?item != 'wd:Q1657595'?item != 'wd:Q1658031'?item != 'wd:Q1658500'?item != 'wd:Q1751264'?item != 'wd:Q1800787'?item != 'wd:Q1836818'?item != 'wd:Q1836849'?item != 'wd:Q1893607'?item != 'wd:Q2026702'?item != 'wd:Q2360285'?item != 'wd:Q2361539'?item != 'wd:Q2371958'?item != 'wd:Q2602457'?item != 'wd:Q2663480'?item != 'wd:Q2872473'?item != 'wd:Q2886451'?item != 'wd:Q2886460'?item != 'wd:Q2886467'?item != 'wd:Q2886488'?item != 'wd:Q2886489'?item != 'wd:Q2886504'?item != 'wd:Q2886563'?item != 'wd:Q2886566'?item != 'wd:Q2886568'?item != 'wd:Q2902833'?item != 'wd:Q3196747'?item != 'wd:Q3218170'?item != 'wd:Q3499338'?item != 'wd:Q3612693'?item != 'wd:Q3635552'?item != 'wd:Q3887690'?item != 'wd:Q4115006'?item != 'wd:Q4115518'?item != 'wd:Q4257441'?item != 'wd:Q4381026'?item != 'wd:Q4402324'?item != 'wd:Q5135044'?item != 'wd:Q5365417'?item != 'wd:Q5453767'?item != 'wd:Q5607481'?item != 'wd:Q5669602'?item != 'wd:Q5721555'?item != 'wd:Q5721576'?item != 'wd:Q5733903'?item != 'wd:Q5753943'?item != 'wd:Q5754926'?item != 'wd:Q6358138'?item != 'wd:Q6413305'?item != 'wd:Q6747097'?item != 'wd:Q6906023'?item != 'wd:Q7158431'?item != 'wd:Q7188237'?item != 'wd:Q7242494'?item != 'wd:Q7274959'?item != 'wd:Q7274976'?item != 'wd:Q7277289'?item != 'wd:Q7331905'?item != 'wd:Q7368132'?item != 'wd:Q7419397'?item != 'wd:Q7419671'?item != 'wd:Q7427836'?item != 'wd:Q7580932'?item != 'wd:Q7930596'?item != 'wd:Q7942651'?item != 'wd:Q7966282'?item != 'wd:Q7969333'?item != 'wd:Q7992372'?item != 'wd:Q8243338'?item != 'wd:Q8243340'?item != 'wd:Q10822643'?item != 'wd:Q10853535'?item != 'wd:Q10860387'?item != 'wd:Q10860397'?item != 'wd:Q10860400'?item != 'wd:Q10860405'?item != 'wd:Q14679983'?item != 'wd:Q14709491'?item != 'wd:Q15221694'?item != 'wd:Q17082712'?item != 'wd:Q17512364'?item != 'wd:Q18126343'?item != 'wd:Q19406831'?item != 'wd:Q19828268'?item != 'wd:Q19873178'?item != 'wd:Q21005896'?item != 'wd:Q21016007'?item != 'wd:Q56289584'?item != 'wd:Q2886531'?item != 'wd:Q660972'?item != 'wd:Q7960223'?item != 'wd:Q801410'?item != 'wd:Q801410'?item != 'wd:Q3271057'?item != 'wd:Q3612309'?item != 'wd:Q3015996'?item != 'wd:Q4860232'?item != 'wd:Q4651415'?item != 'wd:Q1031183'?item != 'wd:Q441476'?item != 'wd:Q441476'?item != 'wd:Q19574887'?item != 'wd:Q7460182'?item != 'wd:Q4380750'?item != 'wd:Q3015119'?item != 'wd:Q7275460'?item != 'wd:Q10845888'?item != 'wd:Q14707052'?item != 'wd:Q5038426'?item != 'wd:Q704394'?item != 'wd:Q704394'?item != 'wd:Q156971'?item != 'wd:Q18618942'?item != 'wd:Q1427413'?item != 'wd:Q1835479'?item != 'wd:Q371816'?item != 'wd:Q3274819'?item != 'wd:Q1433608'?item != 'wd:Q3017040'?item != 'wd:Q3913284'?item != 'wd:Q16899355'?item != 'wd:Q1766303'?item != 'wd:Q1766303'?item != 'wd:Q138896'?item != 'wd:Q3207485'?item != 'wd:Q681505'?item != 'wd:Q1433649'?item != 'wd:Q12694367'?item != 'wd:Q3015575'?item != 'wd:Q2900666'?item != 'wd:Q3014539'?item != 'wd:Q2628568'?item != 'wd:Q6344047'?item != 'wd:Q1082819'?item != 'wd:Q325491'?item != 'wd:Q5659239'?item != 'wd:Q6516685'?item != 'wd:Q1655754'?item != 'wd:Q706994'?item != 'wd:Q706994'?item != 'wd:Q2071294'?item != 'wd:Q1407551'?item != 'wd:Q1030738'?item != 'wd:Q1030738'?item != 'wd:Q1031547'?item != 'wd:Q3015041'?item != 'wd:Q28449604'?item != 'wd:Q1031594'?item != 'wd:Q1031594'?item != 'wd:Q3016361'?item != 'wd:Q7275582'?item != 'wd:Q1654943'?item != 'wd:Q3014320'?item != 'wd:Q5065943'?item != 'wd:Q3015462'?item != 'wd:Q1800390'?item != 'wd:Q784017'?item != 'wd:Q3271311'?item != 'wd:Q1498314'?item != 'wd:Q7199307'?item != 'wd:Q4651612'?item != 'wd:Q2828202'?item != 'wd:Q723474'?item != 'wd:Q1164127'?item != 'wd:Q174247'?item != 'wd:Q7275708'?item != 'wd:Q47465'?item != 'wd:Q47465'?item != 'wd:Q960480'?item != 'wd:Q2886509'?item != 'wd:Q980034'?item != 'wd:Q1780219'?item != 'wd:Q8190944'?item != 'wd:Q1513045'?item != 'wd:Q3298050'?item != 'wd:Q3271063'?item != 'wd:Q3234808'?item != 'wd:Q1940767'?item != 'wd:Q1520213'?item != 'wd:Q18157236'?item != 'wd:Q18157236'?item != 'wd:Q7944502'?item != 'wd:Q12694595'?item != 'wd:Q2625576'?item != 'wd:Q7940661'?item != 'wd:Q3014516'?item != 'wd:Q2318365'?item != 'wd:Q6694741'?item != 'wd:Q3696011'?item != 'wd:Q652085'?item != 'wd:Q8058641'?item != 'wd:Q8058641'?item != 'wd:Q1030442'?item != 'wd:Q1433506'?item != 'wd:Q1433636'"]]
f1 --> v4
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v4 -."wdt:P238".-> v3
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v4 -."wdt:P239".-> v5
end
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v4 -."wdt:P17".-> v1
end
subgraph optional3["(optional)"]
style optional3 fill:#bbf,stroke-dasharray: 5 5;
v4 -."wdt:P240".-> v8
end
subgraph optional4["(optional)"]
style optional4 fill:#bbf,stroke-dasharray: 5 5;
v4 -."wdt:P5699".-> v8
end
subgraph optional5["(optional)"]
style optional5 fill:#bbf,stroke-dasharray: 5 5;
v4 -."wdt:P5746".-> v8
end
subgraph optional6["(optional)"]
style optional6 fill:#bbf,stroke-dasharray: 5 5;
v4 -."wdt:P5851".-> v8
end
subgraph optional7["(optional)"]
style optional7 fill:#bbf,stroke-dasharray: 5 5;
v4 -."wdt:P6120".-> v8
end
subgraph optional8["(optional)"]
style optional8 fill:#bbf,stroke-dasharray: 5 5;
v4 -."wdt:P31".-> v7
end
subgraph minus2["MINUS"]
style minus2 stroke-width:6px,fill:pink,stroke:red;
v4 --"wdt:P576"--> a1
end
subgraph minus3["MINUS"]
style minus3 stroke-width:6px,fill:pink,stroke:red;
v4 --"wdt:P582"--> a2
end
subgraph minus4["MINUS"]
style minus4 stroke-width:6px,fill:pink,stroke:red;
v4 --"wdt:P31"--> a3
a3 --"wdt:P279"--> c247
end
subgraph minus5["MINUS"]
style minus5 stroke-width:6px,fill:pink,stroke:red;
v4 --"wdt:P31"--> a4
a4 --"wdt:P279"--> c248
end
subgraph minus6["MINUS"]
style minus6 stroke-width:6px,fill:pink,stroke:red;
v4 --"wdt:P31"--> a5
a5 --"wdt:P279"--> c249
end
subgraph minus7["MINUS"]
style minus7 stroke-width:6px,fill:pink,stroke:red;
v4 --"wdt:P31"--> a6
a6 --"wdt:P279"--> c250
end
subgraph minus8["MINUS"]
style minus8 stroke-width:6px,fill:pink,stroke:red;
v4 --"a"--> c252
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c254 --"wikibase:language"--> c256
end
bind10[/"sample(?Local_Code)"/]
v8 --o bind10
bind10 --as--o v8