<!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>Datalog-based Reasoning for Knowledge Graphs</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Luigi Bellomarini</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Georg Gottlob</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Emanuel Sallinger</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Banca d'</institution>
          <country country="IT">Italia</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>University of Oxford</institution>
        </aff>
      </contrib-group>
      <abstract>
        <p>This is a short abstract based on the recently published VLDB 2018 paper [6] - the main technical paper describing the Vadalog system. It describes the central motivations and gives useful pointers on the architecture and the main algorithms.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>Introduction and motivation. The importance of capitalizing and exploiting corporate
knowledge has been clear to decision makers since the late 1970s, when this idea was
gradually made concrete in the context of expert systems, software frameworks able to
harness such knowledge and provide answers to structured business questions. Through
deductive database systems – database systems that have advanced reasoning
capabilities – and in particular the language Datalog, the area became of high interest to the
database community in the 1980s and 1990s. Nevertheless, even though the importance
of harnessing knowledge certainly has grown steadily since then, culminating in today’s
desire of companies to exploit knowledge graphs, the interest in deductive databases has
faltered due to immature technology and overly complicated KRR formalisms.</p>
      <p>
        Yet, we are currently assisting to a resurgence of Datalog in academia and industry
[
        <xref ref-type="bibr" rid="ref1 ref10 ref4 ref7 ref8 ref9">1, 4, 7–10</xref>
        ]: companies like LogicBlox have proven that a fruitful exchange between
academic research and high-performance industrial applications can be achieved based
on Datalog [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ], and companies like LinkedIn have shown that the interest in Datalog
permeates industry [
        <xref ref-type="bibr" rid="ref16">16</xref>
        ]. Meanwhile, the recent interest in machine learning brought
renewed visibility to AI, raising interest and triggering investments in thousands of
companies world-wide, which suddenly wish to collect, encapsulate and exploit their
corporate knowledge in the form of a knowledge graph.
      </p>
      <p>In this context, it has been recognized that to handle the complex knowledge-based
scenarios encountered today, such as reasoning over large knowledge graphs,
Datalog has to be extended with features such as existential quantification. Yet,
Datalogbased reasoning in the presence of existential quantification is in general undecidable.
Many e orts have been made to define decidable fragments. Warded Datalog is a very
promising one, as it captures PTIME complexity while allowing ontological reasoning.
Yet, so far, no implementation of Warded Datalog was available.</p>
      <p>
        We recently introduced the Vadalog system, a Datalog-based system for performing
complex logic reasoning tasks, such as those required in advanced knowledge graphs;
it is Oxford’s contribution to the VADA research programme [
        <xref ref-type="bibr" rid="ref13 ref18">18, 13</xref>
        ], a joint e ort of
the universities of Oxford, Manchester and Edinburgh and around 20 industrial partners
such as Facebook, BP, and the NHS (UK national health system). The Vadalog system
proposes the first implementation of Warded Datalog , a high-performance Datalog
system utilising an aggressive termination control strategy. In this paper, we summarise
the key aspects of the Vadalog system, while pointing to the original technical paper for
the details and a comprehensive experimental evaluation.
      </p>
      <p>
        Reasoning over knowledge graphs. The term knowledge graph (KG) has no standard
definition. It can be seen as referring only to Google’s Knowledge Graph, to triple-based
models, or to multi-attributed graphs, which represent n-ary relations [
        <xref ref-type="bibr" rid="ref15 ref17">15, 17</xref>
        ]. As shown
by Kro¨tzsch [
        <xref ref-type="bibr" rid="ref14">14</xref>
        ], in order to support rule-based reasoning on such data structures, it
is sometimes necessary to use tuples of arity higher than three at least for intermediate
results. In this paper, we adopt a general notion of KGs by allowing relations of arbitrary
arity, to support all of these models and modes of reasoning.
      </p>
      <p>
        Example 1. An example of a simple knowledge graph reasoning setting is given in [
        <xref ref-type="bibr" rid="ref15">15</xref>
        ]:
      </p>
      <p>Spouse(x; y; start; loc; end) ! Spouse(y; x; start; loc; end)
