<!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>SPARQLT and its User-Friendly Interface for Querying the History of RDF Knowledge Bases</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Shi Gaoy</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Muhao Cheny</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Maurizio Atzoriz</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Jiaqi Guy</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Carlo Zanioloy</string-name>
        </contrib>
      </contrib-group>
      <abstract>
        <p>As the real world evolves, the information contained in the knowledge bases is updated accordingly and the evolution history of entities and their properties becomes of great interest to users, who thus need effective query tools to explore it. In this paper, we (i) introduce SPARQLT and its user-friendly interface for expressing powerful structured queries on the history of RDF knowledge bases, and (ii) overview its underlying query engine that supports efficient evaluation of such queries and the management of historical information. To ensure ease of use, we take a by-example structured query approach that allows users to specify queries by entering simple conditions into the Infoboxes of Wikipedia pages extended with temporal fields. From this wysiwyg interface, the system derives and executes equivalent SPARQLT queries, sparing users from having to learn the query language and the underlying knowledge base schema. Our demo will introduce SPARQLT, its system and user-friendly interface, with the help of simple and intuitive examples.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>
        There is a growing interest in large scale knowledge bases such as DBpedia and Yago,
which play a key role in semantic applications. In reality, large knowledge bases
undergo frequent changes. When the information in the real world evolves, the RDF triples
stored in the knowledge bases are updated to reflect those changes. The evolution
history of knowledge bases captures and describes the changes experienced by real world
entities and properties, which is of great interest to users. As a result, the management
of historical information has emerged as a critical problem for RDF knowledge bases,
motivating the launching of projects such as DBpedia Live [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ].
      </p>
      <p>
        In the project described in this paper, we collect the evolution history of knowledge
bases and store it in the temporal RDF model [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ]. Then we introduce SPARQLT, a
temporal extension of SPARQL that can express powerful structured queries on temporal
RDF triples and describe our efficient in-memory query engine. The most significant
contribution of SPARQLT is that it solves the Usability and Performance problems that
must be tackled when querying the evolution history of knowledge bases. For usability,
we demonstrate a query interface that allows users who are unfamiliar with knowledge
base schema and SPARQLT syntax to query the history of knowledge bases. The
interface uses the Wikipedia Infoboxes extended with temporal fields, where the user can
enter temporal query conditions. From the modified Infoboxes and query conditions,
Predicate
      </p>
      <p>Mayor
Population</p>
      <p>Object
Bob Filner</p>
      <p>Todd Gloria
Kevin Faulconer
1322553
1307402
1345895
1381069</p>
      <p>Timestamp
12/04/2012 . . . 08/30/2013
08/31/2013 . . . 03/02/2014</p>
      <p>03/03/2014 . . . now
12/19/2012 . . . 10/01/2013
10/02/2013 . . . 04/29/2014
04/30/2014 . . . 05/21/2015
05/22/2015 . . . now</p>
      <p>Q1: SELECT ?t
fSan Diego Mayor Todd Gloria ?tg
Q2: SELECT ?person
fSan Diego Mayor ?person ?t
FILTER(YEAR(?t) = 2013)g
Q3: SELECT ?pop ?t
fSan Diego Mayor Bob Filner ?t .</p>
      <p>
        San Diego Population ?pop ?tg
our system derives equivalent queries that are optimized and executed in our query
engine. To achieve fast query evaluation, we used efficient storage and index schemes for
temporal RDF triples based on Multi-Version B+ Tree (MVBT) [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ], and built a query
engine that takes full advantage of comprehensive indices to process SPARQLT queries.
2
      </p>
    </sec>
    <sec id="sec-2">
      <title>Data Model and Query Language</title>
      <p>
        Knowledge bases can be represented as RDF graphs which consist of a set of RDF
triples in the format of (subject, predicate, object), where subject and predicate are
Uniform Resource Identifiers (URI), and object can be a URI or a literal value. For
example, the statement “The mayor of San Diego is Kevin Faulconer” is represented by:
(San Diego Mayor Kevin Faulconer).1 Since the basic RDF graphs are designed for
static information, we represent the evolution history of RDF knowledge bases using the
temporal RDF graphs proposed in [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ] that rely on a point-based temporal representation.
Given a temporal domain T , a Temporal RDF Graph consists of a set of RDF triples
annotated with temporal elements t 2 T . Figure 1 shows the temporal RDF triples for
the evolution history of subject San Diego, extracted from real world Wikipedia edit
history. We use DAY as the granularity of time and now as current time.
      </p>
      <p>To query such temporal RDF graphs, we propose SPARQLT that extends SPARQL
