geoservice.psi.enakting.org is a service to support the discovery of geographical resources in the Web of Data querying containment relations. In order to use the service enter a Linked Data URI in the input text box and choose the target data set or "none" for retrieving all the results. This service is integrated with sameAs.org so as to increase the coverage of connectivity. Moreover, the service is also integrated with backlinking service in order to retrieve resources that link to the geographical resources retrieved. New APIs have been developed in order to support a more flexible querying of geographical subdivisions (e.g. European NUTS for statistical purposes, the UK electoral or administrative) and an effective rendering of the geographical extensions over maps for mashups.
The new APIs are composed of the following services:

Containment API

for backward compatibility




Explore some of the UK geographical entities
in different data sets:
(EnAKTing) Hampshire
(EnAKTing) London
(Ordnance Survey) Barnsley Central
(Openly Local) Southampton


This service is a RESTFul API, you can point your requests to:
http://geoservice.psi.enakting.org/{command}/{dictionary}/{format}/{URI}

command:
  • contains: returns the entities contained in the input URI
  • container: returns the entities that contains the input URI
dictionary:
  • os: URIs from Ordnance Survey
  • statistics: from UK National Statistics
  • dbpedia: from DBPedia
  • geonames: from geonames
  • enakting: from EnAKTing datasets
  • opencyc: from OpenCYC
  • openlylocal: from OpenlyLocal
  • none: no filters applied
format(Optional):
  • text: plain text format
  • rdf: RDF/XML format
  • ttl: RDF Turtle format
  • json: JSON array format
  • (none): HTML interface

This service supports content negotiation and accepts: curl -L -H "Accept: application/rdf+xml"\\
http://geoservice.psi.enakting.org/contains/\\
enakting/http://dbpedia.org/resource/Hampshire


New Containment API



This service is a RESTFul API, you can point your requests to:
http://geoservice.psi.enakting.org/{command}/{format}/{depth}/?uri={URI}[&valid_from={from}&valid_until{until}]

command:
  • closure: return the entities contained in the input URI using OWL:sameAs and os:spatiallyEqualTo
  • iclosure: return the parents of the input URI using OWL:sameAs and os:spatiallyEqualTo
format:
  • text: plain text format
  • rdf: RDF/XML format
  • ttl: RDF Turtle format
  • json: JSON array format
depth (optional): sets the maximum depth of the closure, if omitted the service will retrieve all the possible instances.

temporal validity (optional) a (possibly open) temporal interval can be provided in input, only the regions whose validity overlap the input interval are returned:
  • from: date of beginning temporal interval (format YYYY-MM-DD)
  • until: date of ending temporal interval (format YYYY-MM-DD)


This service supports content negotiation and accepts: The service returns a structure of topological containments of entities, complete with type and literal information, in accordance with the input parameters. Therefore the following command:

curl -L -H "Accept: application/json"\\
http://geoservice.psi.enakting.org/closure\\
/1/?uri=http://nuts.psi.enakting.org/id/UKL


