User:Ayack/Cantons

TO DO edit

Nouveaux cantons edit

  1.   Done : Supprimer instance of (P31)canton of France (Q184188) sur tous les éléments ayant instance of (P31)canton of France (Q18524218)
  2.   Done : Supprimer toutes les inception (P571) différentes du 22/03/2015
  3.   Done : Vérifier qu'on ait country (P17)France (Q142) uniquement
  4.   Done : Modifier capital (P36) sur la base du COG 2015 avec start time (P580)22/03/2015
  5.   Done : Ajouter official name (P1448) sur la base du COG 2015 avec start time (P580)22/03/2015
  6.   Done : Ajouter inception (P571)22/03/2015
  7.   Done : Supprimer tous les located in the administrative territorial entity (P131)
  8.   Done : Ajouter located in the administrative territorial entity (P131) sur la base du COG 2015 avec start time (P580)22/03/2015 (département uniquement conformément au COG)
  9.   Done : Supprimer tous les coordinate location (P625)
  10. Ajouter coordinate location (P625) à partir de celles de la commune en capital (P36)
  11.   Done : Supprimer tous les contains the administrative territorial entity (P150)
  12. Ajouter contains the administrative territorial entity (P150) sur la base du COG 2015 avec start time (P580)22/03/2015 (ou pas vu que les cantons ne sont pas des divisions administratives...)
  13.   Doing… : Prendre en compte les changements apportés post-2015 : capital (P36), official name (P1448)

Communes edit

  1.   Done : Supprimer les canton of France (Q18524218) qui sont en located in the administrative territorial entity (P131) (prendre aussi en compte les anciennes communes)
  2.   Done : Ajouter les canton of France (Q18524218) en associated electoral district (P7938) sur la base du COG 2015 avec start time (P580)22/03/2015
  3.   Done : Ajouter les canton of France (Q18524218) en capital of (P1376) sur la base du COG 2015 avec start time (P580)22/03/2015

Anciens cantons edit

  1. Créer les canton of France (Q184188) manquants sur la base du COG 2014

Requêtes edit

Nouveaux cantons edit

SELECT ?item ?itemLabel WHERE {
  ?item p:P31/ps:P31 wd:Q18524218;
  MINUS { ?item p:P31/ps:P31 wd:Q184188. }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}

Try it!

Cantons "mixtes" edit

SELECT ?item ?itemLabel  WHERE {
  ?item p:P31/ps:P31 wd:Q18524218, wd:Q184188.
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}

Try it!

Anciens cantons edit

SELECT ?item ?itemLabel WHERE {
  ?item p:P31/ps:P31 wd:Q184188;
  MINUS { ?item p:P31/ps:P31 wd:Q18524218. }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}

Try it!


Cantons avec une date de création différente du 22/03/2015 edit

SELECT ?item ?itemLabel ?inception WHERE {
  ?item (p:P31/ps:P31) wd:Q18524218;
    wdt:P571 ?inception.
  FILTER(?inception != "2015-03-22T00:00:00Z"^^xsd:dateTime)
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}

Try it!

Cantons sans date de création edit

SELECT ?item ?itemLabel WHERE {
  ?item (p:P31/ps:P31) wd:Q18524218.
  MINUS { ?item wdt:P571 []. }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}

Try it!

Cantons avec une carte ne contenant pas "2015" edit

SELECT ?item ?itemLabel ?map WHERE {
  ?item (p:P31/ps:P31) wd:Q18524218;
    wdt:P242 ?map.
  FILTER(!(REGEX(STR(?map), "2015", "i")))
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}

Try it!

Cantons avec coordonnées du bureau centralisateur et référence edit

SELECT ?item ?itemLabel ?coord ?reference ?referenceLabel ?capitale ?capitaleLabel ?debut ?fin WHERE {
  ?item wdt:P31 wd:Q18524218; wdt:P36 ?capitale.
    ?capitale wdt:P625 ?coord.
  OPTIONAL {?item p:P36 [ ps:P36 ?capitale; pq:P580 ?debut].}
  OPTIONAL {?item p:P36 [ ps:P36 ?capitale; pq:P582 ?fin].}
  OPTIONAL {?capitale p:P625 [ ps:P625 ?coord; prov:wasDerivedFrom [ pr:P248 ?reference ] ] }.
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}

