Google-refine-logo.svgThis user loves OpenRefine.
Wikidata WikiProject france.svgThis user is a member of the WikiProject France.
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

HarvestEdit

https://tools.wmflabs.org/pltools/harvesttemplates/share.php?action=savenew&siteid=ceb&project=wikipedia&namespace=0&property=131&template=geobox&parameter=region&addprefix=&removeprefix=&category=Mga%20tugpahanan%20sa%20Tinipong%20Bansa&depth=2&set=1&offset=0&limit=10000&wikisyntax=0&

Ontologie des aéroports/Airport ontology in WikidataEdit

Ontologie

String search elements without P31 P279Edit

SELECT DISTINCT ?item ?itemLabel 
WHERE {
  hint:Query hint:optimizer "None".
  SERVICE wikibase:mwapi {
    bd:serviceParam wikibase:api "Search";
                    wikibase:endpoint "www.wikidata.org";
                    mwapi:srsearch "siege -haswbstatement:P31 -haswbstatement:P279" .
    ?title wikibase:apiOutput mwapi:title.
  }
  BIND(IRI(CONCAT(STR(wd:), ?title)) AS ?item)
  #add any other requirements here
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}

Try it!

Fréquentation/Patronages of airportEdit

Fréquentations & patronages

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!

Airports in a countryEdit

Airports lists

Airports with a text search/codesEdit

Recherches d'aéroports par codes IATA, ICAO etc

Look after a/some specific Indian Railways code(s)Edit

SELECT distinct ?item ?itemLabel ?Indian ?natureLabel WHERE {
{?item wdt:P5696 ?Indian
VALUES ?Indian { "AMS" "BOO" }.} #item has a P5696 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!

Recherches géographiques/Geographical-GPS lookupsEdit

Recherches géographiques

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!

Airports not having a country setEdit

SELECT ?airport ?coords ?pays ?paysLabel WHERE {
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
?airport (wdt:P31/wdt:P279*) wd:Q62447.
  MINUS { ?airport wdt:P576 _:b2. }
  MINUS { ?airport wdt:P582 _:b3. }
  OPTIONAL { ?airport wdt:P625 ?coords. }
  OPTIONAL { ?airport wdt:P17 ?pays. }
  MINUS { ?airport wdt:P30 wd:Q51. }
FILTER(!BOUND(?pays))
}

Try it!

Aéroports triés par coordonnées dupliquéesEdit

SELECT ?item ?itemLabel ?coord1 ?coord2 ?distance ?rank1 ?rank2 WITH {
SELECT DISTINCT ?item ?coord1 ?coord2 ?rank1 ?rank2 WHERE {
    ?item  (wdt:P31/wdt:P279*) wd:Q62447.
    hint:Prior hint:gearing "forward".
    ?item p:P625 ?stat1 . ?stat1 ps:P625 ?coord1 . ?stat1 wikibase:rank ?rank1 . 
    ?item p:P625 ?stat2 . ?stat2 ps:P625 ?coord2 . ?stat2 wikibase:rank ?rank2 . 
    filter ( str(?stat1)  < str(?stat2) ) . # not the same
    filter ( str(?rank1)  = str(?rank2) ) . # are the same
} 
} AS %if WHERE {
  include %if
  BIND(geof:distance(?coord1, ?coord2) as ?distance)
  SERVICE wikibase:label { bd:serviceParam wikibase:language "da,en,[AUTO_LANGUAGE]". }
}
ORDER BY ?itemLabel

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

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!

FrontièresEdit

Frontières

Durée des sièges dans l'histoire v3Edit

PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>

select ?siège ?siègeLabel (sample(?whereLabel) as ?whereLabel2) ?start ?tp_end ?tv_end ?end ?days ?years ?_articleFR ?_articleEN {
SELECT ?siège ?siègeLabel ?whereLabel ?start ?tp_end ?tv_end ?end ?days ?years ?_articleFR ?_articleEN WHERE {
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
?siège wdt:P31 wd:Q188055.
OPTIONAL { ?siège wdt:P580 ?start. }
OPTIONAL { 
           ?siège p:P582/psv:P582 ?p582node. 
           ?p582node wikibase:timeValue ?tv_end .       # get the time value
           ?p582node wikibase:timePrecision ?tp_end .   # get the time precision
           BIND(
             IF(?tp_end=9,?tv_end + "P1Y"^^xsd:duration - "P1D"^^xsd:duration,# set end date to 31 December if time precision is "year" (9)
             IF(?tp_end=10,?tv_end + "P1M"^^xsd:duration - "P1D"^^xsd:duration,# set end date to 28th if time precision is "month" (10)
             ?tv_end))
              AS ?end).
         }
OPTIONAL { ?siège wdt:P276 ?where. } 
OPTIONAL { ?siège p:P2047/psn:P2047/wikibase:quantityAmount ?lengthNorm.}
BIND(COALESCE(?lengthNorm/86400,(?end - ?start+1)) as ?days)
BIND(?days/365.00 as ?years)
    OPTIONAL {
    ?_articleFR schema:about ?siège.
    ?_articleFR schema:isPartOf <https://fr.wikipedia.org/>.
    ?_articleEN schema:about ?siège.
    ?_articleEN schema:isPartOf <https://en.wikipedia.org/>.
  }
}
}
group by ?siège ?siègeLabel ?start ?tp_end ?tv_end ?end ?days ?years  ?_articleFR ?_articleEN
order by desc(?years) ?whereLabel2

Try it!

à faireEdit

SELECT DISTINCT ?item ?itemLabel 
WHERE {
  hint:Query hint:optimizer "None".
  SERVICE wikibase:mwapi {
    bd:serviceParam wikibase:api "Search";
                    wikibase:endpoint "www.wikidata.org";
                    mwapi:srsearch "airport -haswbstatement:P31 -haswbstatement:P279" .
    ?title wikibase:apiOutput mwapi:title. 
  }
  BIND(IRI(CONCAT(STR(wd:), ?title)) AS ?item)
  #add any other requirements here
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}

Try it!

à faire 2Edit

SELECT DISTINCT ?item ?itemLabel 
WHERE {
  hint:Query hint:optimizer "None".
  SERVICE wikibase:mwapi {
    bd:serviceParam wikibase:api "Search";
                    wikibase:endpoint "www.wikidata.org";
                    mwapi:srsearch "bataille -haswbstatement:P31 -haswbstatement:P279" .
    ?title wikibase:apiOutput mwapi:title. 
  }
  BIND(IRI(CONCAT(STR(wd:), ?title)) AS ?item)
  #add any other requirements here
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} order by ?itemLabel

Try it!

Colombie à faireEdit

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 WHERE {
  ?airport (wdt:P31/wdt:P279*) wd:Q62447.
  ?airport wdt:P17 wd:Q739 .
  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    { ?item wdt:P31/wdt:P279* wd:Q44665966.} # exclude  airports being build
  SERVICE wikibase:label { bd:serviceParam wikibase:language "fr,es,en,fr,[AUTO_LANGUAGE]". }
  OPTIONAL { ?airport wdt:P625  ?coord. }
  OPTIONAL { ?airport wdt:P239  ?ICAO. }
  OPTIONAL { ?airport wdt:P238  ?IATA.}
}
GROUP BY ?airport ?airportLabel ?ICAO ?IATA
ORDER BY ?coord

Try it!

Frontières à faireEdit

SELECT ?item ?itemLabel ?comprend ?comprendLabel ?pays ?paysLabel WHERE {
  ?item wdt:P31 wd:Q1292279.
  OPTIONAL { ?item wdt:P31 ?comprend. }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "fr". }
  OPTIONAL { ?item wdt:P17 ?pays. }
}

