Open albertvillanova opened 4 years ago
These 2 cantons changed its INSEE code in 2015:
Current implementation of the script to get the INSEE code:
TODO:
There are 4 cantons with multiple INSEE codes:
# Cantons with INSEE code with end_time
SELECT ?item ?label_ca ?label_fr ?insee_end_time_date ?insee_code
WHERE {
?item p:P31 ?st . # instance_of
?st ps:P31 wd:Q18524218 . # canton_of_france_from_2015 # Q484170 . # commune_of_france
OPTIONAL{?st pq:P580 ?start_time_date}
FILTER(IF(BOUND(?start_time_date), ?start_time_date <= "2019-01-01"^^xsd:dateTime, true))
OPTIONAL{?st pq:P582 ?end_time_date}
FILTER(IF(BOUND(?end_time_date), ?end_time_date > "2019-01-01"^^xsd:dateTime, true))
?item p:P2506 ?st_insee . # insee_canton_code
?st_insee ps:P2506 ?insee_code .
?st_insee pq:P582 ?insee_end_time_date
OPTIONAL{ ?item rdfs:label ?label_ca filter (lang(?label_ca) = "ca"). }
OPTIONAL{ ?item rdfs:label ?label_fr filter (lang(?label_fr) = "fr"). }
}
LIMIT 10
There are cantons with multiple INSEE codes without end_time:
As first solution, I have updated current INSEE code rank to preferred.
While adding population to cantons, 2 of them gave error:
due to the fact that these 2 cantons have multiple INSEE codes.