Open main menu

Bouzinac

Joined 11 March 2015
Google-refine-logo.svgThis user loves OpenRefine.
Babel user information
en-5 This user has professional knowledge of English.
fr-N Cet utilisateur a pour langue maternelle le français.
de-2 Dieser Benutzer beherrscht Deutsch auf fortgeschrittenem Niveau.
es-0 Este usuario no tiene ningún conocimiento del español (o lo entiende con mucha dificultad).
it-0 Questo utente non è in grado di comunicare in italiano (o lo capisce solo con notevole difficoltà).
br-0 Ne oar an implijer-mañ tamm Brezhoneg ebet (pe en deus mil boan o kompren anezhañ).
Users by language

Contents

Ontologie des aéroports/Airport ontology in WikidataEdit

SELECT ?class ?classLabel (SAMPLE(?item) AS ?sample) WHERE {
  ?class wdt:P279+ wd:Q62447.
  OPTIONAL { ?item wdt:P31 ?class. }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
GROUP BY ?class ?classLabel

Try it!

Fréquentation/Patronage of (x) airport(s)Edit

SELECT ?item ?itemLabel ?year
(sample(?number) as ?number)
WHERE {
 values ?item {wd:Q17430 wd:Q642313 wd:Q17431} .
 ?item p:P3872 ?statement.
 ?statement pq:P585 ?time.
 ?statement ps:P3872 ?number.
 bind (YEAR(?time) AS ?year)
 FILTER(?year>=1979) .
 SERVICE wikibase:label { bd:serviceParam wikibase:language "fr". }
 MINUS { ?statement wikibase:rank wikibase:DeprecatedRank }
} group by ?year ?item ?itemLabel
order by ?item desc (?year)

Try it!

Fréquentation/Patronage of (x) airport(s) in a countryEdit

SELECT ?item ?itemLabel ?year
(sample(?number) as ?number)
WHERE {
 values ?item {wd:Q17430 wd:Q642313 wd:Q17431} .
 ?item p:P3872 ?statement.
 ?statement pq:P585 ?time.
 ?statement ps:P3872 ?number.
 bind (YEAR(?time) AS ?year)
 FILTER(?year>=1979) .
 SERVICE wikibase:label { bd:serviceParam wikibase:language "fr". }
 MINUS { ?statement wikibase:rank wikibase:DeprecatedRank }
} group by ?year ?item ?itemLabel
order by ?item desc (?year)

Try it!

Fréquentation/patronage of (x) airports with international ,domestic, total statEdit

SELECT ?item ?itemLabel ?year ?whereLabel
(sample(?number) as ?number)
WHERE {
 values ?item {wd:Q1049719} .
 ?item p:P3872 ?statement.
 ?statement pq:P585 ?time.
 ?statement pq:P518 ?where.
 ?statement ps:P3872 ?number.
 bind (YEAR(?time) AS ?year)
 FILTER(?year>=1979) .
 SERVICE wikibase:label { bd:serviceParam wikibase:language "fr". }
 MINUS { ?statement wikibase:rank wikibase:DeprecatedRank }
} group by ?year ?item ?itemLabel ?where ?whereLabel
order by ?item desc (?year)

Try it!

Fréquentation/patronage of (x) airports with only total passenger statEdit

SELECT ?item ?itemLabel ?year ?where
(sample(?number) as ?number)
WHERE {
 values ?item {wd:Q1049719} .
 ?item p:P3872 ?statement.
 ?statement pq:P585 ?time.
 ?statement pq:P518 ?where.
 ?statement ps:P3872 ?number.
 bind (YEAR(?time) AS ?year)
 FILTER(?year>=1979) .
 filter(?where= wd:Q2165236).
 SERVICE wikibase:label { bd:serviceParam wikibase:language "fr". }
 MINUS { ?statement wikibase:rank wikibase:DeprecatedRank }
} group by ?year ?item ?itemLabel ?where ?whereLabel
order by ?item desc (?year)

Try it!

Fréquentation patronage of x airports that have data for 2017 but not 2018Edit

SELECT ?item ?itemLabel ?pays ?paysLabel (SUM(?number) AS ?numbers) WHERE {
  ?item wdt:P31 wd:Q1248784;
    p:P3872 ?statement.
  ?statement pq:P585 ?value.
   ?statement ps:P3872 ?number.
  FILTER(("2016-12-31"^^xsd:dateTime < ?value) && ("2018-00-00"^^xsd:dateTime > ?value))
  MINUS {
    ?item p:P3872 ?statement2.
    ?statement2 pq:P585 ?value2.
    FILTER(("2017-12-31"^^xsd:dateTime < ?value2) && ("2019-00-00"^^xsd:dateTime > ?value2))
  }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
  OPTIONAL { ?item wdt:P17 ?pays. }
}
GROUP BY ?item ?itemLabel ?pays ?paysLabel
ORDER BY DESC(?numbers)

Try it!

Whole wiki items that have an airport IATA/ICAO/FAA/DGAC/TC_LID codeEdit

Better in Chrome navigator

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

Try it!

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: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: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!

Dédoublonnage USAEdit

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

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: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!

Airports in a country with a text searchEdit

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: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: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. }
FILTER(CONTAINS(LCASE(?airportLabel ), "keyword"))
}
GROUP BY ?airport ?airportLabel ?ICAO ?IATA
ORDER BY ?coord

