Dataset Ordnance Survey
Published 7th March 2011
Updated 15th March 2012
Resources 2017980

Ordnance Survey is Great Britain's national mapping agency, providing the most accurate and up-to-date geographic data, relied on by government, business and individuals.

OS OpenData is the opening up of Ordnance Survey data as part of the drive to increase innovation and support the "Making Public Data Public" initiative. As part of this initiative Ordnance Survey has published a number of its products as Linked Data. Linked Data is a growing part of the Web where data is published on the Web and then linked to other published data in much the same way that web pages are interlinked using hypertext. The term Linked Data is used to describe a method of exposing, sharing, and connecting data via URIs on the Web.

To find more Linked Data published as part of this initiative please go to data.gov.uk . If you are not familiar with Linked Data, OS OpenData products are also available in alternative formats from the OS OpenData website. Ordnance Survey can provide support for the Ordnance Survey OpenData products, but cannot give advice or support on using RDF, SPARQL or SPARQL Endpoints. Ordnance Survey has published three separate linked data resources: the 1:50 000 Scale Gazetteer, Code-Point Open and the administrative geography gazetteer for Great Britain.

Explore the dataset
Default APIs

SPARQL Endpoint

Use the SPARQL 1.1 query language to perform structured queries against a dataset. Useful for performing precise queries against a dataset whose structure you understand.

Sample queries

The following query will return all of the unitary authorities and their names.

Query: 
select ?a ?name where { ?a a <http://data.ordnancesurvey.co.uk/ontology/admingeo/UnitaryAuthority> . ?a <http://www.w3.org/2004/02/skos/core#prefLabel> ?name .}
Login to test this query using our experimental API explorer Permalink to this sample query

Find me a list of all the administrative counties and their names.

Query: 
select ?a ?name where { ?a a <http://data.ordnancesurvey.co.uk/ontology/admingeo/County> . ?a <http://www.w3.org/2004/02/skos/core#prefLabel> ?name .}
Login to test this query using our experimental API explorer Permalink to this sample query
22nd Feb 2012

postcode

Query: 
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> SELECT * WHERE { ?s <http://data.ordnancesurvey.co.uk/ontology/postcode/postcode> ?o } LIMIT 10
Login to test this query using our experimental API explorer Permalink to this sample query
Create a sample query

Search API

Perform a free-text search against the text fields indexed in a dataset. Useful when you want to quickly query a dataset but don't know, or need to know its structure. There is also a solr search endpoint allowing more complex queries.

Lookup API

Retrieve a description of a single resource. Useful for fetching the key properties and relationships of a single entity.

Reconciliation API

Useful for resolving names, labels or codes against a dataset in Kasabi to find links to more data. This API is compatible with the Google Refine tool.

How to Attribute This Dataset

Kasabi provides a quick and easy way to attribute a dataset from any webpage. We think attribution is an important community norm.

To directly embed an attribution message in a webpage, add a script tag that invokes our Attribution API as follows

<script
     type="text/javascript"
     src="http://api.kasabi.com/dataset/ordnance-survey-linked-data/attribution">
</script>

If you need more flexible options, then read the Attribution API documentation

Contributed APIs

Bind a SPARQL 1.1 query to a parameterised URL to create a simple way to request results of a query. Custom formats can be added by applying XSLT stylesheets. Useful for creating custom APIs against datasets.

View configuration, subscription and access details

Bind a SPARQL 1.1 query to a parameterised URL to create a simple way to request results of a query. Custom formats can be added by applying XSLT stylesheets. Useful for creating custom APIs against datasets.

View configuration, subscription and access details

Select postcode by district (where district is any of unitary authority, district, metropolitan district, London Borough) or ward.

Example API call:

http://api.kasabi.com/api/ordnance-survey-postcode-region?district=7000000000037256&apikey=yourkey

Postcode as KML:

 

http://api.kasabi.com/api/ordnance-survey-postcode-region?district=7000000000037256&apikey=yourkey&output=kml

Remember default limit is set so add a &limit=100 (or whatever) on the end to get more...

 

View configuration, subscription and access details

A stored SPARQL query similar to http://beta.kasabi.com/api/ordnance-survey-get-region-type but this time SPARQL JSON or XML are returned.

View configuration, subscription and access details

This API allows a user to perform spatial queries using a simple API. This API returns an RDF document containing the results.

Example calls:

http://api.kasabi.com/api/ordnance-survey-spatial-slice?id=7000000000037256&spatialrelation=touches&apikey=yourkey

http://api.kasabi.com/api/ordnance-survey-spatial-slice?id=7000000000037256&spatialrelation=touches&type=District&apikey=yourkey

http://api.kasabi.com/api/ordnance-survey-spatial-slice?id=7000000000037256&spatialrelation=contains&apikey=yourkey

http://api.kasabi.com/api/ordnance-survey-spatial-slice?id=7000000000037256&spatialrelation=contains&type=UnitaryAuthorityWard&apikey=yourkey

Remember the default limit is 10 results so you may need to add an &limit=50 (or however many) to get a full set.

 

View configuration, subscription and access details

Similar to http://beta.kasabi.com/api/ordnance-survey-spatial-slice but SPARQL JSON/XML is returned.

View configuration, subscription and access details

A stored SPARQL query that returns an RDF document of regions and their names according to type specified in the API. An example API call would be:

http://api.kasabi.com/api/ordnance-survey-get-region-type?type=County&apikey=yourkey

Note that Kasabi automatically applies a limit of 10 answer so in many cases you'll need to change that in the API called to get a full list e.g:

http://api.kasabi.com/api/ordnance-survey-get-region-type?type=County&apikey=yourkey&limit=100

View configuration, subscription and access details

Returns the lat/long of the postcode, plus the ward, district, county, and country (with labels).

Urls are of the form: http://api.kasabi.com/dataset/ordnance-survey-linked-data/apis/74o/postcode/NG26DX?apikey=YOUR-APIKEY

View configuration, subscription and access details

Bind a SPARQL 1.1 query to a parameterised URL to create a simple way to request results of a query. Custom formats can be added by applying XSLT stylesheets. Useful for creating custom APIs against datasets.

View configuration, subscription and access details

Bind a SPARQL 1.1 query to a parameterised URL to create a simple way to request results of a query. Custom formats can be added by applying XSLT stylesheets. Useful for creating custom APIs against datasets.

View configuration, subscription and access details