Tell Me About Hampshire – Linking Government Data using SPARQL federation 2


Yesterday I blogged about how to do some SPARQL federated queries across various government websites, and this blog is a continuation of this with a different example. In this blog I give an example query which basically say ‘tell me stuff about Hampshire‘. I do this by linking up data from Ordnance Survey, the Office of National Statistics, the Department of Communities and Local Government and Hampshire County Council. This query is really just for illustrative purposes, but I want to ask ‘for all districts in Hampshire find me the index of multiple deprivation rank, the change order and operative date for that district, the website for the local authority of that district along with the addresses of parcels of land where it is planned to build new dwellings. To achieve this I need to take data from several sources and use SPARQL federation. Here is the query that answers my question. First I query Ordnance Survey linked data to find districts in Hampshire, and I then pass these districts to three other linked data services to retrieve the relevant information. To try this example head over to the Ordnance Survey SPARQL endpoint and copy/paste the following:

select ?districtname ?imdrank ?changeorder ?opdate ?councilwebsite ?siteaddress
{?district <>
   <> .
  ?district a <> .
  ?district <> ?districtname .
 ?s <> ?district .
?s <> ?imdrank .
 ?authority <> ?district .
 ?authority <> ?councilwebsite .
 ?district <> ?onsdist .
 ?onsdist <>
          ?changeorder .
 ?onsdist <>
          ?opdate .
   ?landsupsite <> ?district .
   ?landsupsite a <> .
   ?siteaddress .

Happy SPARQLing…

Posted in Benefits of open data, Informing Decision-making, Innovation, Posts from feeds, Visualising data Tagged with: , , , , , , , , ,