Publishing Event Streams as Linked Data

Latest version:
http://km.aifb.kit.edu/sites/lodstream/
Vocabulary:
http://events.event-processing.org/types/types.n3
Last modified:
$Id: index.html 21612 2012-11-27 06:53:30Z stuehmer $
Status:
Public draft
Editors:
Andreas Harth, KIT
Roland Stühmer, FZI

Abstract

How to publish event streams as Linked Data.

Introduction

Increasingly, real-time processing is becoming important and sites provide direct access to data streams, which provide data as soon as the data appears. For example, Twitter provides API access to a stream of Twitter messages in real-time. In addition, with the proliferation of sensors, more streaming data sources will become available. Simultaneously, there is an increasing amount of public data on the Web which can be linked to and reused in RDF. This means that a lot of static data is available to be used as context of events.

Requirements

N-ary predicates. [N-ARY-REL]

Need a class event, time stamp (atomic or interval).

Data sources:

Triples/Quads occur once in NiceWeatherStream and once in historical data source for events.

Vocabulary

Examples

@prefix :        <http://events.event-processing.org/types/> .
@prefix dbpedia: <http://dbpedia.org/resource/#> .
@prefix e:       <http://events.event-processing.org/ids/> .
@prefix geo:     <http://www.w3.org/2003/01/geo/wgs84_pos#> .
@prefix rdf:     <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix s:       <http://streams.event-processing.org/ids/> .
@prefix src:     <http://sources.event-processing.org/ids/> .
@prefix xsd:     <http://www.w3.org/2001/XMLSchema#> .

