query-1c48090c7bf8ac7572af32b7a1624b89
:, thank you, I finally ended up working this query under Chrome (not executable on Edge {{Emoji|U+1F644}})TagishsimonHi @Whole functionning (in Chrome) code :
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 ?FAA ?tc_cad ?DGAC ?russ
WHERE {
OPTIONAL { ?item wdt:P238 ?IATA. }
OPTIONAL { ?item wdt:P239 ?ICAO. }
OPTIONAL { ?item wdt:P17 ?country. }
OPTIONAL { ?item wdt:P240 ?FAA. }
OPTIONAL { ?item wdt:P5699 ?tc_cad.}
OPTIONAL { ?item wdt:P5746 ?DGAC.}
OPTIONAL { ?item wdt:P5851 ?russ. }
OPTIONAL { ?item wdt:P31 ?nature. }
MINUS { ?item wdt:P576 [].} # remove items with P576 (dissolved, abolished or demolished) 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
MINUS { ?item wdt:P582 [].} # remove items with P582 (end date) as a main property
MINUS { ?item a wdno:P17.} #exclude airports that aren't physically based in a country
FILTER( ?item not in
(wd:Q60972, 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)
)#Exclude military airports sharing same IATA code
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". }
}
ORDER BY ?country ?natureLabel
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v8("?DGAC"):::projected
v6("?FAA"):::projected
v3("?IATA"):::projected
v5("?ICAO"):::projected
v1("?country")
v4("?item"):::projected
v10("?nature")
v2("?natureLabel"):::projected
v9("?russ"):::projected
v7("?tc_cad"):::projected
a1((" "))
a5((" "))
a2((" "))
a3((" "))
a4((" "))
c150(["wd:Q2265915"]):::iri
c155(["bd:serviceParam"]):::iri
c157(["fr,en"]):::literal
c149(["wd:Q44665966"]):::iri
c153(["wdno:P17"]):::iri
c148(["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: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'"]]
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".-> v6
end
subgraph optional4["(optional)"]
style optional4 fill:#bbf,stroke-dasharray: 5 5;
v4 -."wdt:P5699".-> v7
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".-> v9
end
subgraph optional7["(optional)"]
style optional7 fill:#bbf,stroke-dasharray: 5 5;
v4 -."wdt:P31".-> v10
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:P31"--> a2
a2 --"wdt:P279"--> c148
end
subgraph minus4["MINUS"]
style minus4 stroke-width:6px,fill:pink,stroke:red;
v4 --"wdt:P31"--> a3
a3 --"wdt:P279"--> c149
end
subgraph minus5["MINUS"]
style minus5 stroke-width:6px,fill:pink,stroke:red;
v4 --"wdt:P31"--> a4
a4 --"wdt:P279"--> c150
end
subgraph minus6["MINUS"]
style minus6 stroke-width:6px,fill:pink,stroke:red;
v4 --"wdt:P582"--> a5
end
subgraph minus7["MINUS"]
style minus7 stroke-width:6px,fill:pink,stroke:red;
v4 --"a"--> c153
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c155 --"wikibase:language"--> c157
end