Try it!

Frontières 2 à faireEdit

SELECT ?item ?itemLabel ?qualifier ?qualifierLabel ?statutLabel ?pays ?paysLabel 
  WHERE {
   ?item p:P31 ?statut_statement .
   ?statut wdt:P279 wd:Q1292279 .
   ?statut_statement ps:P31 ?statut .
   OPTIONAL { ?item p:P31 [ pq:P642 ?qualifier ] }
   OPTIONAL { ?item wdt:P17 ?pays. }
   SERVICE wikibase:label { bd:serviceParam wikibase:language "fr". }
  }

Try it!

Frontières 3 à faireEdit

SELECT DISTINCT ?item ?itemLabel 
WHERE {
  hint:Query hint:optimizer "None".
  SERVICE wikibase:mwapi {
    bd:serviceParam wikibase:api "Search";
                    wikibase:endpoint "www.wikidata.org";
                    mwapi:srsearch "border -haswbstatement:P31 -haswbstatement:P279" .
    ?title wikibase:apiOutput mwapi:title.
  }
  BIND(IRI(CONCAT(STR(wd:), ?title)) AS ?item)
  #add any other requirements here
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}

Try it!

Gares indiennesEdit

SELECT ?item ?itemLabel ?Indian_Railways WHERE {
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
  ?item wdt:P31 wd:Q55488.
  ?item wdt:P17 wd:Q668.
  OPTIONAL { ?item wdt:P5696 ?Indian_Railways. }
    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
}

Try it!

Dédoublonnage gares indiennesEdit

SELECT DISTINCT ?item1 ?item1Label ?item2 ?item2Label ?value 
{
	?item1 wdt:P5696 ?value .
	?item2 wdt:P5696 ?value .
	FILTER( ?item1 != ?item2 && STR( ?item1 ) < STR( ?item2 ) ) .
	SERVICE wikibase:label { bd:serviceParam wikibase:language "fr,en" } .
}

Try it!

Dédoublonnage aérodromes prrrrtEdit

SELECT DISTINCT ?pays ?paysLabel ?item ?itemLabel ?itemDescription ?sitelink
WHERE {
?item (wdt:P31/wdt:P279*) wd:Q62447.
 optional{ ?item wdt:P17 ?pays}
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,ms". }
}

Try it!

Recteurs de Raguse/DubrovnikEdit

SELECT ?item ?itemLabel 
(MAX(year(?date)) AS ?datemax ) ?famille ?familleLabel WHERE {
  ?item p:P39 _:b13. 
  _:b13 ps:P39 wd:Q90265261; 
    pq:P585 ?date.
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE]". }
  OPTIONAL { ?item wdt:P53  ?famille. } 
}       
GROUP BY ?item ?itemLabel ?extraction  ?famille  ?familleLabel
order by ?datemax ?itemLabel ?familleLabel

Try it!

AmbassadesEdit