<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Providing Reliable Access to Real-Time and Historic Public Transport Data Using Linked Connections Julián Rojas1, David Chaves2, Pieter Colpaert1, Ruben Verborgh1, Erik Mannens1</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Julián Rojas</string-name>
          <email>julianandres.rojasmelendez@ugent.be</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>David Chaves</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Pieter Colpaert</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Ruben Verborgh</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Erik Mannens</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>IDLab, Department of Electronics and Information Systems, Ghent University - imec</institution>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Ontology Engineering Group, Universidad Politécnica de Madrid</institution>
          ,
          <country country="ES">Spain</country>
        </aff>
      </contrib-group>
      <pub-date>
        <year>2017</year>
      </pub-date>
      <fpage>2</fpage>
      <lpage>5</lpage>
      <abstract>
        <p>Using Linked Data based approaches, public transport companies are able to share their time tables and its updates in an affordable way while allow- ing user agents to perform multimodal route planning algorithms. Providing time table updates, usually published as data streams, means that data is being constantly modified and in the presence of large analytical queries, results might be affected due to the changing data. In this demo we introduce a mecha- nism to tackle this problem by guaranteeing that a user agent will always re- ceive version based responses, therefore ensuring data consistency. Such mech- anism also enables access to historical data that could be used for deep analysis of transport systems. However, how this data shall be archived, in order to keep this approach scalable and inexpensive is still a matter of study. In a demonstra- tor, we published and query data from the Belgium national train system (SNCB) and Madrid Regional Transport Consortium (CRTM). This paper rep- resents the first step towards establishing an affordable framework to publish reliable transport data.</p>
      </abstract>
      <kwd-group>
        <kwd>Semantic Web</kwd>
        <kwd>Open Linked Data</kwd>
        <kwd>Linked Data Fragments</kwd>
        <kwd>Linked Connections</kwd>
        <kwd>public transit</kwd>
        <kwd>reliability</kwd>
        <kwd>content negotiation</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>
        Open Transport Data publishers, such as a public transport company, can share their