This rule expresses that when a person x is married to a person y at a particular location,
starting date and end date, then the same holds for y and x. That is, the graph of persons
and their marriage relations is symmetric.</p>
      <p>
        As stated in [
        <xref ref-type="bibr" rid="ref15">15</xref>
        ], most modern ontology languages are not able to express this
example. Beyond this simple example, there are numerous requirements for a system that
allows ontological reasoning over KGs. Navigating graphs is impossible without
powerful recursion; ontological reasoning is impossible without existential quantification
in rule heads [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ]. Yet reasoning with recursive Datalog is undecidable in the presence
of existential quantification, so some tradeo s have to be accepted. While a
comprehensive analysis of various requirements was given in [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ], let us isolate three concrete
characteristics for a language that supports reasoning over KGs:
1. Recursion over KGs. Should be at least able to express full recursion and joins,
i.e., should at least encompass Datalog. Full recursion in combination with arbitrary
joins allows to express complex reasoning tasks over KGs. Navigational capabilities,
empowered by recursion, are vital for graph-based structures.
2. Ontological Reasoning over KGs. Should at least be able to express SPARQL
reasoning under the OWL 2 QL entailment regime and set semantics. OWL 2 QL is one
of the most adopted profiles of the Web Ontology Language, standardized by W3C.
3. Low Complexity. Reasoning should be tractable in data complexity. This is a
minimal requirement for allowing scalability over large volumes of data.
      </p>
      <p>
        Beyond these specific requirements, the competition between powerful recursion,
powerful existential quantification and low complexity has spawned fruitful research
throughout the community to address the mentioned Datalog undecidability in the presence of
existential quantification. This has been done under a number of di erent names, but
which we shall here call Datalog , the “+” referring to the additional features (including
existential quantification), the “-” to restrictions that have to be made to obtain
decidability. Many languages within the Datalog family of languages have been proposed
and intensively investigated [
        <xref ref-type="bibr" rid="ref10 ref2 ref3 ref7 ref8 ref9">2, 3, 7–10</xref>
        ]. Depending on the syntactic restrictions, they
achieve a di erent balance between expressiveness and computational complexity.
      </p>
      <p>
        Figure 1 gives an overview of the main Datalog languages. In fact, most of these
candidates, including Linear Datalog , Guarded Datalog , Sticky Datalog and Weakly
Sticky Datalog do not fulfil (1). Datalog itself does not fulfil (2). Warded and Weakly
Frontier Guarded Datalog satisfy (1) and (2), thus are expressive enough. However,
the expressiveness of Weakly Frontier Guarded Datalog comes at the price of it being
EXPTIME-complete [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ]. Thus it does not fulfil (3). Thus, in total, the only known
language that satisfies (1), (2) and (3) is Warded Datalog . Yet, while Warded Datalog
has very good theoretical properties, the algorithms presented in [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ] are
alternatingtime Turing machine algorithms, far away from a practical implementation.
      </p>
      <p>
        Before summarising the characteristics of the Vadalog system, let us propose an
example of a Datalog program, which we consider representative of the complexity of
a typical reasoning setting involving KGs. The example is at the same time close to a
classical scenario [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ] as well as relevant for an application of the KG of one of our
current industrial partners; in particular, for detecting specific risks related to issuers or
guarantors for funds that are non-eligible due to their financing arrangement: in Europe
there is prohibition on guaranteed debt instruments issued by a “closely-linked entity”.
Example 2. Consider a set of rules about ownership relationships among a large number
of companies. The extensional knowledge is stored in a database in the form of tuples
of a relation Own(comp1; comp2; w): company comp1 directly owns a fraction w of
company comp2, with 0 w 1. In addition, with a set of two rules, we intensionally
represent the concept of company control (also studied in [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ]): a company x controls
a company y if company x directly owns more than half of the shares of company y or
if x controls a set S of companies that jointly own more than half of y. Note that the
msum operator, i.e., aggregation in the form of monotonic sum, is not a standard feature
of Datalog, but an extension that some Datalog-based systems support [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ].
      </p>
      <p>Control(x; x):</p>
      <p>Own(x; y; w); w &gt; 0:5 ! Control(x; y)</p>
      <p>
        Control(x; y); Own(y; z; w); v = msum(w; hyi); v &gt; 0:5 ! Control(x; z):
