Dataset Ordnance Survey
Published 7th March 2011
Updated 23rd November 2010
Resources 2018489
Explore the dataset
Default APIs

SPARQL Endpoint

Use the SPARQL 1.0 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.

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.

Augmentation API

Pass an RSS 1.0 feed through a dataset, automatically enriching the feed with descriptions of any relevant data sources. Useful for “fishing” data out of datasets without writing queries.

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

Shape a completely custom RESTful API against a dataset. Allows users to create completely custom APIs that are tailored for their own uses. Offers a standard XML and JSON output.

View configuration, subscription and access details

Bind a SPARQL 1.0 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.0 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

An API like http://beta.kasabi.com/api/ordnance-survey-spatial-slice but returning SPARQL XML/JSON.

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

Bind a SPARQL 1.0 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