time tables and its updates for maximum reuse by studying the trade-offs introduced by
the Linked Data Fragments axis [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. Choosing a use-case specific fragmentation strategy,
can result in a cost-efficient data publishing interface while still being able to evaluate
queries. The Linked Connections (LC) framework [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ] enables third parties to develop
route planning algorithms that evaluate queries over different data sources, taking into
account multiple modes of transport (e.g., train, bus or tram). To achieve this, the server
interface only exposes a paged collection of an ordered public transit connections list.
      </p>
      <p>By updating these fragments, updates on the planned schedules can be handled through
the LC framework as well. However, this means that data is constantly changing and if
there is a large analytical query, its response might be affected in terms of reliability and
data consistency. When a client would thus issue a large query, the data processed at the
start of the query would be correct but might change at the end of the query evaluation.
This could turn query results unreliable or even inconsistent.</p>
      <p>To tackle this issue, this demo introduces a mechanism provide time-based versions of
data which ensures that a client will always get a true result for a given moment.
Furthermore, having time-based versions of data enables access to historic data, allowing
deep behavioral analysis of transport systems. We first describe the background, we then
describe the implementation details of our approach and finally we present the set-up of
our demonstrator.
In related work, the General Transit Feed Specification (GTFS)1 defines a set of rules to
describe a transport system schedules using a CSV format. To handle data updates,
GTFS-RT was introduced. In our approach we use GTFS and GFTS-RT feeds provided
by public transport agencies as input data for our system.</p>
      <p>
        A connection in the LC framework is defined as hop from one transit stop to another,
indicating location and time of departure, and location and time of arrival [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ]. Moreover,
to provide context to HTTP user agents and link the terms and identifiers of GTFS and
Connections to the Linked Open Data cloud, the Linked GTFS2 and LC3 ontologies were
introduced.
      </p>
      <p>
        The Memento Framework provides a mechanism to achieve a tighter integration
between the present and past Web [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ]. It introduces the datetime dimension for
contentnegotiation between a server and a client, allowing to access previous versions of a
resource. The latest version of a resource is defined as the original resource URI-R.
Previous versions of URI-R are defined as Mementos URI-Mi (i = 1...n). Memento defines
different patterns of implementation, on this approach we use Pattern 14 for simplicity,
but other patterns shall be studied in future work such as the one described in [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ].
The implementation for this demo was built on top of Node.JS and its source code is
available on GitHub5. Figure 1 portraits a modular architecture of the system where main
modules and their relations are presented.
      </p>
      <p>1https://developers.google.com/transit/gtfs/
2http://vocab.gtfs.org/terms
3http://semweb.datasciencelab.be/ns/linkedconnections#
4Memento is formally specified in RFC 7089 available at https://tools.ietf.org/rfc/rfc7089.txt
5https://github.com/julianrojas87/linked-connections-server
2/4
The Fetching Module, as its name implies, is in charge of fetching GTFS and GTFS-RT
feeds published by public transport agencies and converting them to LC sorted by
departure time.</p>
      <p>The Archiving Module takes the LC of transport agencies and stores a time-based
fragmentation of the data as paged files. Updates obtained from GTFS-RT feeds provide
data concerning specific connections. Every time table update is annotated with a
timestamp of the moment it was issued. Such annotation enables datetime based
contentnegotiation, as specified by Memento, to provide the state of connections at a certain
given time.
The Web Module is a Express.js based web server which handles HTTP queries for
connections with a given departure time. Once a query is received, the server retrieves the
corresponding LC fragment for the specified departure time, then it retrieves the available
updates at the time the query was issued for every connection in the fragment. This
ensures that the client will always receive the state of all connections at the moment it
issued its query, regardless of whether at the end of it, new data is already available.
Finally a web representation of the LC is created and serialized in JSONLD format,
containing links to other resources such as next and previous LC fragments using
hydra:nextPage6 and hydra:previousPage links. Furthermore, by using the
AcceptDatetime header, clients are able to query for connections status at a certain given time
enabling access to historic data. An HTTP Cache Server may be configured on top of the
LC Server in order to improve performance on recurrent queries.
A demonstrator performing long analytical queries, in need of data consistency, can be
viewed at http://tripscore.eu7. The application aims at presenting to the user a list
6hydra: is a prefix that can be expanded to https://www.w3.org/ns/hydra/core#
7Source code available at https://github.com/oSoc17/oasis-frontend/
3/4
of trip alternatives for a specific route, with a calculated quality score based on predefined
criteria such as maximum number of hops, acceptable delay times, minimum transfer
times and delay consistency8. The user can enter his/her preferences and query for a route
he/she frequently uses. The application will start querying for connections and will begin
to show alternatives to the user as it keeps processing the data. At the same time it will
show the amount of HTTP requests and responses handled and the number of LC
analyzed.</p>
      <p>In order to calculate the quality score of a trip and its delay consistency, the application
will query data spanning the last 5 weeks if available, demonstrating an use case for
historic data. As mentioned before, this demo publishes and allows to query data from the
Belgian railway company (SNCB) and Madrid transport system (CRTM).
In this demo we used the LC framework to publish and query public transport data in an
affordable way, and extended its capabilities by introducing a time based versioning
mechanism that ensures reliable and consistent responses to large analytical queries.
Furthermore, our approach also enables access to historical data that could be used to
perform different type of analysis as showcased by our demo which calculates delay
consistency over time for specific trips.</p>
      <p>This work represents a step forward towards a reliable and inexpensive mechanism to
publish public transport data that allows multimodal route planning and analysis of
historical data. However several issues still remain unattended such as studying the best
approach to store LC in a scalable way, finding the best way to fragment transport data
in order to improve performance of route planners and how the system may discover new
transport datasets reliably.</p>
      <p>8Refers to the behavior regarding delays for a specific connection during a given period of time.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Verborgh</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Hartig</surname>
            ,
            <given-names>O.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Meester</surname>
            ,
            <given-names>B.D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Haesendonck</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Vocht</surname>
            ,
            <given-names>L.D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Sande</surname>
            ,
            <given-names>M.V.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Cyganiak</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Colpaert</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Mannens</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Walle</surname>
          </string-name>
          , R.V.D.:
          <article-title>Querying Datasets on the Web with High Availability</article-title>
          .
          <source>The Semantic Web - ISWC 2014 Lecture Notes in Computer Science</source>
          .
          <volume>180</volume>
          -
          <fpage>196</fpage>
          (
          <year>2014</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Colpaert</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Llaves</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Verborgh</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Corcho</surname>
            ,
            <given-names>O.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Mannens</surname>
          </string-name>
          , E., Van de Walle, R.:
          <article-title>Intermodal public transit routing using Linked Connections</article-title>
          .
          <source>In: Proceedings of the 14th International Semantic Web Conference: Posters and Demos</source>
          (
          <year>2015</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3. Van de Sompel, H.,
          <string-name>
            <surname>Sanderson</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Nelson</surname>
            ,
            <given-names>M.L.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Balakireva</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Shankar</surname>
            ,
            <given-names>H.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ainsworth</surname>
            ,
            <given-names>S.:</given-names>
          </string-name>
          <article-title>An HTTP-based Versioning Mechanism for Linked Data</article-title>
          .
          <source>CoRR abs/1003</source>
          .3661 (
          <year>2010</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Sande</surname>
            ,
            <given-names>M.V.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Colpaert</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Nies</surname>
          </string-name>
          , T.D.,
          <string-name>
            <surname>Mannens</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Walle</surname>
          </string-name>
          , R.V.D.:
          <article-title>Publish data as time consistent web API with provenance</article-title>
          .
          <source>Proceedings of the 23rd International Conference on World Wide Web - WWW '14 Companion</source>
          . (
          <year>2014</year>
          ).
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>