Try it!

Communes avec un nouveau canton (uniquement) en P131 edit

SELECT ?item ?itemLabel WHERE {
  ?item wdt:P31 wd:Q484170;
    p:P131/ps:P131 ?loc.
  ?loc wdt:P31 wd:Q18524218.
  MINUS { ?loc wdt:P31 wd:Q184188. }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}

Try it!

Départements edit

SELECT ?item ?itemLabel ?INSEE WHERE {
  ?item wdt:P31/wdt:P279* wd:Q6465;
    wdt:P2586 ?INSEE.
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}

Try it!

Arrondissements edit

SELECT ?item ?itemLabel ?debut ?fin ?INSEE WHERE {
  ?item wdt:P31/wdt:P279* wd:Q194203.
  OPTIONAL { ?item wdt:P571 ?debut. }
  OPTIONAL { ?item wdt:P576 ?fin. }
  OPTIONAL { ?item wdt:P3423 ?INSEE. }
  FILTER((!(BOUND(?debut))) || (?debut <= "2014-01-01T00:00:00Z"^^xsd:dateTime))
  FILTER((!(BOUND(?fin))) || (?fin > "2014-01-01T00:00:00Z"^^xsd:dateTime))
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}

Try it!

Communes actives au 01/01/2014 edit

SELECT DISTINCT ?commune ?communeLabel ?insee WHERE {
  ?commune p:P31 ?typeStatement.
  ?typeStatement (ps:P31/(wdt:P279*)) wd:Q484170.
  OPTIONAL { ?typeStatement pq:P582 ?fin. }
  FILTER((!(BOUND(?fin))) || (?fin > "2014-01-01T00:00:00Z"^^xsd:dateTime))
  ?commune p:P374 ?inseeStatement.
  ?inseeStatement ps:P374 ?insee.
  FILTER(NOT EXISTS { ?inseeStatement pq:P582 _:b12. })
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}

Try it!

Nouveaux bureaux centralisateurs edit

SELECT ?item ?itemLabel ?capitale ?fin ?newcomm ?debut WHERE {
  ?item wdt:P31 wd:Q18524218; wdt:P36 ?capitale.
  ?capitale p:P31 [ ps:P31 wd:Q484170 ; pq:P582 ?fin ] .
  ?capitale wdt:P1366 ?newcomm .
  ?newcomm p:P31 [ ps:P31/wdt:P279* wd:Q484170 ; pq:P580 ?debut ] .
  MINUS { ?item p:P131 [ ps:P131 ?capitale ; pq:P582 ?fin2 ] }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}

Try it!

Anciens cantons avec le même code INSEE edit

SELECT DISTINCT ?item1 ?item1Label ?debut1 ?fin1 ?item2 ?item2Label ?debut2 ?fin2 ?value WHERE {
  ?item1 wdt:P31 wd:Q184188;
    wdt:P2506 ?value.
  OPTIONAL { ?item1 wdt:P571 ?debut1. }
  OPTIONAL { ?item1 wdt:P576 ?fin1. }
  ?item2 wdt:P31 wd:Q184188;
    wdt:P2506 ?value.
  OPTIONAL { ?item2 wdt:P571 ?debut2. }
  OPTIONAL { ?item2 wdt:P576 ?fin2. }
  FILTER((?item1 != ?item2) && ((STR(?item1)) < (STR(?item2))))
  FILTER((!(BOUND(?debut1))) || (?debut1 <= "2014-01-01T00:00:00Z"^^xsd:dateTime))
  FILTER((!(BOUND(?fin1))) || (?fin1 > "2014-01-01T00:00:00Z"^^xsd:dateTime))
  FILTER((!(BOUND(?debut2))) || (?debut2 <= "2014-01-01T00:00:00Z"^^xsd:dateTime))
  FILTER((!(BOUND(?fin2))) || (?fin2 > "2014-01-01T00:00:00Z"^^xsd:dateTime))
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}

Try it!