User:Bouzinac/Histoire

Number of countries in the history edit

https://w.wiki/5w8f

Military battles edit

https://w.wiki/3H3J (qualité des données pauvre)

riots edit

https://w.wiki/5w8d

Durée des sièges dans l'histoire v3 edit

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!

à faire edit

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 2 edit

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!

Déclarations de guerres edit

https://w.wiki/6mZm

Guerres à faire edit

https://w.wiki/dEY

Coups d'États edit

SELECT DISTINCT ?coup_d__tat ?coup_d__tatLabel ?date ?pays ?paysLabel WHERE {
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
  ?coup_d__tat wdt:P31/wdt:P279* wd:Q45382.
  OPTIONAL { ?coup_d__tat wdt:P585 ?date. }
  OPTIONAL { ?coup_d__tat wdt:P17 ?pays. }
}order by ?date
Try it!

Gunshots by the nazis edit

https://w.wiki/3FHa