Here, for fixed x, the aggregate construct msum(w; hyi) forms the sum over all values w
such that for some company y, Control(x; y) is true, and Own(y; z; w) holds, i.e.,
company y directly owns fraction w of company z. Now, with the described knowledge
graph, many questions can be asked, such as: (i) obtain all the pairs (x; y) such that
company x controls company y; (ii) which companies are controlled by x? Which
companies control x? (iii) does company x control company y?
The Vadalog system. The Vadalog system is built around the Vadalog language, with
Warded Datalog as its logical core. It is currently used as the core deductive database
system of the overall Vadalog Knowledge Graph Management System described in [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ],
as well as at various industrial partners, including the finance, security, and media
intelligence industries. The main contributions are:
– A novel analysis of Warded Datalog , which culminates in the first practical
algorithm for Warded Datalog . In the Vadalog system, the core principle behind the
reasoning process is performing an aggressive termination control, which amounts
to adopting dynamic programming strategies to preempt the generation of already
explored areas of the KG as well as isomorphic ones, guaranteeing at the same time
termination (as the fragment is decidable) and e ciency (as all the “informative”
KG areas can be explored in PTIME). To achieve this goal, it is essential to
recognise these KG areas as early as possible.
      </p>
      <p>While the na¨ıve solution would imply a full caching of all the generated facts, the
