XML Europe 2003 logo

Collaborative Mapping with RDF

Abstract

This project, spacenamespace, offers an XML namespace and RDF vocabulary for geospatial annotation, with a scheme to represent a physical space as a unique URI, allowing it to be referred to and shared on the semantic web. It also provides an Instant Message bot interface, which uses a web API which returns RDF data serialised in XML, to explore, augment and annotate the RDF graph model. the uses of SVG for visual rendering and OWL for ontological description allowing for inference are discussed.

Keywords


Table of Contents

1. Collaborative Mapping with RDF
2. Modelling spatial locations in RDF
3. A RESTful XML/RDF interface for geospatial data
4. 'mudlondon', a Jabber-based Instant Message Bot
5. Mapping in SVG
6. Developing a Collaborative Ontology for Spatial Modelling
7. Exchange of Personal Geodata using RDF
Bibliography
Glossary
Biography

1. Collaborative Mapping with RDF

Collaborative mapping enables people and organisations to share geospatial data over the web, to 'externalise the mental map' and build open representations of their environment. This project, spacenamespace, offers an XML namespace and Resource Description Framework (RDF) vocabulary for geospatial annotation, with a scheme to represent a physical space as a unique URI, allowing it to be referred to and shared on the semantic web. It also provides an Instant Message (IM) bot interface, which uses a web API which returns RDF data serialised in XML.

The application uses the Friend Of A Friend (FOAF) RDF vocabulary to attribute provenance to comments and recommendations about locations. FOAF provides a simple way to describe yourself and your social network in RDF. This can be used as the basis of a user-determined subscription service for collaborative filtering.

2. Modelling spatial locations in RDF

The application provides a basic RDF schema for the representation of physical space. Where possible, it uses public XML namespaces for properties; Dublin Core for text and date properties, the w3's geopositioning namespace to represent latitude and longitude in wgs84 format. Other geospatial metadata are incorporated into the 'spacenamespace' in an ad-hoc fashion. Properties may be specific to a UK application as postcode and Ordnance Survey National Grid reference. Other properties describe relations between spaces - 'connects', 'contains' or 'near'. The author hopes to 'hive off' some of these properties into other schemas for more fine-grained re-use as that becomes appropriate.

The 'spacenamespace' at http://space.frot.org/ provides a scheme for addressing each user-defined physical space at a unique URI. The URI enables the place to be talked about or referred to in other semantic web applications, such as the RSS picture-annotation project at http://www.picdiary.com/, where spacenamespace URIs are used to provide a location for picture collections.

The URI could stand as an abstract identifier for a place, merely guaranteeing a certain kind of uniqueness - dereferencing it, by looking it up and inspecting the contents for more statements, is not obligatory. However, spacenamespace allows each URI to be dereferenced to show geospatial information, expressed in RDF/XML, about a space. Figure 1 illustrates the RDF graph model for the Hilton London Metropole; the following code block is the RDF/XML serialisation of the graph available at the URI http://space.frot.org/london/Hilton_London_Metropole#space

click image for full size view

Figure 1. RDF graph of location metadata for Hilton London Metropole

<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
        xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
	xmlns:dc="http://purl.org/dc/1.0/"
	xmlns:space="http://frot.org/space/0.1/"
	xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#"
	xmlns:owl="http://www.w3.org/2002/07/owl#"
	xmlns:foaf="http://xmlns.com/foaf/0.1/"
	> 

<space:space rdf:about="/london/Hilton_London_Metropole#space">
    <space:os_y>181659</space:os_y>
    <space:type>Hotel</space:type>
    <space:name>Hilton London Metropole</space:name>
    <space:lr_grid>TQ269816</space:lr_grid>
    <space:postcode>W2 1JU</space:postcode>
    <owl:Class>/rdf/space.owl#Hotel</owl:Class>
    <space:os_x>526986</space:os_x>
    <geo:long>-0.171159</geo:long>
    <geo:lat>51.519585</geo:lat>

    <space:connects>
        <rdf:Description rdf:about="/london/Edgware_Road#space">
	<space:name>Edgware Road</space:name>
	<rdfs:seeAlso rdf:resource="/london/Edgware_Road#space"/>
	<space:type>Road</space:type>
    </rdf:Description>
    </space:connects>
	
</space:space>
</rdf:RDF>

The short name for 'type', which is used by the bot interface for display, is linked to the owl:Class of the space. This is a reference to an ontology for physical space expressed in Web Ontology Language (OWL) ontology for purposes of logical reasoning - of which more below.

The RDF graph provides an ideal path-like representation of connections between places - a building connects to a street connects to another street. The modelling of connections is not very fine grained at present - it does not distinguish qualitatively between the intersection of two roads, and the connection of a house to a road via its front door; it is an area for refinement in the model. The present modelling should allow for a wiki-like refactoring of of the collaborative mental model of london. Figure 2 Figure 2 shows the currently-modelled connections around London's Strand.

click image for full size view

Figure 2. RDF graph of location connections in Central London

3. A RESTful XML/RDF interface for geospatial data