query pattern with a temporal element to match the temporal RDF triples. The SPARQLT
query patterns are quadruplets fs p o tg, where each element is either a literal or a
variable. Thus, a SPARQLT query is a set of SPARQLT query patterns annotated with
temporal conditions, such as those for the basic operators discussed next.</p>
      <p>Temporal Selection. We start from temporal selection queries with one SPARQLT
query pattern. A typical example is the “when” query. By specifying s, p, o as literals
and leaving t as a variable, users can retrieve the valid timestamps of given facts. This
is the case of Q1 in Figure 1 that finds when Todd Gloria served as the mayor of San
Diego. The SPARQLT query pattern also allows users to perform RDF triple matching
with temporal constraints (e.g., at a previous version or within a certain period), such
as Q2 in Figure 1 which returns the mayor of San Diego in 2013.</p>
      <p>Temporal Join. Another important query class is temporal join query. In SPARQLT,
a temporal join is expressed by multiple query patterns sharing temporal elements, i.e.
days in our examples since this is the granularity of our point-based representation. An
example of temporal join query is Q3 in Figure 1 that returns the population of San
Diego when Bob Filner served as the mayor.
1 For the sake of simplicity, we omit the prefix parts of URIs (e.g. http://dbpedia.org/resource/).</p>
      <p>(a) (b)</p>
      <p>Fig. 2. (a) Query Interface (b) Navigation Window for Property Mayor</p>
      <p>
        The temporal constraints are expressed in the FILTER clause. We support a set
of built-in functions including TSTART/TEND, YEAR/MONTH/DAY and PERIOD.
With these functions, SPARQLT readily expresses complex temporal conditions and
Allen’s operations [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ]. For example, the MEET operatrion is expressed with constraint
TEND(?t1) = TSTART(?t2). More features and query examples are discussed in [
        <xref ref-type="bibr" rid="ref2 ref6">2, 6</xref>
        ].
      </p>
      <p>
        These examples illustrate that the point-based temporal model leads to queries that
are simple to express using SPARQLT . This property is not shared by other approaches [
        <xref ref-type="bibr" rid="ref10 ref7 ref9">7,
9, 10</xref>
        ] that have been proposed to support the queries on temporal RDF. In particular, the
languages proposed in these works use the interval-based temporal model which leads
to complex expressions for temporal queries requiring join and coalescing [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ].
Because of lack of space, we refer our reader to the full paper [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] for a detailed discussion
of the various approaches with respect to usability and performance.
3
      </p>
    </sec>
    <sec id="sec-3">
      <title>User Interface and Query Engine</title>
      <p>Our system consists of two main components: (i) a user interface that enables users to
browse and search the knowledge and its history, and (ii) the SPARQLT query engine
that manages the temporal data and evaluates SPARQLT queries.</p>
      <p>
        User Interface. Our system provides a user-friendly interface that addresses the
problem of usability by extending the By-Example Structured Query (BEStQ) [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ] approach
with editable temporal fields. The interface supports (i) querying the current knowledge
base and its history and (ii) browsing the history of entities and properties. Our user
who wants to find the population of San Diego when Bob Filner served as the mayor,
might start by loading subject San Diego in our interface, as shown in Figure 2(a). Since
all the fields are editable, he enters “Bob Filner” in the Government Mayor and variable
“?population” in City Population and these two InfoBoxes are set with the same
temporal variable “?t” to indicate the temporal join. Then our system generates and executes
SPARQLT query Q3 in Figure 1.
      </p>
      <p>Our system also provides navigation toolbars so that users can browse the history of
entities and properties. For example, if the user clicks on a property, the interface will
show a navigation window where the user can see the property type and its history and
specify temporal conditions, as shown in Figure 2(b). The interface is implemented as
middleware systems on Wikipedia.</p>
      <p>Query Engine. In our system, the temporal RDF triples are stored using in-memory
MVBT indices that support fast range query processing. Taking a SPARQLT query, we
first parse the query and generate an execution plan in which every SPARQLT query
pattern is converted into a query pattern (k, i) on MVBT to retrieve all the temporal
RDF triples with keys in range k and intervals overlapping interval i. A hybrid method
combining dictionary based compression and prefix encoding is adopted to reduce the
storage overhead of indices. The algorithms on MVBT are extended and optimized to
exploit the characteristics of the compression scheme and query patterns.</p>
      <p>
        Our query engine is implemented in Java and evaluated on the Wikipedia Infobox
History (38.5 million triples). We compare the query performance of our
implementation with (i) the reification approach using Jena and (ii) the SQL-based approach using
MySQL memory engine. The test query set contains 20 temporal selection and temporal
join queries, as those in Figure 1. In our implementation, the average execution times
for temporal selection and temporal join queries are 5 and 41 milliseconds respectively.
On average, our approach is 1 order of magnitude faster than the SQL-based approach
and 2 orders of magnitude faster than the reification approach. Interested readers are
referred to [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] for more details on the implementation and experiments.
4
      </p>
      <p>
        Demonstrating SPARQLT
The conference participants attending our demo will be able to explore structured
knowledge bases and their history in a simple and intuitive way. The demonstration starts with
a brief introduction of our system, followed by a hands-on phase in which the
participants can ask interesting queries on the history of people and places they are familiar
with, and test the performance of our query engine. We prepare two real world datasets:
Wikipeda Infobox History and GovTrack, with 38.5 million and 22 million temporal
RDF triples respectively. A tutorial video is available in [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ], as well as complete syntax
of SPARQLT and more query examples.
      </p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <given-names>DBpedia</given-names>
            <surname>Live</surname>
          </string-name>
          . http://live.dbpedia.org/.
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <given-names>Example</given-names>
            <surname>Queries</surname>
          </string-name>
          &amp; Tutorial Video. http://yellowstone.cs.ucla.edu/sparqlt-demo/index.html.
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <given-names>J. F.</given-names>
            <surname>Allen</surname>
          </string-name>
          .
          <article-title>Maintaining knowledge about temporal intervals</article-title>
          .
          <source>Commun. ACM</source>
          ,
          <volume>26</volume>
          (
          <issue>11</issue>
          ):
          <fpage>832</fpage>
          -
          <lpage>843</lpage>
          , Nov.
          <year>1983</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <given-names>M.</given-names>
            <surname>Atzori</surname>
          </string-name>
          and
          <string-name>
            <given-names>C.</given-names>
            <surname>Zaniolo</surname>
          </string-name>
          . Swipe:
          <article-title>Searching wikipedia by example</article-title>
          .
          <source>In WWW</source>
          , pages
          <fpage>309</fpage>
          -
          <lpage>312</lpage>
          ,
          <year>2012</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <given-names>B.</given-names>
            <surname>Becker</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Gschwind</surname>
          </string-name>
          , et al.
          <article-title>An asymptotically optimal multiversion b-tree</article-title>
          .
          <source>VLDB</source>
          ,
          <volume>5</volume>
          (
          <issue>4</issue>
          ):
          <fpage>264</fpage>
          -
          <lpage>275</lpage>
          , Dec.
          <year>1996</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <given-names>S.</given-names>
            <surname>Gao</surname>
          </string-name>
          and
          <string-name>
            <given-names>C.</given-names>
            <surname>Zaniolo</surname>
          </string-name>
          .
          <article-title>Sparqlt: A fast, user-friendly system for querying the history of rdf knowledge bases</article-title>
          .
          <source>CSD Technical Report #150004</source>
          ,
          <string-name>
            <surname>UCLA</surname>
          </string-name>
          ,
          <year>2015</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <given-names>F.</given-names>
            <surname>Grandi</surname>
          </string-name>
          .
          <article-title>T-sparql: a tsql2-like temporal query language for rdf</article-title>
          .
          <source>In International Workshop on on Querying Graph Structured Data</source>
          , pages
          <fpage>21</fpage>
          -
          <lpage>30</lpage>
          ,
          <year>2010</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <given-names>C.</given-names>
            <surname>Gutierrez</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C. A.</given-names>
            <surname>Hurtado</surname>
          </string-name>
          , et al.
          <article-title>Introducing time into rdf</article-title>
          .
          <source>TKDE</source>
          ,
          <volume>19</volume>
          (
          <issue>2</issue>
          ):
          <fpage>207</fpage>
          -
          <lpage>218</lpage>
          ,
          <year>2007</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <given-names>A.</given-names>
            <surname>Pugliese</surname>
          </string-name>
          ,
          <string-name>
            <given-names>O.</given-names>
            <surname>Udrea</surname>
          </string-name>
          , et al.
          <article-title>Scaling rdf with time</article-title>
          .
          <source>In WWW</source>
          , pages
          <fpage>605</fpage>
          -
          <lpage>614</lpage>
          ,
          <year>2008</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <string-name>
            <given-names>J.</given-names>
            <surname>Tappolet</surname>
          </string-name>
          and
          <string-name>
            <given-names>A.</given-names>
            <surname>Bernstein</surname>
          </string-name>
          .
          <article-title>Applied temporal rdf: Efficient temporal querying of rdf data with sparql</article-title>
          .
          <source>In ESWC</source>
          , pages
          <fpage>308</fpage>
          -
          <lpage>322</lpage>
          ,
          <year>2009</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11.
          <string-name>
            <given-names>X.</given-names>
            <surname>Zhou</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Wang</surname>
          </string-name>
          , et al.
          <article-title>Efficient temporal coalescing query support in relational database systems</article-title>
          .
          <source>In DEXA</source>
          , pages
          <fpage>676</fpage>
          -
          <lpage>686</lpage>
          ,
          <year>2006</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>