e:e1 {
    <http://events.event-processing.org/ids/e1#event>
          a       :AvgTempEvent ;
          :endTime "2011-08-24T14:42:01.011"^^xsd:dateTime ;
          :members (<http://events.event-processing.org/ids/e2#event> <http://events.event-processing.org/ids/e3#event>) ;
          :source <http://sources.event-processing.org/ids/NiceWeatherAggregator#source> ;
          :startTime "2011-08-24T14:40:59.837"^^xsd:dateTime ;
          :stream <http://streams.event-processing.org/ids/NiceWeatherStream#stream> ;
    dbpedia:Nice :avgTemp [ rdf:value "25" ; :event  <http://events.event-processing.org/ids/e1#event> ] .
}
  1. An event using quadruples in TriG syntax [TRIG]. The graph name (a.k.a context) before the curly braces is used in the storage backend to enable efficient indexing of contiguous triples.
  2. RDF Lists "(", ")" are used in :members to maintain ordered and complete account of related events.
  3. N-ary predicates "[", "]" [N-ARY-REL] are used on dbpedia:Nice to maintain knowledge about a temperature measurement and at the same time its belonging to a specific event.
  4. There is an event ontology from which type :AvgTempEvent is inherited. This ontology can be extended by anyone by referencing the RDF type Event as a super class.
  5. The ontology makes use of related work by reusing the class "Event" from Dolce Ultralight based on DOLCE [Gangemi2002]
  6. The event format supports interval-based events as well as point-based events by using either just :endTime for a point or both, :startTime and :endTime for an interval.
  7. The event links to two other events e2:event, e3:event in different streams which were used as input to create the :AvgTempEvent. These events are depicted below. They could have further input events themselves.
  8. The event links to an entity dbpedia:Nice from the Linked Data cloud where further context for the event can be retrieved.
  9. The event links to a stream where current events can be obtained as they happen.
  10. There is a distinction made between the event e1:event and the Web resource e1 to separate the URI for the thing event from the event information describing the event. The fragment identifier #event is used to identify the event.
  11. We are aware of the overlap of the namespaces. Unfortunately, stacking of namespaces like e:e1#event is not allowed, so we are using the absolute URI instead of e1:event which avoids defining a new namespace e1, e2, e3, ..., eN for each unique event .
  12. For geo-referencing events (where necessary) we are following the recommendations of NEOGEO [NEOGEO] who will recommend standard ways of how to reference even complex geographical shapes from RDF
  13. The namespace event-processing.org was chosen as a generic home for this schema.
  14. ...
e:e2 {
    <http://events.event-processing.org/ids/e2#event>
          a       :TempEvent ;
          :endTime "2011-08-24T14:40:59.837"^^xsd:dateTime ;
          :source <http://sources.event-processing.org/ids/NiceWeatherStation01#source> ;
          :stream <http://streams.event-processing.org/ids/NiceTempStream#stream> ;
    dbpedia:Nice :curTemp [ rdf:value "23" ; :event  <http://events.event-processing.org/ids/e2#event> ] .
}
e:e3 {
    <http://events.event-processing.org/ids/e3#event>
          a       :TempEvent ;
          :endTime "2011-08-24T14:42:01.011"^^xsd:dateTime ;
          :source <http://sources.event-processing.org/ids/NiceWeatherStation02#source> ;
          :stream <http://streams.event-processing.org/ids/NiceTempStream#stream> ;
    dbpedia:Nice :curTemp [ rdf:value "27" ; :event  <http://events.event-processing.org/ids/e3#event> ] .
}

Event Class

An event is defined as:

Event
anything that happens or is contemplated as happening [EP-GLOSS]
something that happens at a given place and time [WORDNET]

Temporal Modelling

Spatial Modelling

(optional) (either lat/lon or URIs to locations which contain descriptions of geometry)

The NeoGeo vocabulary [NEOGEO] could be a starting point:

e:e1    {
    <http://events.event-processing.org/ids/e1#event>
            :location [ geo:lat "53.27194"^^xsd:double; geo:long "-9.04889"^^xsd:double ] .
}

Performance

Streams make use of namespace prefixes to reduce the number of characters to be transmitted.

Further bandwidth savings can be achieved by gzipping the HTTP stream.

Another option could be a binary RDF serialization like [HDT-ISWC2010].

A. References

[HDT-ISWC2010]
Javier D. Fernández, Miguel A. Martínez-Prieto, Claudio Gutierrez, and Axel Polleres. Binary RDF Representation for Publication and Exchange (HDT), W3C Member Submission 30 March 2011. Available at http://www.w3.org/Submission/2011/SUBM-HDT-20110330
[NEOGEO]
Juan Martín Salas and Andreas Harth. NeoGeo Vocabulary: Defining a shared RDF representation for GeoData, Public draft.
[EP-GLOSS]
David Luckham and Roy Schulte (Editors). Event Processing Glossary - Version 2.0, 2011
[WORDNET]
Christiane Fellbaum et al.. WordNet on "event"
[TRIG]
Chris Bizer and Richard Cyganiak. The TriG Syntax
[N-ARY-REL]
Natasha Noy and Alan Rector. Defining N-ary Relations on the Semantic Web
[DUL]
Aldo Gangemi. DOLCE+DnS Ultralite (DUL)

B. Java

For the use in Java we are generating classes from the RDF types. The classes are generated using RDFReactor. They are currently available as Maven snapshots in the following artefact:
        <dependency>
            <groupId>eu.play-project</groupId>
            <artifactId>play-commons-eventtypes</artifactId>
            <version>1.0-SNAPSHOT</version>
        </dependency>
To make it work, include these repositories:
                 <repository>
                    <id>play-private.release</id>
                    <url>http://maven.petalslink.com/private-play-release</url>
                    <releases>
                        <enabled>true</enabled>
                    </releases>
                    <snapshots>
                        <enabled>false</enabled>
                    </snapshots>
                </repository>
                <repository>
                    <id>play-private.snapshot</id>
                    <url>http://maven.petalslink.com/private-play-snapshot</url>
                    <releases>
                        <enabled>false</enabled>
                    </releases>
                    <snapshots>
                        <enabled>true</enabled>
                    </snapshots>
                </repository>
                <repository>
                    <id>semweb4j-repo</id>
                    <name>FZI Maven Repository</name>
                    <url>http://mavenrepo.fzi.de/semweb4j.org/repo</url>
                    <releases>
                        <enabled>true</enabled>
                    </releases>
                    <snapshots>
                        <enabled>false</enabled>
                    </snapshots>
                </repository>
                <repository>
                    <id>semweb4j-snapshots</id>
                    <name>FZI Maven Snapshot Repository</name>
                    <url>http://mavenrepo.fzi.de/semweb4j.org/snapshots</url>
                    <releases>
                        <enabled>false</enabled>
                    </releases>
                    <snapshots>
                        <enabled>true</enabled>
                    </snapshots>
                </repository>