Wikidata uses the property P3182 to add FANTOIR code to an entity.
From there, we can get two interesting information:
- the French label with rich typography
- the nature (P31 property) of the element, to identify "pseudo-voies" like metro station
How to query Wikidata?
We can query them with the following SPARQL request:
PREFIX bd: <http://www.bigdata.com/rdf#> PREFIX wikibase: <http://wikiba.se/ontology#> PREFIX wdt: <http://www.wikidata.org/prop/direct/> # Streets with FANTOIR code SELECT DISTINCT ?code_fantoir ?item ?itemLabel ?what WHERE { ?item wdt:P3182 ?code_fantoir . ?item wdt:P31 ?what SERVICE wikibase:label { bd:serviceParam wikibase:language "fr". } }
Plan
- query Wikidata from our FANTOIR import solution
- if a Wikidata entity has several values for P31, determine the most relevant one
- normalize FANTOIR code, as they are imported to Wikidata under several formats.
Example of dataset
As I've currently a small proof of concept, let's query our FANTOIR and Wikidata information:
SELECT f.code_fantoir, item_label, code_nature_voie, libelle_voie FROM fantoir_wikidata wd JOIN fantoir_202210 f on wd.code_fantoir = f.code_fantoir;
This returns this dataset: