<!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>Querying the Web On-the- y Using Ontologies and Mappings</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Konstantina Bereta</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>George Papadakis</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Manolis Koubarakis</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Konstantina.Bereta</institution>
          ,
          <addr-line>gpapadis, koubarak</addr-line>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>National and Kapodistrian University of Athens</institution>
        </aff>
      </contrib-group>
      <abstract>
        <p>Despite the rapidly increasing availability of open data as Linked Data on the Web, a lot of data is still published in other, non-RDF formats, such as HTML forms/tables, or via Rest APIs. To use this data as linked data, one would have to transform it into RDF triples and store them in a triple store every time a source gets updated. The rst OBDA/ RDB2RDF systems started to emerge recently, providing a solution for creating virtual RDF graphs on top of relational data using ontologies and mappings, such as Ontop [1], Ultrawrap [2] and Sparqlify1. In this work, we introduce a framework for extending existing OBDA techniques to support querying of data from di erent sources that are available on the Web, such as webtables and Rest APIs.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>mappingId webtable_rotten_tomatoes
target rot:{rank} rot:rank {rank}; rot:title {Title} .
source select rid as rank, Title from</p>
      <p>webtable('http://www.rottentomatoes.com/ top/bestofrt/', 3)
The mapping described above encodes how the attributes of the resulting
virtual table (i.e., title and rank in our example) are mapped into RDF terms.
In this way, users are able to pose queries that retrieve the rank and the title of
rotten tomatoes movies by querying the respective HTML table directly, using
SPARQL.
select distinct ?title
where { ?s rot:title ?title . ?s2 rot:rank ?rank }</p>
      <p>When a SPARQL query as the one described above is posed, it gets
translated into the respective SQL query that contains the virtual table operator that
corresponds to the data source (i.e., webtable). The operator populates the
virtual table with data and after the whole SQL query is evaluated the results are
returned as virtual RDF terms to the users.</p>
      <p>To improve performance, we allow the option to use cached data for a time
window w. If w is expired, fresh data needs to be retrieved. The length of w
is a parameter that can be con gured per mapping (i.e, di erent mappings can
access the same data source at di erent rates depending on the needs).</p>
      <p>
        Ontop4theWeb is based on the system Ontop2 [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ], a state-of-the-art,
opensource OBDA system that supports both R2RML and the OBDA mapping
language. More speci cally, it extends the geospatial extension of Ontop named
Ontop-spatial3 [3]. As back-end, it uses the MadIS4 [4] system, an extensible
relational database system built on top of the SQLite5 database that enables
users to implement user-de ned functions as virtual table operators.
      </p>
      <p>We have implemented virtual operators that access Twitter and Foursquare
APIs, and we have extended the MadIS webtable operator that retrieves data
from HTML tables.</p>
      <p>To evaluate our approach, we conducted experiments that involved SPARQL
queries that access di erent sources (Twitter API, Webtables) as well as
generated datasets (i.e, generated webtables to measure scalability) and we measured
the query execution time. Even in cases where no cache is used, Ontop4theWeb
can execute queries in a few seconds, whereas when the cache is used, queries are
executed in less than a second. The experiments also showed that Ontop4theWeb
is able to query webtables with up to 100,000 rows within minutes.
2 https://github.com/ontop/ontop
3 http://ontop-spatial.di.uoa.gr/
4 http://madgik.github.io/madis
5 http://www.sqlite.org
[2] Sequeda, J.F., Miranker, D.P.: Ultrawrap: SPARQL execution on relational
data. J. Web Sem. 22 (2013) 19{39
[3] Bereta, K., Koubarakis, M.: Ontop of Geospatial Databases. In: Proceedings
of the 15th International Semantic Web Conference. (2016)
[4] Chronis, Y., Foufoulas, Y., Nikolopoulos, V., et al: A Relational Approach
to Complex Data ows. In: EDBT/ICDT Workshops. (2016)</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <surname>Calvanese</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Cogrel</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Komla-Ebri</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kontchakov</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lanti</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Rezk</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Rodriguez-Muro</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Xiao</surname>
          </string-name>
          , G.:
          <article-title>Ontop: Answering SPARQL queries over relational databases</article-title>
          .
          <source>Semantic Web</source>
          <volume>8</volume>
          (
          <issue>3</issue>
          ) (
          <year>2017</year>
          )
          <volume>471</volume>
          {
          <fpage>487</fpage>
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>