The web interface to mudlondon uses the REpresentational State Transfer (REST) philosophy for XML-based data transfer across the web. Broadly, REST interfaces aim to provide the equivalent of 'web services' using standard http semantics - GET, POST, PUT, DELETE - a small set of verbs operating on a potentially infinite number of nouns, URIs. A further aim is to keep URIs semantically clear to humans - so the string http://space.frot.org/a_space/london/Covent_Garden_Market#space is human-parsable as well as bot-deferenceable

Functions provided in the API as simple POST requests include: annotation of spaces with metadata; commenting on spaces, with the commenter's name/nickname attribution stored in the FOAF namespace; storage of session state (such as current location) for each user.

Other GETtable functions are being added at request; query strings can be added to a space URI to show N nearest spaces of type X or within distance M; e.g., http://space.frot.org/a_space/london/Hilton_London_Metropole?nearest_num=2&nearest_type=Tube_Station translates as 'show me the two nearest tube stations to this location'

	<space:near>
	<rdf:Description rdf:about="/london/Edgware_Road_Station#space">
	<space:name>Edgware Road Station</space:name>
	<space:distance>0.38 miles</space:distance>
	<rdfs:seeAlso rdf:resource="/london/Edgware_Road_Station#space"/>
	</rdf:Description>
	</space:near>
	
	<space:near>
	<rdf:Description rdf:about="/london/Paddington_Station#space">
	<space:name>Paddington Station</space:name>
	<space:distance>0.79 miles</space:distance>
	<rdfs:seeAlso rdf:resource="/london/Paddington_Station#space"/>
	</rdf:Description>
	</space:near>

The RESTful RDF web interface answers multiple purposes. Each space has an <rdfs:seeAlso> link so the map as a whole is crawlable by a spider. These are basically 'free' sideeffects of the application, which was designed to provide a back-end 'brain' for the Instant Message bot; a pleasing illustration of the multipurposability of the semantic web.

4. 'mudlondon', a Jabber-based Instant Message Bot

The other user interface to the spacenamespace is 'mudlondon', a bot which uses Jabber, the XML-based message protocol and instant messaging service. Jabber provides 'transports' to other instant message services so the same bot can talk AIM, MSN Messenger, ICQ etc; sharing state across services. An 'XML stream' runs between the message client and one of a distributed network of servers.

Humans can converse with the bot, which presents the spatial world like it was a text adventure or MUD, multi-user virtual world environment. Bots can also talk to each other via jabber; the mudlondon bot is connected to a spatial ontology building bot discussed below. the bot helps users navigate around the model and stores state about them; plans to add in FOAF filtering of comments here when it becomes nesc. As the user wanders around the map they are able to connect new places and annotate them via the bot.

click image for full size view

Figure 3. mudlondon bot's view of the Hilton London Metropole

Users in conversation with the mudlondon bot can augment the RDF graph while they traverse it, using a simple 'botglot', description language with some natural language and some OO properties for adding metadata and connecting new places.

click image for full size view

Figure 4. mudlondon bot's view of streets around Trafalgar Square

The bot issues requests to the webserver using GET/POST requests and parses the RDF into triples which form potential answers to queries. As well as allowing manipulation of the spatial model, the RDF store also includes information on the state of users, attributions and inferences about each place, comments and other sites' infomation about spaces. As its 'intelligence' is expressed over http, the bot doesnt need any local knowledge of the complete RDF model but builds it up over a series of queries.

There is the capacity to create routes through space in time, describing the actions of groups of people, annotatable with timed events and photographs. There will be SVG visualisations animating the progress of a route.

5. Mapping in SVG

SVG has been enthusiastically embraced by the professional GIS community. The mudlondon map is being extrapolated into an SVG map which, with SMIL and Javascript animation, can show users navigating the model, or illustrate routes across the map visually. It is an eventual aim to extend the project from RDF graph modelling to incorporate a simple subset of the OpenGIS consortium's GML, Geography Markup Language.

Animation features available to SVG through SMIL and Ecmascript allow us to represent changes to a map over time; the geographic or cartographic aspect of history in a part of London can be illustrated and be annotated with their temporal context. An interesting example of this sort of thing is http://pepysdiary.com/, a 'realtime' re-running of the diary of Samuel Pepys in blog form.

In the UK the Ordnance Survey are piloting an SVG-based digital mapping service, the 'Mastermap' http://www.ordnancesurvey.co.uk/os_mastermap/home/home.htm and promising 'intelligence' in map data. carto:net http://www.carto.net/ is a site discussing SVG for cartographers. It has many convenient features for the mapper; the builtin ability to convert between and overlay different co-ordinate systems; an infinite field of view, with the ability to define windows or holes to view it through, zoomable in a clean way, easily cross-referenced with HTML or RDF based web content.

6. Developing a Collaborative Ontology for Spatial Modelling

A collaborative map provides the framework for a collaborative ontology, describing a shared sense of how the world fits together. This is a 'codification of common sense' aim resembling the 'Upper Ontology' aspect of CYC, the commonsense reasoning engine. The whole project was very much inspired by logicmoo, a prolog representation of the openCYC ontology as a MOO type environment with inference capacity.

