Archive
Introducing RAGLD
RAGLD (Rapid Assembly of Geo-centred Linked Data) is a project looking at the development of a software component library to support the Rapid Assembly of Geo-centred Linked Data applications
The advent of new standards and initiatives for data publication in the context of the World Wide Web (in particular the move to linked data formats) has resulted in the availability of rich sources of information about the changing economic, geographic and socio-cultural landscape of the United Kingdom, and many other countries around the world. In order to exploit the latent potential of these linked data assets, we need to provide access to tools and technologies that enable data consumers to easily select, filter, manipulate, visualize, transform and communicate data in ways that are suited to specific decision-making processes.In this project, we will enable organizations to press maximum value from the UK’s growing portfolio of linked data assets. In particular, we will develop a suite of software components that enables diverse organizations to rapidly assemble ‘goal-oriented’ linked data applications and data processing pipelines in order to enhance their awareness and understanding of the UK’s geographic, economic and socio-cultural landscape.A specific goal for the project will be to support comparative and multi-perspective region-based analysis of UK linked data assets (this refers to an ability to manipulate data with respect to various geographic region overlays), and as part of this activity we will incorporate the results of recent experimental efforts which seek to extend the kind of geo-centred regional overlays that can be used for both analytic and navigational purposes. The technical outcomes of this project will lead to significant improvements in our ability to exploit large-scale linked datasets for the purposes of strategic decision-making.RAGLD is a collaboative research initiative between the Ordnance Survey, Seme4 Ltd and the University of Southampton, and is funded in part by the Technology Strategy Board‘s “Harnessing Large and Diverse Sources of Data” programme. Commencing October 2011, the project runs for 18 months.
If you’d like to input into the requirements phase of the project I’d be very grateful if you could fill in one of these questionnaires. Many thanks in advance.
/location /location /location – exploring Ordnance Survey Linked Data – Part 2
Ordnance Survey have now released an update to their linked data, which can be seen here. The new data now includes postcode information as well as a few changes to the administrative geography data. In this post I’ll go through what’s in the data, and give a few sample SPARQL queries.
I spoke a bit about the administrative geography data in a previous blog post – but the data has changed a bit since then. Just to re-cap the administrative geography linked data contains information about administrative and voting geographic regions. These include unitary authorities, counties, wards, constituencies, Welsh Assembly regions and a whole lot more [1]. Here are some examples:
If you want to find a full list of the sorts of thing you can find in the data simply go to the query interface (or SPARQL endpoint as it is know) and try the following query:
select distinct ?type
where { ?a a ?type . }
Now you have the list all of type of things in the data you can as for lists of instances of those types.
For example, the following query will return all of the unitary authorities:
select ?a
where {
?a a <http://data.ordnancesurvey.co.uk/ontology/admingeo/UnitaryAuthority> .
}
All of the names of all the regions have now been modelled using the SKOS vocabulary. If you want to find the official names of all the unitary authorities you can simple issue a query like:
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 .}
Also included in the data are two attributes called Unit ID and Area Code. These values are useful if you want to produce a mashup using this data and display it by boundary.
So for example, for Southampton (http://data.ordnancesurvey.co.uk/id/7000000000037256) the area code is UTA (for unitary authority) and the unit ID is 37256. These values can be used as follows:
/*here we set-up the our variable called ‘boundaryLayer’ with the strategies that we require. In this case, it is its ID and type i.e. Unitary Authority */
boundaryLayer = new OpenSpace.Layer.Boundary(“Boundaries”,
{ strategies: [new OpenSpace.Strategy.BBOX()], admin_unit_ids: [“37256”], area_code: [“UTA”] });
//then we add the bounadry to the map osMap.addLayer(boundaryLayer);
//this effectively refreshes the map, so that the boundary is visible
osMap.setCenter(osMap.getCenter());
to display the Southampton boundary using the OS OpenSpace API. See http://openspace.ordnancesurvey.co.uk/openspace/support.html for more details.
Arguably the most useful information in this data are the qualitative spatial relationships between different regions. Regions are related to the regions they contain, they are within and they touch. In the case of the touching relationship only regions of the same type have an explicit touching relationship. The exception to this are unitary authorities, counties, district and metropolitan district that also have touching relationships between each other. The following simple query will return a list of all counties, districts and unitary authorities that border The City of Southampton. It will also return their names:
PREFIX spatialrelations: <http://data.ordnancesurvey.co.uk/ontology/spatialrelations/>
select ?a ?name
where
{
?a spatialrelations:touches <http://data.ordnancesurvey.co.uk/id/7000000000037256> .
?a <http://www.w3.org/2004/02/skos/core#prefLabel> ?name .
}
If you are only interested in the bordering counties you can add an extra line to your query:
PREFIX spatialrelations: <http://data.ordnancesurvey.co.uk/ontology/spatialrelations/>
select ?a ?name
where
{
?a spatialrelations:touches <http://data.ordnancesurvey.co.uk/id/7000000000037256> .
?a <http://www.w3.org/2004/02/skos/core#prefLabel> ?name .
?a a <http://data.ordnancesurvey.co.uk/ontology/admingeo/County> .
}
Similarly, the following query returns all the county electoral divisions (and their names) within Hampshire:
PREFIX spatialrelations: <http://data.ordnancesurvey.co.uk/ontology/spatialrelations/>
select ?a ?name
where
{
?a spatialrelations:within <http://data.ordnancesurvey.co.uk/id/7000000000017765> .
?a <http://www.w3.org/2004/02/skos/core#prefLabel> ?name .
?a a <http://data.ordnancesurvey.co.uk/ontology/admingeo/CountyElectoralDivision> .
}
For convenience some shortcuts have been added to the data in this release. For certain nesting geographies, such as the county – district – parish or district – ward nestings, various new properties have been added. For example, the property ‘counyElectoralDivision‘ relates all counties to their constituent county electoral divisions. The above query can now be done in a simpler way:
PREFIX admingeo: <http://data.ordnancesurvey.co.uk/ontology/admingeo/>
select ?a ?name
where
{
<http://data.ordnancesurvey.co.uk/id/7000000000017765> admingeo:countyElectoralDivision ?a .
?a <http://www.w3.org/2004/02/skos/core#prefLabel> ?name .
}
Similar predicates such as ‘county‘, ‘district‘, ‘ward‘, ‘constituency‘ etc. provide similar shortcuts. For example, the following returns all the Westminster constituencies in South East England.
PREFIX admingeo: <http://data.ordnancesurvey.co.uk/ontology/admingeo/>
select ?a ?name
where {
<http://data.ordnancesurvey.co.uk/id/7000000000041421> admingeo:westminsterConstituency ?a .
?a <http://www.w3.org/2004/02/skos/core#prefLabel> ?name . }
The most significant introduction to this data is the inclusion of postcode information. The data now contains information about postcode units, postcode sectors, postcode districts and postcode areas. For each postcode unit an easting/northing coordinate value is given [2] along with the district, ward and county (where applicable) that contains said postcode unit. An example of this can be seen for the Ordnance Survey postcode SO16 4GU. Each postcode is also related to its containinb postcode area, sector and district.
The properties ‘ward‘, ‘district‘ and ‘county‘ relate a postcode to the relevant regions. The simple query:
PREFIX postcode: <http://data.ordnancesurvey.co.uk/ontology/postcode/>
select ?district
where {
<http://data.ordnancesurvey.co.uk/id/postcodeunit/SO164GU> postcode:district ?district .
}
returns the unitary authority that contains the postcode SO16 4GU.
This query:
PREFIX spatialrelations: <http://data.ordnancesurvey.co.uk/ontology/spatialrelations/>
select ?postcode
where
{
?postcode spatialrelations:within <http://data.ordnancesurvey.co.uk/id/postcodearea/SO> .
}
returns all the postcodes in the SO postcode area.
We can combine the above two queries to find the areas, along with their names, covered by the postcode area SO:
PREFIX spatialrelations: <http://data.ordnancesurvey.co.uk/ontology/spatialrelations/>
PREFIX postcode: <http://data.ordnancesurvey.co.uk/ontology/postcode/>
select distinct ?district ?name
where
{
?postcode spatialrelations:within <http://data.ordnancesurvey.co.uk/id/postcodearea/SO> .
?postcode postcode:district ?district .
?district <http://www.w3.org/2004/02/skos/core#prefLabel> ?name .
}
Hopefully these few examples will give you enough information to fully explore this new release of the Ordnance Survey linked data. For those of you who don’t like SPARQL watch this space – hopefully we will soon(ish) have an API built on top of this data to allow for even easy access.
[1] you’ll notice the ‘isDefinedBy’ link currently returns a 404 – not for long I hope 🙂
[2] lat/long to follow