User:Ayack/Cantons
TO DO
editNouveaux cantons
edit- Done : Supprimer instance of (P31)canton of France (Q184188) sur tous les éléments ayant instance of (P31)canton of France (Q18524218)
- Done : Supprimer toutes les inception (P571) différentes du 22/03/2015
- Done : Vérifier qu'on ait country (P17)France (Q142) uniquement
- Done : Modifier capital (P36) sur la base du COG 2015 avec start time (P580)22/03/2015
- Done : Ajouter official name (P1448) sur la base du COG 2015 avec start time (P580)22/03/2015
- Done : Ajouter inception (P571)22/03/2015
- Done : Supprimer tous les located in the administrative territorial entity (P131)
- 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)
- Done : Supprimer tous les coordinate location (P625)
- Ajouter coordinate location (P625) à partir de celles de la commune en capital (P36)
- Done : Supprimer tous les contains the administrative territorial entity (P150)
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...)- Doing… : Prendre en compte les changements apportés post-2015 : capital (P36), official name (P1448)
Communes
edit- Done : Supprimer les canton of France (Q18524218) qui sont en located in the administrative territorial entity (P131) (prendre aussi en compte les anciennes communes)
- 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
- 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- Créer les canton of France (Q184188) manquants sur la base du COG 2014
Requêtes
editNouveaux cantons
edit- Items used: canton of France (Q18524218) , canton of France (Q184188)
- Properties used: instance of (P31)
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". }
}
Cantons "mixtes"
edit- Items used: canton of France (Q18524218) , canton of France (Q184188)
- Properties used: instance of (P31)
SELECT ?item ?itemLabel WHERE {
?item p:P31/ps:P31 wd:Q18524218, wd:Q184188.
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
Anciens cantons
edit- Items used: canton of France (Q184188) , canton of France (Q18524218)
- Properties used: instance of (P31)
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". }
}
Cantons avec une date de création différente du 22/03/2015
edit- Items used: canton of France (Q18524218)
- Properties used: inception (P571) , instance of (P31)
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". }
}
Cantons sans date de création
edit- Items used: canton of France (Q18524218)
- Properties used: inception (P571) , instance of (P31)
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". }
}
Cantons avec une carte ne contenant pas "2015"
edit- Items used: canton of France (Q18524218)
- Properties used: locator map image (P242) , instance of (P31)
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". }
}
Cantons avec coordonnées du bureau centralisateur et référence
edit- Items used: canton of France (Q18524218)
- Properties used: instance of (P31) , capital (P36) , coordinate location (P625) , stated in (P248) , start time (P580) , end time (P582)
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". }
}
Communes avec un nouveau canton (uniquement) en P131
edit- Properties used: instance of (P31) , located in the administrative territorial entity (P131)
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". }
}
Départements
edit- Items used: department of France (Q6465)
- Properties used: instance of (P31) , subclass of (P279) , INSEE department code (P2586)
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". }
}
Arrondissements
edit- Items used: arrondissement of France (Q194203)
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". }
}
Communes actives au 01/01/2014
edit- Items used: commune of France (Q484170)
- Properties used: subclass of (P279) , instance of (P31) , INSEE municipality code (P374) , end time (P582)
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". }
}
Nouveaux bureaux centralisateurs
edit- Items used: canton of France (Q18524218) , commune of France (Q484170)
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". }
}
Anciens cantons avec le même code INSEE
edit- Items used: canton of France (Q184188)
- Properties used: instance of (P31) , INSEE canton code (P2506) , inception (P571) , dissolved, abolished or demolished date (P576)
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". }
}