User:Bouzinac/Airports lists

All airports, sorted by countryEdit

PREFIX wdno: <http://www.wikidata.org/prop/novalue/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
SELECT DISTINCT ?airport ?airportLabel ?pays ?paysLabel (SAMPLE(?coord) AS ?coord) ?ICAO ?IATA (SAMPLE(?Local_Code) AS ?Local_Code) WHERE {
  ?airport (wdt:P31/wdt:P279*) wd:Q62447.
  MINUS { ?airport wdt:P576 _:b2. }                                # remove items with P576 (dissolved, abolished or demolished) as a main property
  MINUS { ?airport wdt:P582 _:b3. }                                # remove items with P582 (end date) as a main property
  MINUS { ?airport (wdt:P31/wdt:P279*) wd:Q695850. }               # exclude military airports
  MINUS { ?airport (wdt:P31/wdt:P279*) wd:Q1311670. }              # exclude railways stations
  MINUS { ?airport (wdt:P31/wdt:P279*) wd:Q7373622. }              # exclude Royal Air Force
  MINUS { ?airport (wdt:P31/wdt:P279*) wd:Q502074. }               # exclude héliports
  MINUS { ?airport wdt:P31/wdt:P279* wd:Q2265915.}                 # exclude vol à voile/gliders
  MINUS { ?airport (wdt:P31/wdt:P279*) wd:Q44665966. }             # exclude  airports being build
  MINUS { ?airport (wdt:P31/wdt:P279*) wd:Q782667. }               # exclude motorways where plane can land
  MINUS { ?airport a wdno:P17.}                                    # exclude airports that aren't physically based in a country
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en,fr,[AUTO_LANGUAGE]". }
  OPTIONAL { ?airport wdt:P625  ?coord. }
  OPTIONAL { ?airport wdt:P239  ?ICAO. }
  OPTIONAL { ?airport wdt:P238  ?IATA. }
  optional { ?airport wdt:P17   ?pays.}
  OPTIONAL { ?airport wdt:P240  ?Local_Code. }
  OPTIONAL { ?airport wdt:P5699 ?Local_Code. }
  OPTIONAL { ?airport wdt:P5746 ?Local_Code. }
  OPTIONAL { ?airport wdt:P5851 ?Local_Code. }
  OPTIONAL { ?airport wdt:P6120 ?Local_Code. }
}
GROUP BY ?airport ?airportLabel ?ICAO ?IATA ?pays ?paysLabel
ORDER BY ?paysLabel ?coord

Try it!

Airports in a countryEdit

PREFIX wdno: <http://www.wikidata.org/prop/novalue/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
SELECT DISTINCT ?airport ?airportLabel (SAMPLE(?coord) AS ?coord) ?ICAO ?IATA (SAMPLE(?Local_Code) AS ?Local_Code) WHERE {
  ?airport (wdt:P31/wdt:P279*) wd:Q62447.
  ?airport wdt:P17 wd:Q414.
  MINUS { ?airport wdt:P576 _:b2. }                                # remove items with P576 (dissolved, abolished or demolished) as a main property
  MINUS { ?airport wdt:P582 _:b3. }                                # remove items with P582 (end date) as a main property
  MINUS { ?airport (wdt:P31/wdt:P279*) wd:Q1311670. }              # exclude railways stations
  MINUS { ?airport (wdt:P31/wdt:P279*) wd:Q7373622. }              # exclude Royal Air Force
  MINUS { ?airport (wdt:P31/wdt:P279*) wd:Q502074. }               # exclude héliports
  MINUS { ?airport wdt:P31/wdt:P279* wd:Q2265915.}                 # exclude vol à voile/gliders
  MINUS { ?airport (wdt:P31/wdt:P279*) wd:Q44665966. }             # exclude  airports being build
  MINUS { ?airport (wdt:P31/wdt:P279*) wd:Q782667. }               # exclude motorways where plane can land
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en,fr,[AUTO_LANGUAGE]". }
  OPTIONAL { ?airport wdt:P625  ?coord. }
  OPTIONAL { ?airport wdt:P239  ?ICAO. }
  OPTIONAL { ?airport wdt:P238  ?IATA. }
  OPTIONAL { ?airport wdt:P240  ?Local_Code. }
  OPTIONAL { ?airport wdt:P5699 ?Local_Code. }
  OPTIONAL { ?airport wdt:P5746 ?Local_Code. }
  OPTIONAL { ?airport wdt:P5851 ?Local_Code. }
  OPTIONAL { ?airport wdt:P6120 ?Local_Code. }
}
GROUP BY ?airport ?airportLabel ?ICAO ?IATA
ORDER BY ?coord

Try it!

Airports in the USEdit

PREFIX wdno: <http://www.wikidata.org/prop/novalue/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>

#  MINUS { ?airport (wdt:P31/wdt:P279*) wd:Q695850. }               # exclude military airports
SELECT DISTINCT ?localisation_administrativeLabel ?airport ?airportLabel (SAMPLE(?coord) AS ?coord) ?ICAO ?IATA (SAMPLE(?Local_Code) AS ?Local_Code)  WHERE {
  ?airport (wdt:P31/wdt:P279*) wd:Q62447.
  ?airport wdt:P17 wd:Q30.
  MINUS { ?airport wdt:P576 _:b2. }
  MINUS { ?airport wdt:P582 _:b3. }
  MINUS { ?airport (wdt:P31/wdt:P279*) wd:Q1311670. }
  MINUS { ?airport (wdt:P31/wdt:P279*) wd:Q7373622. }
  MINUS { ?airport (wdt:P31/wdt:P279*) wd:Q502074. }
  MINUS { ?airport (wdt:P31/wdt:P279*) wd:Q2265915. }
  MINUS { ?airport (wdt:P31/wdt:P279*) wd:Q44665966. }
  MINUS { ?airport (wdt:P31/wdt:P279*) wd:Q782667. }
  MINUS { ?airport rdf:type wdno:P17. }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en,fr,[AUTO_LANGUAGE]". }
  OPTIONAL { ?airport wdt:P625 ?coord. }
  OPTIONAL { ?airport wdt:P239 ?ICAO. }
  OPTIONAL { ?airport wdt:P238 ?IATA. }
  OPTIONAL { ?airport wdt:P240 ?Local_Code. }
  OPTIONAL {
    ?airport wdt:P131* ?localisation_administrative.
    ?localisation_administrative wdt:P31 ?type.
    ?type wdt:P279 wd:Q35657.
  }
}
GROUP BY ?airport ?airportLabel ?ICAO ?IATA ?localisation_administrative ?localisation_administrativeLabel
ORDER BY ?coord

Try it!

Military airbases in SKoreaEdit

#defaultView:Map
SELECT ?base_a_rienne_militaire ?base_a_rienne_militaireLabel ?coordonn_es_g_ographiques WHERE {
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" . }
  ?base_a_rienne_militaire wdt:P31 wd:Q695850 . 
  ?base_a_rienne_militaire wdt:P17  ?pays
  VALUES ?pays { wd:Q884 wd:Q423 } 
  OPTIONAL { ?base_a_rienne_militaire wdt:P625 ?coordonn_es_g_ographiques.  }
}

Try it!