The spacenamespace ontology was extrapolated from the Feature Classification (FC) and Feature Designation Codes (DSG) from GEOnet Names Server (GNS). The ontology is expressed in OWL, the w3c's ontology modelling language. At present it is a fairly simple taxonomic hierarchy; a Pub is a kind of Building and a kind of Public Space.

The ontology has been augmented through personal contributions and with reference to other ontologies such as CYC and grubstreet Categories http://grault.net/cgi-bin/grubstreet.pl?Category_Category/. Another IM bot-based editing interface, 'ontobot', allows the user to modify the ontology and vote on the appropriacy of new additions . When a user of the mudlondon bot creates a new 'type' of place in the london mud, it is submitted automatically via Jabber to the ontobot for reification and inclusion in the spatial ontology; with some human pre-editing this is then presented to a voting committee which has a choice of Jabber and IRC interfaces.

The ontology is expressed in OWL, the W3's Web Ontology Language, which is the re-thought successor to DARPA Agent Markup Language (DAML). We can express taxonomic statements such as a Pub is a kind of Public Space and a kind of Building which is a kind of Construction; and augment the model with logical constraints and properties such as opening time and connection to other concepts, like representations of routes and people.

7. Exchange of Personal Geodata using RDF

There is a preliminary description of 'waypoints' in the schema which can provide a representation of GPS traces and other time-and-space annotated routes. GPS waypoints can be assigned temporary 'anonymous' URIS until they can be aligned with a particular physical space, e.g. along this street, in this shop. By building up the intersection of individual we can trace the social patterns of a city; as illustrated beautifully at http://waag.org/realtime/

RDF provides a 'striped' syntax that allows metadata to be embedded in the headers of HTML pages. RDF feeds can be exchanged between sites; webcrawlers and aggregators can pick up embedded RDF metadata in HTML headers on documents such as http://grault.net/grubstreet/ , 'blogs', or any spatially-linked resource available on the web.

A crucial aim of this project is to contribute towards the representation of personal geodata in a simple XML encoded form sharable on the web. As such it cannot pretend to restrict who can contribute or use the data sources; thoughts of a p3p style network are geared towards sites like grubstreet which cannot afford the prohbitively signifcant sums charged in the UK for a years rental of postcode-to-coordinate conversion utilities and visual maps.

Within Europe, government policies with respect to geodata vary. The spacenamespace danish sister site, http://dk.space.frot.org/, includes 2.2 million addresses, information on administrative areas with postal codes, all in the public domain. In the UK, copyright on comparable data is tightly held by the Ordnance Survey and the Post Office. It is possible that the public re-building of this data may lead to commercial exploitation; but these concerns never held back opensource software developers from writing software aware that it may be used to run commercial services.

Location-based services are becoming more interesting and viable in a world of mobile and wireless connectivity. The author perceives a need for open exchange of personal geodata, a need for bot/agent arbitration of this data and a collaborative filtering aspect to prevent the world of the isomorphic map from filling with spam. Projects such as http://geonotes.sics.se point the way towards directed towards a wireless layer for a mudlondon-like application, where each local node holds an RDF triplestore of information about places within its range, connected to a social network which the user navigates autonomously with assistance from an IM bot.

Bibliography

[CARTOSVG] Carto.net, SVG for cartographers http://www.carto.net/

[CYCCORP] CYC Corp, the publishers of opencyc and its ontology http://www.cyc.com/

[FOAF] Friend Of A Friend vocabulary for RDF http://rdfweb.org/foaf/

[GRUBSTREET] The open-source guide to London http://grault.net/grubstreet/

[GNS] GEOnet Names Server http://www.nima.mil/gns/html/index.html

[LOGICMOO] CYC ontology MOO and inference tools http://logicmoo.sourceforge.net/cycmoo

[OPENCYC] CYC Upper Ontology in DAML http://www.cyc.com/2002/04/08/cyc.daml

[OPENGIS] The OpenGIS Consortium and their Geography Markup Language http://www.opengis.org/

[RESTWIKI] The wiki about the REST architectural style http://internet.conveyor.com/RESTwiki/moin.cgi/

[RDFWEB] Semantic web vapourware for the masses http://rdfweb.org/

[SPACE] spacenamespace, spatial modelling in RDF with london as a test casehttp://space.frot.org/

[SPACEDK] The Danish equivalent of spacenamespace http://dk.space.frot.org/

[WAAG] The Waag's 'realtime' GPS trace mapping project in Amsterdam http://waag.org/realtime/

[W3GEO] W3 geopositioning workspace and namespace http://www.w3.org/2003/01/geo/

Glossary

DAML

DARPA Agent Markup Language

FOAF

Friend Of A Friend

GNS

GEOnet Names Server

IM

Instant Message

OWL

Web Ontology Language

RDF

Resource Description Framework

REST

REpresentational State Transfer

Biography

Jo Walsh is a freelance bot writer and semantic web hacker