<!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>Ontology-Based Event Detection for Wastewater Treatment</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Yi Sun</string-name>
          <email>yi.sun@griffith.edu.au</email>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Zhe Wang</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Kewen Wang</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Griffith University</institution>
          ,
          <addr-line>Brisbane</addr-line>
          ,
          <country country="AU">Australia</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>Event detection systems can help detecting incidents of interest that occur within data streams generated by interconnected sensor devices. Corresponding personnel need to be notified about the incidents so that appropriate actions can be taken to address them. One of the typical use cases of event detection systems is monitoring the quality of recycling water during wastewater treatment. Existing event detection systems in this domain usually focus on dealing with low level primitive events and thus are not capable of detecting more complex events which contain relations and background knowledge. In this paper, we present a framework for detecting complex events with background knowledge in event streams, by using ontology and query rewriting techniques.</p>
      </abstract>
      <kwd-group>
        <kwd>wastewater</kwd>
        <kwd>ontology</kwd>
        <kwd>event detection</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>In today’s business environment, complex events occurs in real time and companies
can benefit from efficient real-time processing of data streams generated by
interconnected sensor devices to discover such complex events. However, some
complex events cannot be described using low-level event detection rules based on
pattern-matching. The definition of such events usually requires domain expertise and
background knowledge. Using ontology and rules to model complex events
significantly enhances the accuracy of detecting such events. One of the use cases is
monitoring the quality of recycled wastewater, where the water quality is monitored
using sensing devices. A system that is capable of detecting complex events can
provide an early indication of water quality changes, for relevant personnel to take
appropriate actions to adjust the water treatment accordingly.</p>
      <p>
        Existing stream modeling ontologies such as the SSN/SOSA [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] ontology are
based on RDF(S) and are limited in their expressive power. To model complex events
in the wastewater scenario, more expressive OWL ontologies and a framework that
supports such ontologies are required. Also, while some system incorporates
ontological reasoning with stream processing such as SANSA Stack [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ], its inference
is achieved via expanding the data by ontology, which is ineffective in handling large
data streams. Hence, an alternative ontological reasoning approach is needed for event
detection.
      </p>
      <p>In this paper, we present a framework for detecting complex events with rich
background knowledge over event streams, by using ontology and query rewriting
techniques. We evaluate the performance of our framework and event detection using
historical time-series data collected from one of the wastewater treatment plant in
Australia and queries representing common water-quality-change events.</p>
    </sec>
    <sec id="sec-2">
      <title>Our Framework</title>
      <p>
        Our framework contains three components highlighted in blue in Figure 1. Sensor
data flow into the framework as streams, and the ontology component validates and
transforms the data into a format which streaming component can process. Users
specify the events of interest as a set of queries Q. The query rewriting component
rewrites Q into a more complicated query Q ’ based on the ontology model, and then
delivers the transformed query Q ’ to streaming component. Finally, the transformed
data run through Q ’ at the streaming component and the events of interest are
detected through query answering. The framework was designed to be modular, so
that each component can cater for different technologies.
axioms to create more specific queries from the original most general query [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ]. A set
of queries are created based on ontology axioms, and then evaluated directly over the
data (independent from the ontology). The answers to the rewritten queries are as if
the ontology were consulted during the querying [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ].
      </p>
      <p>For example, users may want to ask ‘What time does an event of interest occur
at which barrier of the treatment plant A?’ This question is translated to the below
SPARQL query:
SELECT ?t ?b ?s WHERE {</p>
      <p>?s a Barrier; name ?b; hasEvent [a ComplexWaterEvent] .</p>
      <p>FILTER (?s hasName ‘A’)}
Axiom: IndustryDischarge subClassOf ComplexWaterEvent
After query rewriting based on the ontology axiom (i), query (1) is transformed into
SELECT ?t ?b ?s WHERE {
{?s a Barrier; name ?b; hasEvent [aComplexWaterEvent]} UNION
{?s a Barrier; name ?b; hasEvent [a IndustryDischarge]}
FILTER(?s hasName ‘A’)}
The component was designed to be modular so that any query rewriting tools can be
used in the component. The original queries Q are transformed into Q ’ after
rewriting, and then propagated to the streaming component.</p>
      <p>The streaming component is the place where incoming streams of the
