330 likes | 455 Views
RAGLD Training Session. Ordnance Survey 26th September 2013. Your Hosts. Ian Millard, Senior Technologist Hugh Glaser, Chief Architect. Agenda. Linked Data Introduction RAGLD Introduction REST Through Rithmetic Relationship Stores through Relatives Republishing RDF Break
E N D
RAGLD Training Session Ordnance Survey 26th September 2013
Your Hosts • Ian Millard, Senior Technologist • Hugh Glaser, Chief Architect
Agenda • Linked Data Introduction • RAGLD Introduction • REST Through Rithmetic • Relationship Stores through Relatives • Republishing RDF • Break • Simple geo-services – sameAs, differentFrom, contains, touches services • Searching • Complex geo-services – indexing & analysis • Demonstration – delivering an answer for Bed & Breakfast en route • Visualisation tools
1. Linked Data Introduction • Spatial data infrastructures • Linkable data – use of unique identifiers John Goodwin’s slide
Towards a web of linked data… John Goodwin’s slide
Linked Data Principles The four micro principles of the Semantic Web 1. All entities of interest, such as information resources, real-world objects, and vocabulary terms should be identified by URI references. 2. URI references should be dereferenceable, meaning that an application can look up a URI over the HTTP protocol and retrieve RDF data about the identified resource. 3. Data should be provided using the RDF/XML syntax 4. Data should be interlinked with other data.
1. Use URIs as names for things • Everything • If you don’t name something you can’t talk about it • Things of course • Year of publication • Ideas • … • Cool URIs • Think of the consumer/customer • https://secure.ecs.soton.ac.uk/gizmos/person_by_username.php?username=hg • https://secure.ecs.soton.ac.uk/person/username/hg • RESTful Interfaces • Ambiguity • URIs help to avoid it, especially if you…
2. Use HTTP URIs so that people can look up those names • HTTP URI names come with an excellent look up mechanism • And ownership, etc.
3. When someone looks up a URI, provide useful information, using the standards (RDF, SPARQL) • So they know what you mean • Deliver some human readable data • html • Deliver some machine processable data • RDF • JSON • CSV • text
Essential RDF • Statements about resources in the form of subject-predicate-object • A knowledge representation language for the Web • Represents information as sets of triples – subject verb object • Every element of a triple can be a URI or a concrete value (literal) • Sets of RDF triples can be represented as graphs • Ontologies define vocabularies, types and relationships • Agreed URIs facilitate linkage between datasets
442356 114001 Easting Northing ../SO171DP ../70..17707 District Ward ../70..37256 Within Name Name Bevois Southampton John Goodwin’s slide
URIs The City of Southampton: http://data.ordnancesurvey.co.uk/id/7000000000037256 Bevois: http://data.ordnancesurvey.co.uk/id/7000000000017707 The postcode unit SO17 1DP: http://data.ordnancesurvey.co.uk/id/postcodeunit/SO171DP
Triples <http://data.ordnancesurvey.co.uk/id/postcodeunit/SO171DP> <http://data.ordnancesurvey.co.uk/ontology/postcode/ward> <http://data.ordnancesurvey.co.uk/id/7000000000017707> . <http://data.ordnancesurvey.co.uk/id/postcodeunit/SO171DP> <http://data.ordnancesurvey.co.uk/ontology/postcode/district> <http://data.ordnancesurvey.co.uk/id/7000000000037256> . <http://data.ordnancesurvey.co.uk/id/7000000000017707> <http://www.w3.org/2000/01/rdf-schema#label> "Bevois" . <http://data.ordnancesurvey.co.uk/id/7000000000037256> <http://www.w3.org/2000/01/rdf-schema#label> "Southampton" . <http://data.ordnancesurvey.co.uk/id/7000000000017707> <http://data.ordnancesurvey.co.uk/ontology/spatialrelations/within> <http://data.ordnancesurvey.co.uk/id/7000000000037256> . <http://data.ordnancesurvey.co.uk/id/7000000000017707> <http://www.w3.org/2002/07/owl#sameAs> <http://statistics.data.gov.uk/id/statistical-geography/E05002457> .
4. Include links to other URIs. so that they can discover more things • “Foreign” URIs • dbpedia:Southampton_University • Equivalence • owl:sameAs • skos:exactMatch • … http://rdf.ecs.soton.ac.uk/person/2686 SameAs http://southampton.rkbexplorer.com/id/person-02686 SameAs http://dbpedia.org/resource/Nigel_Shadbolt
About RAGLD • A collaborative project between Ordnance Survey, the University of Southampton and Seme4 Ltd • Part-funded by the Technology Strategy Board‘s “Harnessing Large and Diverse Sources of Data” programme • 18 month long project. Started Oct 2011. Completed March 2013 • Building tools to enable developers to make greater use of linked data • So Diverse it is hard to describe • There is much that we could focus on
Linked Data IDs, RDF and RESTful Services • REST - http://en.wikipedia.org/wiki/Representational_state_transfer • Essentially, for this demonstration: • Use HTTP methods GET, PUT, (POST) & DELETE • GET • Retrieve a representation of the addressed member of the collection, expressed in an appropriate Internet media type • No side-effects • PUT • Replace the addressed member of the collection, or if it doesn't exist, create it • idempotent • DELETE • Delete the addressed member of the collection • idempotent • MIME (Internet Media) Types are important to both • text/html • text/plain • application/json • application/rdf+xml • text/turtle
Tools and Services • Data Enhancement Services • Data Transformation Services • Relationship Management Services • Ingestion Services • Publishing Services • Spatial Query Services • Visualisation Components • Workflow Management • Federation of Services • Proxy Services
150M URIs 43M Distinct The Web of Data has many equivalent URIs. This sameAs service helps you manage co-refs between different data sets.
3. REST Through `Rithmetic • Let’s Go! • http://demo{NN}.data.seme4.com • NN = {30..40} • http://demo30.data.seme4.com/services/arithmetic/
4. Relationship Stores through Relatives • Relationship services maintain pairs { symbolA, symbolB } • These can be URIs, numbers, or text strings • Most basic store gives back what you put in • Can specify additional properties • symmetric, transitive, reflexive, inverse
5. Publishing RDF • Linked data publishing often seen as difficult • RDF, triplestores, SPARQL, complex redirects, etc • RAGLD has basic support built in (RESTful, of course!) • http://demoXX.data.seme4.com/id/joe • Stick your RDF in a file, and then PUT on the server • Lets try and have a go…
6. More of a geospatial focus • Geospatial data is full of relationships between entities • We can use RAGLD relationship services to make factual data about geospatial features readily accessible • sameAs / different From • touches (symmetric) • contains / within (transitive, will compute automatically) • “connected” (use touches but apply symmetric + transitive) • “one hop away” (constrain number of hops)
7. Searching • Relationship stores can also be used as lookup/search services • useful to reconcile multiple identifiers to a single URI • Store pairs of { URI, label } • Exact match, partial match, regular expressions • Can federate search over a number of relationship stores • Eg http://geospatial.data.seme4.com/postcode/
8. Dealing with geospatial features • RAGLD services can use a common function to acquire (“ingest”) geospatial features from a number of sources • POST a raw geospatial feature (GeoJSON, GML, WKT, SHP.zip) • Access geospatial data available at a URI (either static, or a service) • Acquire geospatial data from RDF • must either have coordinate point, or checks a number of predicates for boundary data • again, this can be a static document, eg Linked Data resource, or the output of a service • http://geospatial.data.seme4.com/services/geo/ingest/
9. “Proper” geospatial services • Two main geospatial services, backed by PostGIS • primarily developed by Tony Joyce
10. Demonstration –Bed & Breakfasts en route • Find convenient bed and breakfasts on a road-trip(within 10km of my route) • Fictitious dataset of Bed & Breakfasts • eg http://demo.data.seme4.com/id/bnb-1234 • (unfortunately many are at sea!) • Geospatial index of these locations • http://geospatial.data.seme4.com/services/geo/bnb/
10. Demonstration –Bed & Breakfasts en route ingest ( fetch ( within ( buffer( route ) ) ) )
11. App building tools • Many services can be easily accessed directly via AJAX calls • RESTful invocation via simple “cool” URIs • Request JSON or GeoJSON output • Eg search – http://demoXX.data.seme4.com/example-search.html
11. App building tools • Visualisation / mapping library • Javascript “glue” to easily link outputs from service(s) and display on a map • Based around Leaflet and a couple of plugins • Used by Guy Heathcote to develop RAGLD demonstrator • http://demoXX.data.seme4.com/visualisation.zip