Try it!

Look after a/some specific IATA code(s)Edit

SELECT distinct ?item ?itemLabel ?natureLabel WHERE {
{?item wdt:P238 ?IATA
VALUES ?IATA { "AMS" "BOO" }.} #item has a P238 value   
  OPTIONAL { ?item wdt:P31 ?nature. }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" } . #this bit gets labels for Qid values
}

Try it!

Look after a/some specific ICAO code(s)Edit

SELECT distinct ?item ?itemLabel ?natureLabel WHERE {
{?item wdt:P239 ?ICAO 
VALUES ?ICAO { "HKKG" }.} #item has a P239 value  
OPTIONAL { ?item wdt:P31 ?nature. }
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" } . #this bit gets labels for Qid values
}

Try it!

Look after a/some specific FAA (USA) code(s)Edit

SELECT distinct ?item ?itemLabel ?natureLabel WHERE {
{?item wdt:P240 ?FAA_LID
VALUES ?FAA_LID { "00AK" }.} #item has a P239 value   
 OPTIONAL { ?item wdt:P31 ?nature. }
 SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" } . #this bit gets labels for Qid values
}

Try it!

Check wiki airport element having neither IATA nor ICAO nor FAA LIDEdit

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. })

  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:P576 [].} # remove items with P576 (dissolved, abolished or demolished) as a main property
  MINUS {?airport wdt:P582 [].} # 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: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

Try it!

List all elements close to a wikielementEdit

Add #defaultView:Map pour avoir la carte

SELECT ?place ?placeLabel ?location ?instanceLabel ?dist WHERE {
  wd:Q7901873 wdt:P625 ?loc .
  SERVICE wikibase:around {
      ?place wdt:P625 ?location .
      bd:serviceParam wikibase:center ?loc .
      bd:serviceParam wikibase:radius 10 . # in kilometers
  }
  OPTIONAL { 
    ?place wdt:P31 ?instance .
  }
  SERVICE wikibase:label { bd:serviceParam wikibase:language 'en' }
  BIND(geof:distance(?loc, ?location) AS ?dist) .
} ORDER BY ASC(?dist)

Try it!

List of airports poorly filledEdit