challenge here is guaranteeing limited memory footprint. We identify a number of
guide data structures that closely exploit the underpinnings of Warded Datalog and
allow to abstract large KG areas by means of single representative facts (or patterns
thereof). More in particular, we propose structures that play a complementary role for
exploiting the periodicity of the KG: warded forest, which actually allows vertical
pruning of isomorphic trees based on root isomorphism, and (lifted) linear forest,
which allows horizontal pruning of entire pattern-isomorphic trees.
– A system and architecture that implements this algorithm in a relational
databaseinspired operator pipeline architecture. The pipeline’s operators rely on termination
strategy wrappers which transparently prevent the generation of facts that may lead
to non-termination while ensuring the correctness of the result. The system is
completed by a wide range of standard and novel optimisation techniques such as the
dynamic construction of in-memory indices, stream-optimized “slot machine” joins,
monotonic aggregation, materialization points, etc.
– The technical paper also presents a full-scale experimental evaluation of the
Vadalog system on a variety of real-world and synthetic scenarios that thoroughly validate
the e ectiveness of our techniques on Warded Datalog in absolute terms and
comparatively with the top existing systems, which are outperformed by our reasoner.
Acknowledgements. This work is supported by the EPSRC programme grant VADA
EP/M025268/1, the Vienna Science and Technology Fund (WWTF) grant VRG18-013,
and the EU Horizon 2020 grant 809965.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <given-names>M.</given-names>
            <surname>Aref</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B.</given-names>
            ten
            <surname>Cate</surname>
          </string-name>
          , T. J.
          <string-name>
            <surname>Green</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          <string-name>
            <surname>Kimelfeld</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          <string-name>
            <surname>Olteanu</surname>
            , E. Pasalic,
            <given-names>T. L.</given-names>
          </string-name>
          <string-name>
            <surname>Veldhuizen</surname>
            , and
            <given-names>G.</given-names>
          </string-name>
          <string-name>
            <surname>Washburn</surname>
          </string-name>
          .
          <article-title>Design and implementation of the LogicBlox system</article-title>
          .
          <source>In SIGMOD</source>
          , pages
          <fpage>1371</fpage>
          -
          <lpage>1382</lpage>
          ,
          <year>2015</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <given-names>J.</given-names>
            <surname>Baget</surname>
          </string-name>
          , M. Lecle`re, and
          <string-name>
            <given-names>M.</given-names>
            <surname>Mugnier</surname>
          </string-name>
          .
          <article-title>Walking the decidability line for rules with existential variables</article-title>
          .
          <source>In KR</source>
          . AAAI Press,
          <year>2010</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <given-names>J.</given-names>
            <surname>Baget</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Mugnier</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Rudolph</surname>
          </string-name>
          , and
          <string-name>
            <given-names>M.</given-names>
            <surname>Thomazo</surname>
          </string-name>
          .
          <article-title>Walking the complexity lines for generalized guarded existential rules</article-title>
          .
          <source>In IJCAI</source>
          , pages
          <fpage>712</fpage>
          -
          <lpage>717</lpage>
          . IJCAI/AAAI,
          <year>2011</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <given-names>P.</given-names>
            <surname>Barcelo</surname>
          </string-name>
          ´ and R. Pichler, editors. Datalog in Academia and Industry - Second International Workshop, Datalog 2.0, Vienna, Austria,
          <source>September 11-13</source>
          ,
          <year>2012</year>
          . Proceedings, volume
          <volume>7494</volume>
          of Lecture Notes in Computer Science. Springer,
          <year>2012</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <given-names>L.</given-names>
            <surname>Bellomarini</surname>
          </string-name>
          ,
          <string-name>
            <given-names>G.</given-names>
            <surname>Gottlob</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Pieris</surname>
          </string-name>
          , and
          <string-name>
            <surname>E. Sallinger.</surname>
          </string-name>
          <article-title>Swift logic for big data and knowledge graphs</article-title>
          .
          <source>In IJCAI</source>
          , pages
          <fpage>2</fpage>
          -
          <lpage>10</lpage>
          ,
          <year>2017</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <given-names>L.</given-names>
            <surname>Bellomarini</surname>
          </string-name>
          , E. Sallinger, and
          <string-name>
            <surname>G. Gottlob.</surname>
          </string-name>
          <article-title>The vadalog system: Datalog-based reasoning for knowledge graphs</article-title>
          .
          <source>PVLDB</source>
          ,
          <volume>11</volume>
          (
          <issue>9</issue>
          ):
          <fpage>975</fpage>
          -
          <lpage>987</lpage>
          ,
          <year>2018</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7. A. Cal`ı, G. Gottlob, and
          <string-name>
            <given-names>M.</given-names>
            <surname>Kifer</surname>
          </string-name>
          .
          <article-title>Taming the infinite chase: Query answering under expressive relational constraints</article-title>
          .
          <source>J. Artif. Intell. Res.</source>
          ,
          <volume>48</volume>
          :
          <fpage>115</fpage>
          -
          <lpage>174</lpage>
          ,
          <year>2013</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8. A. Cal`ı, G. Gottlob, and
          <string-name>
            <given-names>T.</given-names>
            <surname>Lukasiewicz</surname>
          </string-name>
          .
          <article-title>A general Datalog-based framework for tractable query answering over ontologies</article-title>
          .
          <source>J. Web Sem</source>
          .,
          <volume>14</volume>
          :
          <fpage>57</fpage>
          -
          <lpage>83</lpage>
          ,
          <year>2012</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9. A. Cal`ı, G. Gottlob,
          <string-name>
            <given-names>T.</given-names>
            <surname>Lukasiewicz</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B.</given-names>
            <surname>Marnette</surname>
          </string-name>
          ,
          <article-title>and</article-title>
          <string-name>
            <given-names>A.</given-names>
            <surname>Pieris</surname>
          </string-name>
          . Datalog+/
          <article-title>-: A family of logical knowledge representation and query languages for new applications</article-title>
          .
          <source>In LICS</source>
          , pages
          <fpage>228</fpage>
          -
          <lpage>242</lpage>
          ,
          <year>2010</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10. A. Cal`ı, G. Gottlob,
          <article-title>and</article-title>
          <string-name>
            <given-names>A.</given-names>
            <surname>Pieris</surname>
          </string-name>
          .
          <article-title>Towards more expressive ontology languages: The query answering problem</article-title>
          .
          <source>Artificial Intelligence</source>
          ,
          <volume>193</volume>
          :
          <fpage>87</fpage>
          -
          <lpage>128</lpage>
          ,
          <year>2012</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11. S. Ceri, G. Gottlob, and
          <string-name>
            <given-names>L.</given-names>
            <surname>Tanca</surname>
          </string-name>
          .
          <article-title>Logic programming</article-title>
          and databases. Springer,
          <year>2012</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          12.
          <string-name>
            <given-names>G.</given-names>
            <surname>Gottlob</surname>
          </string-name>
          and
          <string-name>
            <given-names>A.</given-names>
            <surname>Pieris</surname>
          </string-name>
          .
          <article-title>Beyond SPARQL under OWL 2 QL entailment regime: Rules to the rescue</article-title>
          .
          <source>In IJCAI</source>
          , pages
          <fpage>2999</fpage>
          -
          <lpage>3007</lpage>
          ,
          <year>2015</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          13.
          <string-name>
            <given-names>N.</given-names>
            <surname>Konstantinou</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Koehler</surname>
          </string-name>
          ,
          <string-name>
            <given-names>E.</given-names>
            <surname>Abel</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            <surname>Civili</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B.</given-names>
            <surname>Neumayr</surname>
          </string-name>
          ,
          <string-name>
            <given-names>E.</given-names>
            <surname>Sallinger</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A. A. A.</given-names>
            <surname>Fernandes</surname>
          </string-name>
          , G. Gottlob,
          <string-name>
            <given-names>J. A.</given-names>
            <surname>Keane</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            <surname>Libkin</surname>
          </string-name>
          , and
          <string-name>
            <given-names>N. W.</given-names>
            <surname>Paton</surname>
          </string-name>
          .
          <article-title>The VADA architecture for cost-e ective data wrangling</article-title>
          .
          <source>In SIGMOD Conference</source>
          , pages
          <fpage>1599</fpage>
          -
          <lpage>1602</lpage>
          . ACM,
          <year>2017</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          14. M.
          <article-title>Kro¨tzsch. E cient rule-based inferencing for OWL EL</article-title>
          .
          <source>In IJCAI 2011</source>
          , pages
          <fpage>2668</fpage>
          -
          <lpage>2673</lpage>
          ,
          <year>2011</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          15.
          <string-name>
            <surname>M. Marx</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          <article-title>Kro¨tzsch, and</article-title>
          <string-name>
            <given-names>V.</given-names>
            <surname>Thost</surname>
          </string-name>
          .
          <article-title>Logic on MARS: ontologies for generalised property graphs</article-title>
          .
          <source>In IJCAI 2017</source>
          , pages
          <fpage>1188</fpage>
          -
          <lpage>1194</lpage>
          ,
          <year>2017</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          16.
          <string-name>
            <given-names>W. E.</given-names>
            <surname>Moustafa</surname>
          </string-name>
          ,
          <string-name>
            <given-names>V.</given-names>
            <surname>Papavasileiou</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K.</given-names>
            <surname>Yocum</surname>
          </string-name>
          ,
          <article-title>and</article-title>
          <string-name>
            <given-names>A.</given-names>
            <surname>Deutsch</surname>
          </string-name>
          . Datalography:
          <article-title>Scaling datalog graph analytics on graph processing systems</article-title>
          . In BigData, pages
          <fpage>56</fpage>
          -
          <lpage>65</lpage>
          . IEEE,
          <year>2016</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref17">
        <mixed-citation>
          17.
          <string-name>
            <surname>J. Urbani</surname>
            ,
            <given-names>C. J. H.</given-names>
          </string-name>
          <string-name>
            <surname>Jacobs</surname>
            , and
            <given-names>M.</given-names>
          </string-name>
          <article-title>Kro¨tzsch. Column-oriented datalog materialization for large knowledge graphs</article-title>
          .
          <source>In AAAI 2016</source>
          , pages
          <fpage>258</fpage>
          -
          <lpage>264</lpage>
          ,
          <year>2016</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref18">
        <mixed-citation>
          18.
          <string-name>
            <surname>VADA</surname>
          </string-name>
          . Project. http://vada.org.uk/,
          <year>2016</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>