will return the following code:
{
 "http://nuts.psi.enakting.org/id/UKL2": {
  "http://www.w3.org/1999/02/22-rdf-syntax-ns#type": [
   {
    "type": "uri",
    "value": "http://nuts.psi.enakting.org/def/NUTSRegion"
   }
 ],
  "http://www.w3.org/2000/01/rdf-schema#label": [
   {
    "type": "literal",
    "value": "East Wales"
   }
 ],
  "http://data.ordnancesurvey.co.uk/ontology/spatialrelations/containedBy": [
   {
    "type": "uri",
    "value": "http://nuts.psi.enakting.org/id/UKL"
   }
 ]
 },
 "http://nuts.psi.enakting.org/id/UKL": {
  "http://www.w3.org/1999/02/22-rdf-syntax-ns#type": [
   {
    "type": "uri",
    "value": "http://nuts.psi.enakting.org/def/NUTSRegion"
   }
  ],
  "http://www.w3.org/2000/01/rdf-schema#label": [
   {
    "type": "literal",
    "value": "WALES"
   }
  ],
  "http://data.ordnancesurvey.co.uk/ontology/spatialrelations/contains": [
   {
    "type": "uri",
    "value": "http://nuts.psi.enakting.org/id/UKL1"
   },
   {
    "type": "uri",
    "value": "http://nuts.psi.enakting.org/id/UKL2"
   }
  ]
 },
 "http://nuts.psi.enakting.org/id/UKL1": {
  "http://www.w3.org/1999/02/22-rdf-syntax-ns#type": [
   {
    "type": "uri",
    "value": "http://nuts.psi.enakting.org/def/NUTSRegion"
   }
  ],
  "http://www.w3.org/2000/01/rdf-schema#label": [
   {
    "type": "literal",
    "value": "West Wales and The Valleys"
   }
  ],
  "http://data.ordnancesurvey.co.uk/ontology/spatialrelations/containedBy": [
   {
    "type": "uri",
    "value": "http://nuts.psi.enakting.org/id/UKL"
   }
  ]
 },
 "http://geoservice.psi.enakting.org/closure/1/?uri=http://nuts.psi.enakting.org/id/UKL": {
  "http://data.ordnancesurvey.co.uk/ontology/spatialrelations/contains": [
   {
    "type": "uri",
    "value": "http://nuts.psi.enakting.org/id/UKL"
   }
  ]
 }
}


An example for the exploitation of such APIs can be seen browsing the containment relationships for different geographical entities; for example:


Bounding box API

Returns only NUTS region URIs



This service is a RESTFul API, you can point your requests to:
http://geoservice.psi.enakting.org/nuts/bounded/?min_lat={min_lat}&max_lat={max_lat}&min_lng={min_lng}&max_lng={max_lng}&level={level}

The service returns a list of NUTS regions that are strictly contained in the given bounding box.
For example the following command:

curl -H 'Accept: application/json' 'http://geoservice.psi.enakting.org/nuts/bounded?min_lat=0&max_lat=40\\
&min_lng=-20&max_lng=30&level=0'


will return the following JSON object:

{
 "http://geoservice.psi.enakting.org/nuts/bounded?min_lat=0&max_lat=40&min_lng=-20&max_lng=30&level=0": {
   "http://data.ordnancesurvey.co.uk/ontology/spatialrelations/contains": [
    {
     "type": "uri",
     "value": "http://nuts.psi.enakting.org/id/MT"
    }
   ]
  }
}


min_lat: minumum latitude of the bounding box
max_lat: maximum latitude of the bounding box
min_lng: minimum longitude of the bounding box
max_lng: maximum longitude of the bounding box
level: [0..3] level of NUTS regions returned (for a definition of national EU structures see here)


NUTS Polygons API



This service is a RESTFul API, you can point your requests to:
http://geoservice.psi.enakting.org/nuts/polygon/?(nuts_id={id}|nuts_uri={uri}|uri={uri})&(callback=function)&(format={format})

  • nuts_id: use the NUTS code as input
  • nuts_uri: use the URI for the NUTS region as input
  • uri: use the URI for a geographical region as input (the service will try to normalize it with a known region with boundaries)
  • format(optional): either json or kml
  • callback(optional): callback function for JSONP calls
The service returns a polygon in geoJson or KML format for the input region. The service can wrap the result in a json call for serving JSONP calls.
This service can be used in order to create mashups from javascript that dinamically load data for the rendering of geographical data. An example of the rendering of such polygons can be viewed accessing the NUTS geographical browser for different regions:


The service uses poligons from Eurostat and Ordnance Survey:
© EuroGeographics for the administrative boundaries
© Crown Copyright 2010 for the British boundaries

NUTS Polygons Files



The following URIs are the raw files for NUTS regions' polygons (identified by their codes) in two formats: geoJson (json extension) and KML (kml extension) for google map or Earth mashups:
http://geoservice.psi.enakting.org/shape/{nuts_id}.{json|kml}

.
.
.