The Mapbox geocoder has always been able to tell you where a place is. Today we’re adding Wikidata IDs to geocoding responses, unlocking the ability to answer other questions about a location.
The Wikidata project adds structure to data in Wikipedia, providing IDs and connections between them that work across all versions of Wikipedia. This makes it possible to extract information from a Wikipedia article in a reliable way. It also enables connections to other datasets outside of Wikipedia. Just like Wikipedia, anyone can edit Wikidata. You can find the Wikidata item link in any Wikipedia article sidebar. The resulting data is completely open.
You can find Wikidata IDs in the new wikidata entries of a response’s properties and context sections. We’ve added Wikidata IDs for all country and region features, as well as more than 22,000 place features in the U.S. and Canada.
Below is an example showing how our geocoder can be combined with a couple of SPARQL queries to display locations’ population, official websites, seals, and even some related movies. You can try these queries and explore building your own at the Wikidata Query Service.
This example is just for fun — the narrative location property isn’t among the most heavily-populated parts of Wikidata. But it forms a link to IMDb’s universe of identifiers, giving a glimpse of what’s possible when datasets are connected together. Integration with Wikidata means that Mapbox geocoding results can now be used to find capital cities, GDP, or even lists of famous people born nearby. The possibilities are endless. And if data is missing, anyone can add it, benefiting everyone. It’s open data at its best.