<!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>Representing RDF Stream Processing Queries in RSP-SPIN</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Robin Keskisarkka</string-name>
          <email>robin.keskisarkka@liu.se</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Linkoping University</institution>
          ,
          <addr-line>Linkoping</addr-line>
          ,
          <country country="SE">Sweden</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>A number of RDF Stream Processing (RSP) systems have been developed to support processing of streaming Linked Data, however, due to the lack of a standard query language they all provide di erent extensions. The RSP Community Group1 is in the process of standardizing the RSP query language (RSP-QL), which incorporates many features from existing RSP languages. In this paper we present a demo showing how RSP-SPIN, a SPIN extension for RSP-QL, can be used to encapsulate RSP-QL queries as RDF, which can then be used to support serialization into multiple RSP languages. This can reduce the e ort required to produce and maintain queries for RSP benchmarks, since developers can focus on a single representation per query, and assist developers in combining or switching between di erent RSP engines.</p>
      </abstract>
      <kwd-group>
        <kwd>RDF Stream Processing</kwd>
        <kwd>RSP-QL</kwd>
        <kwd>RSP-SPIN</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction</title>
      <p>The amount of data published as online streams is increasing. While the streams
often contain structured or semi-structured data they are often represented using
non-standardized vocabularies and models. Semantic Web (SW) technologies
have the potential to make this heterogeneity manageable; however, traditional
SW technologies are optimized for performance on more or less static data, and
do not scale well when dealing with potentially unbounded streams.</p>
      <p>
        RDF Stream Processing (RSP) has been proposed as a way of bridging the
gap between static and streaming Linked Data [
        <xref ref-type="bibr" rid="ref10 ref11">11, 10</xref>
        ]. Inspired by technologies
