User:Bouzinac/Pays

List of countries + nature + time edit

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!

autre liste à nettoyer edit

SELECT distinct ?item ?itemLabel ?itemdesc ?creat  ?dissolution  WHERE {
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
  ?item wdt:P31/wdt:P279* wd:Q3024240.
  OPTIONAL { ?item wdt:P571 ?creat. }
  OPTIONAL { ?item wdt:P576 ?dissolution. }
  ?item schema:description ?itemdesc .
  FILTER((LANG(?itemdesc)) = "fr")
} order by ?creat
Try it!

nouvelle liste des 2800 à nettoyer edit

SELECT distinct ?item ?itemLabel ?itemdesc_fr ?itemdesc_en ?creat  ?dissolution  WHERE {
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en,fr". }
#  values ?item {wd:Q101104073}
  ?item wdt:P31/wdt:P279* wd:Q3024240.
MINUS { ?item (wdt:P31/wdt:P279*) wd:Q1790360. } #empires coloniaux
MINUS { ?item (wdt:P31/wdt:P279*) wd:Q1371288. } #états vassals
MINUS { ?item (wdt:P31/wdt:P279*) wd:Q21512251. } #états autoproclamés
MINUS { ?item (wdt:P31/wdt:P279*) wd:Q1642488. } #chefferies
  OPTIONAL { ?item wdt:P571 ?creat. }
  OPTIONAL { ?item wdt:P576 ?dissolution. }
  FILTER (!bound(?dissolution))
  OPTIONAL {?item schema:description ?itemdesc_fr . FILTER((LANG(?itemdesc_fr)) = "fr") BIND (TRUE as ?true) }
  OPTIONAL {?item schema:description ?itemdesc_en . FILTER((LANG(?itemdesc_en)) = "en") BIND (TRUE as ?true) }
  OPTIONAL { FILTER NOT EXISTS {?item schema:description ?itemdesc .} BIND (TRUE as ?true)}
  filter(BOUND(?true))
} order by ?creat
Try it!

Spanish taifas edit

SELECT ?ta_fa ?ta_faLabel ?date_de_fondation_ou_de_cr_ation ?capitale ?capitaleLabel ?partie_de ?partie_deLabel WHERE {
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
  ?ta_fa wdt:P31 wd:Q217177.
  OPTIONAL { ?ta_fa wdt:P571 ?date_de_fondation_ou_de_cr_ation. }
  OPTIONAL { ?ta_fa wdt:P36 ?capitale. }
  OPTIONAL { ?ta_fa wdt:P361 ?partie_de. } 
}
Try it!