#item has no P31, search term may occur anywhere in the item record
SELECT DISTINCT ?item ?itemLabel ?itemDescription ?sitelink
WHERE {
?item (wdt:P31/wdt:P279*) wd:Q62447.
MINUS { ?item wdt:P625 ?coord. }
    MINUS { ?item wdt:P576 _:b2. }                                # remove items with P576 (dissolved, abolished or demolished) as a main property
  MINUS { ?item wdt:P582 _:b3. }                                # remove items with P582 (end date) as a main property
  MINUS { ?item (wdt:P31/wdt:P279*) wd:Q695850. }               # exclude military airports
  MINUS { ?item (wdt:P31/wdt:P279*) wd:Q1311670. }              # exclude railways stations
  MINUS { ?item (wdt:P31/wdt:P279*) wd:Q7373622. }              # exclude Royal Air Force
  MINUS { ?item (wdt:P31/wdt:P279*) wd:Q502074. }               # exclude héliports
  MINUS { ?item wdt:P31/wdt:P279* wd:Q2265915.}                 # exclude vol à voile/gliders
  MINUS { ?item (wdt:P31/wdt:P279*) wd:Q44665966. }             # exclude  airports being build
  MINUS { ?item (wdt:P31/wdt:P279*) wd:Q782667. }               # exclude motorways where plane can land
  MINUS { ?item a wdno:P17.}                                    # exclude airports that aren't physically based in a country
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}

Try it!

List all wiki elements without country but with coordinates, close to a geographic center of a countryEdit

#defaultView:List
SELECT ?place ?placeLabel ?location
WHERE
{
wd:Q940798 wdt:P625 ?centerLoc .
SERVICE wikibase:around {
?place wdt:P625 ?location .
bd:serviceParam wikibase:center ?centerLoc .
bd:serviceParam wikibase:radius "250" .
} .
MINUS { ?place wdt:P17 wd:Q142 }
SERVICE wikibase:label {
bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" .
} 
}

Try it!

Number of countries in the historyEdit

select ?bound (count(?country) as ?count)
with {
 select ?country {
 ?country wdt:P31/wdt:P279* wd:Q3624078 # sovereign states, I don’t know if it’s the right item
 } 
}as %countries
with
{
 select distinct ?bound {
 ?country (wdt:P571|wdt:P576) ?bound. 
 include %countries .
 filter (year(?bound) > 1800)
 }
} as %bounds
where {
 include %bounds .
 include %countries .
 ?country wdt:P571 ?creation .
 optional { ?country wdt:P576 ?dest_maybe . }
 bind (coalesce(?dest_maybe, now()) as ?destruction)
 filter ( ?creation <= ?bound  && ?destruction > ?bound )
} group by ?bound order by ?bound

Try it!

List of countries + nature + timeEdit

select distinct ?country (group_concat(?NatureLabelFr;separator=", ") as ?NatureLabelFr) ?countryLabel  ?creationDate ?dissolutionDate
with {
select ?country (coalesce(?countryLabelFr, ?countryLabelEn,  ?country) as ?countryLabel) ?creationDate ?dissolutionDate{
VALUES ?what { 
               wd:Q3624078 # sovereign states, I don’t know if it’s the right item
               wd:Q3024240 # états historiques
             }
?country wdt:P31/wdt:P279* ?what . 
MINUS { ?country (wdt:P31/wdt:P279*) wd:Q1790360. } #empires coloniaux
MINUS { ?country (wdt:P31/wdt:P279*) wd:Q1371288. } #états vassals
MINUS { ?country (wdt:P31/wdt:P279*) wd:Q21512251. } #états autoproclamés
MINUS { ?country (wdt:P31/wdt:P279*) wd:Q1642488. } #chefferies
optional { ?country rdfs:label ?countryLabelFr filter(lang(?countryLabelFr)= "fr")} .
optional { ?country rdfs:label ?countryLabelEn filter(lang(?countryLabelEn)= "en")}
optional { ?country wdt:P571 ?creationDate }
optional { ?country wdt:P576 ?dissolutionDate }
} order by ?countryLabel
} as %datas
where {
include %datas .
optional{
?country wdt:P31/rdfs:label ?NatureLabelFr filter(lang(?NatureLabelFr)= "fr") .
}
} group by ?country ?countryLabel  ?creationDate ?dissolutionDate

Try it!