LOSM - A lightweight approach to integrate OpenStreetMap into the Web of Data

JOHANNES TRAME, PHILIPPE RIEFFEL , UMUT TAS, ALKYONI BAGLATZI and VOLKER VON NATHUSIUS

This project was conducted in the context of a seminar called 'OpenStreetMap study project' in the winter term 2010/2011 at the Institute for Geoinformatics of the University of Muenster, held by Dr. Kessler.

Abstract

The idea of interlinking spatial data from OpenStreetMap (OSM) to the large repositories of the Linked Open Data Cloud (LOD) is already acknowledged as a valid contribution to the semantic web. Since the nature of the OSM data is volatile, this work proposes a dynamic approach to make OSM available as linked data. Instead of triplifying the whole OSM database and linking upon these triples, we serve resources on the fly and link the original data. Integrating the linkage of the data cloud into the original data prevents redundancies, preserves actuality and creates additional value.
Keywords: OpenStreetMap, Linked Data, RDF, Web of Data

Webinterface

The prototypical webinterface can be found here.

Offered functionalities:
  • browse existing data
  • fetch additional information from remote data hubs in case Nodes are already linked
  • confirm suggested outgoing links to other linked data hubs and enrich OSM
  • query a bounding box with sparql

  • The functionalities of the webinterface are also explained in the screenshot below, just hover over the component that you are interested in.

    REST Server Interface

    Depending on the requesting client e.g. Web-Browsers or Semantic Web Applications we serve the resource in different representations formats like HTML or RDF. In view of the fact that we encapsulated the Krextor Framework as a REST server using Jersey's JAX-RS reference implementation, we exploit the HTTP Accept headers for content negotiation. Content negotiation can be implemented in different ways for example based on url patterns, HTTP headers or request parameters. However, while the HTTP header is not visible as a parameter or URL, it gives us more flexibility on server- as well as on client side.

  • http://losum.uni-muenster.de/resource/node/{id}
  • Where the {id} corresponds to the original OSM node id. Depending on the Request Header "Accept:application/rdf+xml" or "Accept:application/html" the response will be returned encoded in RDF or as a HTML representation.
    Example: http://losm.uni-muenster.de/resource/node/29007132 - Same Node in OSM: http://www.openstreetmap.org/api/0.6/node/29007132

    In addition also whole geographically bounding boxes to a limited size can be queried:
  • http://losum.uni-muenster.de/resource/node/{left,bottom,right,top}
  • For a bounding box where the {left,bottom,right,top} corresponds to the left-bottom and top-right corner of the BBOX encoded in WGS84 coordinates. Using a HTTP Get Request all nodes of the bounding box are returned encoded in RDF. At the same time the service accepts POST Re- quests with a plain text sparql query embedded in the request body. The encodes bindings of the query result a returned encoded in JSON.

    Vocabulary

    The underlying vocabulary can be browsed by clicking on the picture:


    Source Code

    The core of our Osm2Rdf RESTful web-service is built upon the Krextor framework, an extensible XSLT-based framework for extracting RDF from XML. Krextor serves as a generic interface for mapping different XML input languages to several RDF output notations. We decided to use Krextor, since it allows to define easily new XSLT input modules independently from the aimed output. We extended Krextor by defining our own input module for the OSM XML format (API0.6). Krextor comes along with several templates like "create-resource", "add- literal-property" and "add-uri-property", which makes the extraction and mapping task much easier.



  • OSM Extraction Modul for Krextor


  • The code for the RESTful Webserver encapsulating the Krextor Framework:
  • http://www.assembla.com/code/osm2rdf (at the moment the repository is not public read-able due not clarified license issues for some used Java Libraries )