transformed data meets the rewritten query Q ’. There are several candidates which
are suitable to use as our streaming component, such as Apache Spark, Storm etc. An
alert is generated as output of this component, once an event of interest is detected.</p>
    </sec>
    <sec id="sec-3">
      <title>3 Evaluation</title>
      <p>We tested our framework in the wastewater domain, using historical time series data
collected from one of the wastewater treatment plant in Australia. The original data
was in CSV format which consists total number of 79306 individual records. We first
simulated the streaming data using a small program which reads the CSV file and
ingest each record at speed of 30 seconds interval per record. Then, we added 2 extra
classes which defines 3 types of complex events, ‘Industry Discharge’, ‘Heavy
Rainfall’ and ‘Plant Fault’ in the wastewater domain to our original ontology. These
3 complex events are our targets to be discovered during the evaluation of our
framework. The ontology we used in this test is depicted in Figure 2.</p>
      <p>
        For the query rewriting component, we adopted Ontop [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ] to perform the
rewriting process. Ontop was primarily designed to query relational database using
query rewriting technologies [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ]. While SANSA Stack [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ] has an inference module
which can also perform query answering, it is done through expanding data by
ontology axioms instead of query rewriting, which is ineffective for processing data
(1)
(i)
(2)
streams.¹ Lastly, we have chosen Apache Flink as our streaming component for its
stateful computation and the abilities to process data stream distributively. SANSA
Stack [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ] was also used to read the ‘transformed data’ into Flink and query the final
results. As expected, we have successfully detected 11 ‘Industry Discharge’ events, 1
‘Plant Fault’ event and 4 ‘Heavy Rainfall’ events in the sample dataset.
      </p>
    </sec>
    <sec id="sec-4">
      <title>4 Conclusion</title>
      <p>In this paper, we presented an ontology based framework to detect meaningful event
and evaluated it using data collected from wastewater treatment process. Our system
provides a innovative way for event detection in the water monitoring domain. In our
future work, we would be focusing on reducing the system raw data conversion time,
as well as enhancing the ability of detect multiple and more complex events.
¹ Although the latest release notes claim that Ontop has been incorporated, but it seems query rewriting has
not been fully implemented.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <given-names>Semantic</given-names>
            <surname>Sensor Network</surname>
          </string-name>
          <article-title>Ontology [WWW Document]</article-title>
          , n.d. URL https://www.w3.org/TR/vocab-ssn
          <source>/ (accessed 6.16.19).</source>
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Lehmann</surname>
            , J.; Sejdiu,
            <given-names>G.</given-names>
          </string-name>
          ;
          <string-name>
            <surname>Bühmann</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          ;
          <string-name>
            <surname>Westphal</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ;
          <string-name>
            <surname>Stadler</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ;
          <string-name>
            <surname>Ermilov</surname>
            ,
            <given-names>I.</given-names>
          </string-name>
          ; Bin,
          <string-name>
            <surname>S.</surname>
          </string-name>
          ; Chakraborty,
          <string-name>
            <given-names>N.</given-names>
            ;
            <surname>Saleem</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            ;
            <surname>Ngonga</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.-C. N.</given-names>
            &amp;
            <surname>Jabeen</surname>
          </string-name>
          ,
          <string-name>
            <surname>H.</surname>
          </string-name>
          (
          <year>2017</year>
          ),
          <article-title>Distributed Semantic Analytics using the SANSA Stack</article-title>
          , in 'Proceedings of 16th International Semantic Web Conference - Resources
          <string-name>
            <surname>Track</surname>
          </string-name>
          (ISWC'
          <year>2017</year>
          )' , Springer, , pp.
          <fpage>147</fpage>
          --
          <lpage>155</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Rodríguez-Muro</surname>
          </string-name>
          , Mariano &amp; Calvanese, Diego. (
          <year>2012</year>
          ).
          <article-title>Quest, a System for Ontology Based Data Access</article-title>
          .
          <source>CEUR Workshop Proceedings. 849.</source>
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Rodríguez-Muro</surname>
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kontchakov</surname>
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Zakharyaschev</surname>
            <given-names>M.</given-names>
          </string-name>
          (
          <year>2013</year>
          )
          <article-title>Ontology-Based Data Access: Ontop of Databases</article-title>
          . In: Alani H. et al. (eds) The Semantic Web - ISWC
          <year>2013</year>
          .
          <source>ISWC 2013. Lecture Notes in Computer Science</source>
          , vol
          <volume>8218</volume>
          . Springer, Berlin, Heidelberg
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>