Geoshapes, Wikimedia Commons, and the Early Modern Church of Scotland

Earlier this year, we published a blog post explaining how we mapped the ecclesiastical regions of early modern Scotland. We made the data available to view on our website and the resulting files can be downloaded from Github. In this follow-up post, I want to explain how we can broaden the audience of this geographic data even further by using Wikimedia Commons.

Jan Ainali and Albin Larsson recently showcased how users of Wikidata can query data in a way that highlights areas on a map, rather than just single points. An underused feature in Wikidata is the ability to include geoshapes stored in Wikidata Commons as properties in Wikidata items. A typical example of this functionality would be for Wikidata items showing for national parks in the UK:

Wikidata item Q15052206 – Brecon Beacons — showing both a coordinate location and a file path for a geoshape

The Wikidata property ‘geoshape’ (P3896) can link directly to a file stored in Wikimedia Commons. Here is the map of the Brecon Beacons:

Wikimedia Commons data source: geoshape for the Brecon Beacons

Rather than just showing a point on a map, the geoshape allows users to see precise boundaries of a certain area.

Following AInali and Larsson’s excellent tutorial, a quick SPARQL query can bring up all of the national parks in the UK, including other bits of data, like when they were established as national parks:

Output of Wikidata query for all national parks in the UK

Being able to link Wikidata and Wikimedia Commons, as well as being able to visualize areas as well as points in Wikidata, has a huge range of potential applications. For our purposes, I decided to upload to Wikimedia Commons all of the synod shape files we built earlier this year. The remainder of the post will detail some of the steps involved in that process.

I started by taking each geojson shapefiles that we had created earlier this year. These roughly mark out the different synod regions of the early modern Church of Scotland (minus Argyll). I then tidied these files using Mapster’s ‘Right Hand Rule’ tool, which brings the geojson into line with the format Wikimedia Commons will accept. You can then upload this into Wikimedia Commons using the data tool. Simply point your web browser to the page where you want to upload your data:

https://commons.wikimedia.org/wiki/Data:[insert your file name here].map

You can then click ‘create this page’ to add your data.

Creating a new data file on Wikimedia Commons

You can then create your data file, by pasting in the text from the geoJSON. Wikimedia Commons also demands that you add several lines to the geoJSON detailing the data source and copyright details. There is even a little debugger at the bottom left of the text panel to show you if there are any errors in your text:

The data entry panel in Wikimedia Commons. Note the debugging icons on the bottom left

Publishing the data will make it available, openly, to anyone on the internet. Also, Wikimedia Commons is clever enough to render your datafile into a shape overlaid on a map:

Wikimedia Commons displaying map data for the Synod of Perth and Stirling

Now this data is safely deposited on Wikimedia Commons, we can add a new property — ‘geoshape’ (P3896) — to our Wikidata entry for the Synod of Perth and Stirling. We populate this item with the file path shown on Wikimedia Commons:

Adding the Wikimedia Commons file path to the ‘geoshape’ property (P3896) on Wikidata

I repeated this process for all of the synod region shape files that we created earlier this year. I then modified the query that we built earlier: so rather than searching for national parks, we can now search for synod regions of the early modern Church of Scotland. Here is the result:

This takes the geoshapes we built earlier this year and makes them more widely available by contributing to Wikimedia Commons. And by linking these items to Wikidata, we can capture more information about ecclesiastical synod regions in the sixteenth and seventeenth centuries: making our queries more detailed and allowing for a new set of visualizations.

Perhaps more profoundly, this process shows how our commitment to open data enhances our project: any errors in the geoshape files can be corrected on Wikimedia Commons and further information about the synods can be added to each item on Wikidata (e.g. dates of establishment, names of moderators, changes in geographic scope, etc). And, finally, all of this stems from the supportive and open community around Wikimedia: building on the foundations of AInali, Larsson, and so many others.

Chris R. Langley

Newman University, Birmingham, UK