dealing with similar challenges in other domains several RSP engine
implementations have been presented [1{3, 7, 9]. Most of the proposed systems have extended
SPARQL to support the de nition of sliding windows over RDF streams.
      </p>
      <p>
        The RSP Community Group2 is working on de ning a standard query
language for RSP (RSP-QL), and the current version of the abstract syntax and
semantics has already been described in some detail [
        <xref ref-type="bibr" rid="ref5 ref6">6, 5</xref>
        ]. While the query
syntax has yet to be de ned in detail the available example queries3, present a fairly
clear picture of what can be expected in a future standard.
      </p>
      <sec id="sec-1-1">
        <title>1 https://www.w3.org/community/rsp/</title>
      </sec>
      <sec id="sec-1-2">
        <title>2 ibid.</title>
      </sec>
      <sec id="sec-1-3">
        <title>3 See https://github.com/streamreasoning/RSP-QL/</title>
        <p>
          The diversity of RSP implementations, and their corresponding languages,
makes performance comparisons and switching between engines complicated.
General benchmarks, focusing on di erent aspects of RSP processing, have been
proposed [
          <xref ref-type="bibr" rid="ref12 ref4 ref8">4, 8, 12</xref>
          ], but comparisons also need to based on, for example, volume,
velocity, necessary query features, and response-time requirements de ned in
actual use cases. Developing and validating any type of non-trivial query in a
streaming context is usually both di cult and time-consuming. A major di
culty is that it is often not possible to predict the outcome of a query that is run
against streaming data. Developers often spend considerable time on generating
predicable data streams, or work against recorded data, to be able to compare
results with some expected outcome. Additionally, a query expressed for one
RSP engine is typically not compatible with another, and some validation step
is required for each version of a query.
        </p>
        <p>
          In this demo we show how RSP-SPIN, an extension of the SPIN
Modeling Vocabulary4, can be used to represent RSP-QL queries in RDF. The demo
shows how each query in the CSRBench [
          <xref ref-type="bibr" rid="ref4">4</xref>
          ] benchmark can be represented as an
RSP-QL query, and we demonstrate serializers from RSP-SPIN to CQELS [
          <xref ref-type="bibr" rid="ref7">7</xref>
          ],
C-SPARQL [
          <xref ref-type="bibr" rid="ref2">2</xref>
          ], and SPARQLstream [
          <xref ref-type="bibr" rid="ref3">3</xref>
          ].
2
        </p>
      </sec>
    </sec>
    <sec id="sec-2">
      <title>Architecture and Implementation</title>
      <p>Sharing and reusing queries is an important aspect in most contexts where people
need to interact with structured data. Many relational databases support some
form of stored procedures, which are ready-made parameterized queries that can
be instantiated by simply providing the required parameters. Storing queries in
such ways has several advantages compared to relying on the users to provide
the queries. For example, stored queries dramatically lower the threshold for
inexperienced users, can be used to protect against query injections, and to
support access control. Stored queries also means that users to not have to have
a detailed understanding of the underlying data models, or have any experience
in crafting queries themselves.</p>
      <p>The SPIN Modeling Vocabulary and the SPIN API was developed in part to
provide this functionality for Semantic Web applications. SPIN allows queries to
stored as RDF, and enables the representation of parameterized query templates,
where query variables can be bound to speci c values at runtime.</p>
      <p>RSP-SPIN extends the functionality of SPIN to model RSP-QL. Since
RSPQL is based on SPARQL the number of changes made to the base model of SPIN
is small, and most changes simply involve adding the appropriate properties,
classes, and keywords to support the additional concepts introduced in
RSPQL. This means that compatibility with standard SPIN can be maintained.</p>
      <p>RSP-SPIN and the RSP-SPIN API are released as open source5. The current
version has excluded a some features that have been up for discussion in the
RSP Group, which have yet to be discussed in su cient depth. In particular the</p>
      <sec id="sec-2-1">
        <title>4 https://www.w3.org/Submission/spin-modeling/</title>
      </sec>
      <sec id="sec-2-2">
        <title>5 https://github.com/keski/rsp-spin/</title>
        <p>excluded features include blank nodes for named graphs, and temporal patterns
for Complex Event Processing.</p>
        <p>The user interface provided for the demo can be seen in Figure 1. The queries
are represented as RSP-SPIN, which can be serialized into any of the supported
query languages. Activating the RSP-SPIN view displays the underlying RDF
model. The user interface does not support user-de ned parameters for
templates, but this is demonstrated in the prede ned queries and on the RSP-SPIN
homepage6.</p>
        <p>Switching between views displays the current query in di erent formats. The
user can pick one of the prede ned queries available in the drop-down menu at
the bottom, containing the full set of CSRBench queries. The list also includes
a few examples that illustrate the expressivity of RSP-QL and how the CQELS,
C-SPARQL, and SPARQLstream serializers handle unsupported RSP-QL
features. User de ned queries can be parsed from any view containing a parse
button. Pressing the button will pass the text to the web service, which will
attempt to create a template for that query. If successful the newly created query
will be loaded into the system and all views will be updated accordingly. The
live demo is available at http://ontology.ida.liu.se:8680/iswc/rsp-spin/.</p>
      </sec>
      <sec id="sec-2-3">
        <title>6 http://w3id.org/rsp/spin</title>
        <p>Acknowledgments This work was partially supported by the EU FP7 project
Visual Analytics for Sense-making in Criminal Intelligence Analysis (VALCRI)
under grant number FP7-SEC-2013-608142.</p>
      </sec>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Anicic</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Fodor</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Rudolph</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Stojanovic</surname>
          </string-name>
          , N.:
          <article-title>EP-SPARQL: A Uni ed Language for Event Processing and St ream Reasoning</article-title>
          .
          <source>In: Proceedings of the 20th International Conference on World Wide Web</source>
          (
          <year>2011</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Barbieri</surname>
            ,
            <given-names>D.F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Braga</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ceri</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Valle</surname>
            ,
            <given-names>E.D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Grossniklaus</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          :
          <article-title>Querying RDF streams with C-SPARQL</article-title>
          .
          <source>SIGMOD Record</source>
          <volume>39</volume>
          (
          <issue>1</issue>
          ),
          <volume>20</volume>
          {
          <fpage>26</fpage>
          (
          <year>2010</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Calbimonte</surname>
            ,
            <given-names>J.P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Corcho</surname>
            ,
            <given-names>O.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Gray</surname>
            ,
            <given-names>A.J.G.</given-names>
          </string-name>
          :
          <article-title>Enabling Ontology-based Access to Streaming Data Sources</article-title>
          .
          <source>In: Proceedings of the 9th International Semantic Web Conference on The Semantic Web { Volume Part I</source>
          . pp.
          <volume>96</volume>
          {
          <fpage>111</fpage>
          . ISWC'10,
          <string-name>
            <surname>SpringerVerlag</surname>
          </string-name>
          , Berlin, Heidelberg (
          <year>2010</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Dell'Aglio</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Calbimonte</surname>
            ,
            <given-names>J.P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Balduini</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Corcho</surname>
            ,
            <given-names>O.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Della Valle</surname>
          </string-name>
          , E.:
          <article-title>On Correctness in RDF Stream Processor Benchmarking</article-title>
          .
          <source>In: Proceedings of the 12th International Semantic Web Conference - Part II</source>
          . pp.
          <volume>326</volume>
          {
          <fpage>342</fpage>
          . ISWC '13, SpringerVerlag New York, Inc., New York, NY, USA (
          <year>2013</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Dell'Aglio</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Calbimonte</surname>
            ,
            <given-names>J.P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Valle</surname>
            ,
            <given-names>E.D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Corcho</surname>
            ,
            <given-names>O.</given-names>
          </string-name>
          :
          <article-title>Towards a Uni ed Language for RDF Stream Query Processing</article-title>
          . In: Gandon,
          <string-name>
            <given-names>F.</given-names>
            ,
            <surname>Gueret</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            ,
            <surname>Villata</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            ,
            <surname>Breslin</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.G.</given-names>
            ,
            <surname>Faron-Zucker</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            ,
            <surname>Zimmermann</surname>
          </string-name>
          ,
          <string-name>
            <surname>A</surname>
          </string-name>
          . (eds.)
          <source>ESWC (Satellite Events). Lecture Notes in Computer Science</source>
          , vol.
          <volume>9341</volume>
          , pp.
          <volume>353</volume>
          {
          <fpage>363</fpage>
          . Springer (
          <year>2015</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>Dell'Aglio</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <given-names>Della</given-names>
            <surname>Valle</surname>
          </string-name>
          ,
          <string-name>
            <given-names>E.</given-names>
            ,
            <surname>Calbimonte</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.P.</given-names>
            ,
            <surname>Corcho</surname>
          </string-name>
          ,
          <string-name>
            <given-names>O.</given-names>
            :
            <surname>RSP-QL Semantics</surname>
          </string-name>
          :
          <article-title>A Unifying Query Model to Explain Heterogeneity of RDF Stream Processing Systems</article-title>
          .
          <source>Int. J. Semant. Web Inf. Syst</source>
          .
          <volume>10</volume>
          (
          <issue>4</issue>
          ),
          <volume>17</volume>
          {44 (
          <year>October 2014</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>Le-Phuoc</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Dao-Tran</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Parreira</surname>
            ,
            <given-names>J.X.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Hauswirth</surname>
            ,
            <given-names>M.:</given-names>
          </string-name>
          <article-title>A Native and Adaptive Approach for Uni ed Processing of Linked Streams and Linked Data</article-title>
          .
          <source>In: Proceedings of the 10th International Conference on the Semantic Web</source>
          . pp.
          <volume>370</volume>
          {
          <issue>388</issue>
          (
          <year>2011</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <surname>Le-Phuoc</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Dao-Tran</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Pham</surname>
            ,
            <given-names>M.D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Boncz</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Eiter</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Fink</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          :
          <article-title>Linked Stream Data Processing Engines: Facts and Figures</article-title>
          .
          <source>In: Proceedings of the 11th International Conference on The Semantic Web - Volume Part II</source>
          . pp.
          <volume>300</volume>
          {
          <fpage>312</fpage>
          . ISWC'
          <volume>12</volume>
          , Springer-Verlag, Berlin, Heidelberg (
          <year>2012</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <surname>Rinne</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Nuutila</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          , Torma,
          <string-name>
            <surname>S.:</surname>
          </string-name>
          <article-title>INSTANS: High-Performance Event Processing with Standard RDF and SPARQL</article-title>
          .
          <source>In: Proceedings of the ISWC 2012 Posters and Demonstrations Track</source>
          . Boston, US (
          <year>2012</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <string-name>
            <surname>Sequeda</surname>
            ,
            <given-names>J.F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Corcho</surname>
            ,
            <given-names>O.</given-names>
          </string-name>
          :
          <article-title>Linked Stream Data: A Position Paper</article-title>
          .
          <source>In: Proceedings of the 2nd International Conference on Semantic Sensor Networks</source>
          . vol.
          <volume>522</volume>
          , pp.
          <volume>148</volume>
          {
          <fpage>157</fpage>
          . CEUR-WS.org, Aachen, Germany, Germany (
          <year>2009</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11.
          <string-name>
            <surname>Valle</surname>
            ,
            <given-names>E.D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ceri</surname>
          </string-name>
          , S., van
          <string-name>
            <surname>Harmelen</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Fensel</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          :
          <article-title>It's a Streaming World! Reasoning upon Rapidly Changing Information</article-title>
          .
          <source>IEEE Intelligent Systems</source>
          <volume>24</volume>
          (
          <issue>6</issue>
          ),
          <volume>83</volume>
          {
          <fpage>89</fpage>
          (
          <year>2009</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          12.
          <string-name>
            <surname>Zhang</surname>
            ,
            <given-names>Y.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Duc</surname>
            ,
            <given-names>P.M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Corcho</surname>
            ,
            <given-names>O.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Calbimonte</surname>
            ,
            <given-names>J.P.:</given-names>
          </string-name>
          <article-title>SRBench: A Streaming RDF/SPARQL Benchmark</article-title>
          .
          <source>In: Proceedings of the 11th International Conference on The Semantic Web</source>
          . pp.
          <volume>641</volume>
          {
          <fpage>657</fpage>
          . ISWC'
          <volume>12</volume>
          , Springer-Verlag, Berlin, Heidelberg (
          <year>2012</year>
          )
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>