The Ordnance Survey have today published the first in a series of open datasets. In addition to the administrative geography that was published last year, the Linked Data available from data.ordnancesurvey.co.uk now includes data from their 1:50 000 Scale Gazetteer. In this blog post I thought I’d post an overview of the dataset to summarise what it contains.

Analysis

The Gazetteer identifiers all have a base URL of:

http://data.ordnancesurvey.co.uk/id/50kGazetteer/ .

The base URL is suffixed with a unique numeric code. I’m not sure where this originates from, and its not present in the underlying data.

The dataset consist of 2,368,655 triples (individual facts) asserted over 259,080 unique resources. So about 9 triples per resource. Here’s how the properties break down:

The first few properties are labels and a type for each resource. The additional predicates are from the OS Spatial Relations ontology, providing the Eastings and Northings for each feature. The remainining four predicates provide a “feature type” and OS map & grid references. There are slightly more map references, so some resources have more than one such property, i.e. because they’re large enough to span a particular map. You can see that there are no links to other datasets as yet, or lat/long co-ordinates.

Lets look closer at some of the predicates. For the RDF types, I discovered that the every resource has the same type, they’re all instances of a “Named Place”:

http://data.ordnancesurvey.co.uk/ontology/50kGazetteer/NamedPlace .

Presumably then the detailed classification for the different types of landscape feature is present in the “feature type” predicate. A SPARQL query to count and group the values for that predicate gives me:

We can see that 128,662 resources (49% of total) are simply “Other” with another 41,228 being “Other Settlement”; not that inspiring! The rest of the feature types are more interesting, and give us some very basic data on various geographic features. The Roman Antiquity features piqued my interested; Hadrian’s Wall has the following identifier (click to see the data):

http://data.ordnancesurvey.co.uk/id/50kGazetteer/106584

The values for the Easting and Northing properties should be obvious, so I’ll skip over those. The remaining properties are all map references, and the values of these are all resources. So the Gazetteer has begun assigning URIs to all of the 1KM and 20KM grid references, as well as each of OS LandRanger Maps. Here are some sample URLs for each, taken from the descripion of Hadrian’s Wall:

http://data.ordnancesurvey.co.uk/id/1kmgridsquare/NY3359

http://data.ordnancesurvey.co.uk/id/20kmgridsquare/NY24

http://data.ordnancesurvey.co.uk/id/OSLandrangerMap/85

The URIs seem predictable and can probably be derived from data found elsewhere. Unfortunately, no further data has been included about these resources. I believe they are place-holders for data that has yet to be released.

Overall the data in the Gazetteer is pretty sparse but presumably it will become much richer once more OS data is released. Latitude and longitudes is something that I’d particularly like to see added. There’s an opportunity here for someone to link up these resources with pages in Wikipedia & resources in DbPedia.

Sample Queries

If you want to play with the data, here are a couple of SPARQL queries to get you started. The first retrieves 10 features classified as Roman Antiquities

PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX spatial: <http://data.ordnancesurvey.co.uk/ontology/spatialrelations/> PREFIX gaz: <http://data.ordnancesurvey.co.uk/ontology/50kGazetteer/> SELECT ?uri ?label ?easting ?northing ?one ?twenty ?map WHERE { ?uri #filter on type gaz:featureType gaz:RomanAntiquity; #bind everything we want to return rdfs:label ?label; spatial:easting ?easting; spatial:northing ?northing; gaz:oneKMGridReference ?one; gaz:twentyKMGridReference ?twenty; gaz:mapReference ?map. } LIMIT 10

Results in JSON

The following query lists all of the features on a specific OS Landranger map. So even though we don’t (yet) have any details about the map, we can use its identifier as a means to filter the results:

PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX spatial: <http://data.ordnancesurvey.co.uk/ontology/spatialrelations/> PREFIX gaz: <http://data.ordnancesurvey.co.uk/ontology/50kGazetteer/> SELECT ?uri ?label ?easting ?northing ?featureType WHERE { ?uri #filter on map reference gaz:mapReference <http://data.ordnancesurvey.co.uk/id/OSLandrangerMap/85>; #bind everything we want to return rdfs:label ?label; spatial:easting ?easting; spatial:northing ?northing; gaz:featureType ?featureType. }

Results in JSON