<!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>Learning Temporal Rules from Knowledge Graph Streams</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Pouya Ghiasnezhad Omran</string-name>
          <email>pouya.ghiasnezhadomran@grif</email>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
          <xref ref-type="aff" rid="aff2">2</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Kewen Wang</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
          <xref ref-type="aff" rid="aff2">2</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Zhe Wang</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
          <xref ref-type="aff" rid="aff2">2</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Copyright held by the author(s). In A. Martin, K. Hinkelmann, A. Gerber</institution>
          ,
          <addr-line>D. Lenat, F. van Harmelen, P. Clark (Eds.)</addr-line>
          ,
          <institution>Proceedings of the AAAI 2019 Spring Symposium on Combining Machine Learning with Knowledge Engineering (AAAI-MAKE 2019). Stanford University</institution>
          ,
          <addr-line>Palo Alto, California</addr-line>
          ,
          <country country="US">USA</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Figure 1: Example of KG Stream</institution>
        </aff>
        <aff id="aff2">
          <label>2</label>
          <institution>Griffith University Australia</institution>
          ,
          <addr-line>Queensland</addr-line>
        </aff>
      </contrib-group>
      <abstract>
        <p>Knowledge Graphs (KGs) are a prevailing data management approach and have found extensive applications in recent years. While several methods have been proposed for learning schema information for KGs in the form of logical rules, they are not suitable for KGs with constantly evolving data. This paper makes the first attempt to address the problem by presenting an approach to learning temporal rules from KG streams. The learned temporal rules can be applied in link prediction and event prediction over KG streams. Based on the proposed method, a system StreamLearner has been implemented. Our experimental results show that StreamLearner is effective and efficient in learning temporal rules on real-life datasets and significantly outperforms some state-ofthe-art systems that do not account for temporal knowledge or evolving data.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction</title>
      <p>
        Knowledge graphs (KGs) have proven to be a flexible and
powerful data management approach that underlies a new
generation of information systems. In many approaches, a
KG is represented as a set of RDF triples and thus is also
referred to as an RDF graph. A KG is usually very large
and thus automated and scalable methods are needed for
the creation, maintenance and use of KGs. On the other
hand, it would be essential to extract schema information
from KGs. As a result, in recent years, a number of systems
have been developed for learning rules from KGs
        <xref ref-type="bibr" rid="ref11">(Gala´rraga
et al. 2015; Omran, Wang, and Wang 2018)</xref>
        . For instance,
they are able to learn rules of the form playsFor(x; y) !
isA liatedTo(x; y) from the KG YAGO2
        <xref ref-type="bibr" rid="ref14">(Suchanek,
Kasneci, and Weikum 2007)</xref>
        .
      </p>
      <p>An increasing number of KGs are emerging that model
events taking places over time besides static relations among
entities. However, the existing rule learning systems
customarily assume KGs to be static and are not suitable for KGs
with constantly evolving data. A KG containing constantly
evolving data can be viewed as a stream of snapshots of the
KG over a sequence of time points. Figure 1 illustrates such
a KG stream, which involve four entities and some events
occurred among them at various time points. Entities e0,
e1, and e2 are three countries, and e3 is the missile. Three
events occurred in the past: Country e0 test missile at time
point 4, and then it established military cooperation with
country e1 and imposed sanction on country e2 at time point
3. Besides classical link prediction questions such as
“Which countries besides e0 tested missile?” or link
prediction questions with temporal knowledge such as “Which
counties may attack e2 at the time point ?”, there are also
schema level questions that of much interest, such as “After
a country x tested missile and then imposed sanction on
another country y on the next day, in how many days is it most
likely that x will attack y?”</p>
      <p>
        This brings in some research challenges. First, this
requires temporal knowledge to be expressed in the
schema information. For example, the above question
can be expressed as a temporal rule test(x; missile; t) ^
imposeSanc(x; y; t + 1) ! attack(x; y; t + k), where k
ranges over integers. Learning a temporal rule with a
specific k and a highest confidence degree indicates a answer to
the above question. In fact, our experiments show that using
temporal rules also improves the accuracy of classical link
prediction over KG Streams (see Section ). Moreover,
existing rule learners for KGs cannot be directly used to learn
temporal rules. Finally, a framework for stream learning and
reasoning of temporal rules is still missing. Regarding the
application of such framework, in the real-world problems,
we face to this kind of dynamic data which ignoring their
time feature make the obtained model inaccurate or
incapable. For example, ICEWS
        <xref ref-type="bibr" rid="ref15">(Trivedi et al. 2017)</xref>
        is a
system for early warning designed to assist US policy experts.
By this system, the analysts predict a range of international
crises.
      </p>
      <p>
        In this paper, we make the first attempt to tackle this
problem by developing a method for learning temporal rules
from KG streams. In our proposed method, an existing rule
learner for KG is used to extract static rules from an
initial data set, which is the collection of facts at the first few
time points. These static rules, referred to as structure rules,
are used to construct a space of candidate temporal rules.
Then we extract temporal rules from this rule space by
generalising major quality measures for static rules to
temporal rules. Based on this method, we have implemented a
system called StreamLearner. Experiments have been
conducted to evaluate the proposed method. Our experiments
show that StreamLearner outperforms the state-of-the-art
static KG learners including HOLE
        <xref ref-type="bibr" rid="ref10 ref9">(Nickel, Rosasco, and
Poggio 2016)</xref>
        and TransE
        <xref ref-type="bibr" rid="ref2">(Bordes et al. 2013)</xref>
        regarding the
link prediction in the streaming scenario. We also show that
(temporal) rule learning from KG data streams and the
corresponding link prediction can be performed effectively and
efficient over various configurations of the stream. For
example, it can forecast the events for different time points
ahead with acceptable accuracy.
      </p>
    </sec>
    <sec id="sec-2">
      <title>Background</title>
      <p>Knowledge graphs (KGs) concerns about entities, such as
persons and places, and binary relations among them. A KG
consists of a set of RDF triples (e; P; e0), each of which
expresses a fact that entity e is related to another entity e0 via
relation P . Such a KG is static in the sense that temporal
information is not taken into account. In this paper, we
consider streams of KGs. A KG stream consists of a (possibly
infinite) set of quadruples of the form (e; P; e0; k), each of
which expresses an event that the relation P associates
entity e to entity e0 at time point k. For convenience, such a fact
with time stamp is also called event . Following the
convention in knowledge representation, we denote such an event
as P (e; e0; k), where P is a ternary predicate, e and e0 are
entities, and k is a time point constant.</p>
      <p>Consider an KG stream S and two integers i; j with
0 i j, the [i; j]-segment S[i; j] of S is the subset of S
consisting of all the events with time points between and
including i and j. That is, S[i; j] = fP (e; e0; k) j P (e; e0; k) 2
S; i k jg. When i = j, it can be simplified as S[i].
Note that S can be seen as a sequence of KGs S[0]; S[1]; : : :.
Sometimes we want to consider the facts via omitting the
time points in the events, and S denotes the static KG
obtained from S by replacing each event P (e; e0; k) with the
fact P (e; e0).</p>
      <p>
        The class of closed path rules (or CP rules) have attracted
attention in the community of KGs as it provides a balance
between the expressive power of mined rules for KGs and
the efficiency of rule mining. Such a syntactic restriction
is now a widely adopted language bias in the literature of
rule mining for KGs. For instance, CP rules are the
underlying formalism of Path Ranking Algorithms (Gardner and
Mitchell
        <xref ref-type="bibr" rid="ref5">2015), RuleEmbedding (Yang et al. 2015</xref>
        ),
        <xref ref-type="bibr" rid="ref16 ref6">(Wang
and Li 2015)</xref>
        and ScaleKB
        <xref ref-type="bibr" rid="ref4">(Chen et al. 2016)</xref>
        .
      </p>
      <sec id="sec-2-1">
        <title>A CP rule (or simply a rule) r is of the form</title>
        <p>P1(x; z1) ^ P2(z1; z2) ^ ::: ^ Pn(zn 1; y) ! P (x; y): (1)
Here x, y and zi’s are variables, each P (u; v) is an atom,
and u and v are called respectively, the subject and
object argument for P . Intuitively, the rule r reads that
if P1(x; z1); P2(z1; z2); :::; Pn(zn 1; y) hold, then P (x; y)
holds too. Atom P (x; y) is the head of r, denoted head(r),
and the set of atoms P1(x; z1); P2(z1; z2); :::; Pn(zn 1; y)
is the body of r, denoted body(r). It is called closed-path
as the sequence of predicates in the rule body forms a path
from the subject argument to the object argument of the head
predicate. Note that CP rules allow recursion, i.e., the head
predicate can occur in the body.</p>
        <p>In this paper, we consider temporal CP rules (or simply
temporal rules) of the following form:</p>
        <p>P1(x; z1; t) ^ P2(z1; z2; t) ^ :::^Pn(zn 1; y; t)
! P (x; y; t + k): (2)
Here t is a time point variable and k is an integer. The rule
reads that if the rule body holds at time point t, then the rule
head holds at time point t + k. Obviously, the class of
temporal CP rules could be more general, for instance, different
time points could be allowed for different atoms in the rule.
Our definition of temporal CP rules is a balance of
expressive power and efficiency of rule mining algorithms.
Especially, in learning rules from data streams, we are interested
in making predictions based on current data stream.</p>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>Temporal Rule Learning</title>
      <p>Existing rule learning methods generally involve two
components: one is to learn the structure of the rules (e.g.,
through search and refinement) and the other is to filter out
low quality rules through certain quality measures. Our
temporal rule learning also involve such two components.</p>
      <p>
        Consider a KG stream S, to learn the structure of the rules,
our method uses facts in an initial segment of the stream
S [0; n] (n 0), which consists of the facts from time
points 0 up to n, as structure training data. A static rule
learner such as RLvLR
        <xref ref-type="bibr" rid="ref11">(Omran, Wang, and Wang 2018)</xref>
        can
be used to learn a set of CP rules R. Such a CP rule is
referred to as a structure rule. That is, a structure rule is a static
rule learned from the structure training data.
      </p>
      <p>Given rule r of the form (1), for each integer k 0, we
obtain a temporal rule r(k) of the form (2):</p>
      <p>P1(x; z1; t) ^ P2(z1; z2; t) ^ :::^Pn(zn 1; y; t)
! P (x; y; t + k):</p>
      <p>
        Then to assess the quality of candidate temporal rules,
we adapt standard measures, namely support, standard
confidence, and head coverage, that are used in rule learning
literature
        <xref ref-type="bibr" rid="ref4">(Chen et al. 2016; Gala´rraga et al. 2015)</xref>
        .
      </p>
      <p>For a temporal rule r(k), the support degree of r(k) at
time point is naturally defined as the number of entity
pairs for which the head of r(k) has instantiations at time
point and the body of r(k) has instantiation at time point
k. Formally, a pair of entities (e; e0) satisfies the body
of r at time point with 0, denoted body(r; e; e0; ), if
there exist entities e1; :::; en 1 in the KG stream S such that
P1(e; e1; ); P2(e1; e2; ); :::; Pn(en 1; e0; ) are events in
S[ ]. And (e; e0) satisfies the head of r at time point ,
denoted head(r; e; e0; ), if P (e; e0; ) is an event in S[ ].
Then the support degree of r(k) at time point is defined as
supp(r(k); ) =
( 0;
#(e; e0) : head(r; e; e0; )
^body(r; e; e0; k);
otherwise
(3)
Note that, since in the static case there is only one time point
0, the standard notion of support is a special case of the
above definition where = k = 0.</p>
      <p>To normalize support degree, the notions of standard
confidence and head coverage have been introduced, which
correspond to the standard accuracy and recall, respectively.
The standard confidence (SC) of a temporal rule r(k) at time
point is the ratio between support degree at and the
number of entity pairs satisfying the body at time point k:
if</p>
      <p>&lt; k
supp(r(k); )
SC(r(k); ) =</p>
      <p>#(e; e0) : body(r; e; e0; k)
Similarly, we define head coverage (HC) of a temporal rule
r(k) at time point to be the ratio between support degree
and the number of entity pairs satisfying the head at time
point :</p>
      <p>HC(r(k); ) =</p>
      <p>supp(r(k); )
#(e; e0) : head(r; e; e0; )</p>
      <p>In the following example, we illustrate the process of
temporal rule generation and the quality measures defined
above.</p>
      <p>Example 1 Consider the first three time points in a KG
stream S as follows:
S[0] = fP1(e3; e2; 0); P1(e2; e1; 0); P1(e1; e3; 0);
(4)
(5)</p>
      <p>P2(e3; e1; 0)g
S[1] = fP1(e2; e2; 1); P1(e2; e1; 1); P2(e1; e3; 1);
P2(e2; e1; 1); P2(e2; e3; 1); P2(e3; e3; 1);</p>
      <p>P (e1; e1; 1); P (e1; e3; 1)g
S[2] = fP1(e1; e3; 2); P2(e2; e2; 2); P2(e3; e1; 2);</p>
      <p>P2(e2; e1; 2); P2(e3; e3; 2); P (e1; e3; 2); P (e1; e1; 2)g
Let r : P1(x; z) ^ P2(z; y) ! P (x; y) be a CP rule.
Consider k = 0; 1; 2 and we have the following candidate
temporal rules based on r:
r(0) :P1(x; z; t) ^ P2(z; y; t) ! P (x; y; t)
r(1) :P1(x; z; t) ^ P2(z; y; t) ! P (x; y; t + 1)
r(2) :P1(x; z; t) ^ P2(z; y; t) ! P (x; y; t + 2)</p>
      <p>At time point = 2, the quality of the these rules can be
assessed as follows:
supp(r(0); 2) = 2; SC(r(0); 2) = 1;
supp(r(1); 2) = 0; SC(r(1); 2) = 0;
HC(r(0); 2) = 1
HC(r(1); 2) = 0
supp(r(2); 2) = 1; SC(r(2); 2) = 0:5;
HC(r(2); 2) = 0:5</p>
      <p>The SC and HC of temporal rules generalises those
standard notions with a temporal flavour, yet they haven’t taken
into consideration of the streaming nature of KG stream. In
particular, the SC and HC of a temporal rule at one time
point is independent from that at other time points. On the
other hand, the quality of temporal rules at a time point in a
KG stream should aggregate the corresponding (SC and HC)
values at previous time points. Hence, the dynamic standard
confidence (DSC) of a temporal rule at time point is
defined as follows:
( SC( ; );
(1 ) DSC( ;
+ SC( ; );
DSC( ; ) =
otherwise
(6)
where 0 &lt; &lt; 1 is the learning rate to adjust the weights
of previously aggregated DSC and that of the SC of current
time point. The dynamic head coverage (DHC) is defined in
a similar way.
if
In this section, we present our algorithm that combines the
learning and reasoning of temporal rules in a dynamic
manner over KG streams. Our algorithm takes as input a KG
stream S (i.e., a stream of quadruples), for which all the facts
in an initial segment up to time point n, S [0; n] is stored,
and two integers l; m 0 as minimum and maximum
prediction distances. And it produces as output a stream of
temporal rule sets and a stream of derived events. In particular,
we use the method from the above section to obtain a set
of candidate temporal rules: r(l), r(l+1), . . . , r(m) for each
structure rule r. Then, at each time point, we select quality
temporal rules using their DSC and DHC scores and apply
the selected rules to derive events about current and future
time points.</p>
      <p>For both rule quality measure computation and rule
application over KG stream S, the notion of shifting windows is
required. We assume at each time point , only a segment of
S of size w, S[ w + 1; ], is used for computation. Here,
w 1 is an integer called the window size, which may vary
over time points. The shifting windows are needed not only
for memory space concerns but also due to efficiency
requirement of stream processing. Note that the structure rules
can be learned offline, whereas the temporal rule filtering
and rule application need to be performed online.</p>
      <p>At time point , to assess the quality of candidate
temporal rule r(k), it is clear that if &lt; k then DSC(r(k); ) =
DHC(r(k); ) = 0; otherwise, we assume DSC(r(k);
1) has been obtained from the previous time point. By (3) –
(7), we would need to access the events at time points
and k. Yet we can only access the events in the
shifting window, that is only those in S[ w + 1; ]. In this
case, if k w 1 then we have required events and the
quality measures can be computed as in (3) – (7);
otherwise, we set DSC(r(k); ) = DSC(r(k); 1) and
HC(r(k); ) = HC(r(k); 1), where 0 &lt; &lt; 1
is used to adjust the weights of previously aggregated DSC
due to the rule’s quality not assessable at the current time
point.</p>
      <p>At time point , to derive new events at time point + k
with l k m (recall that m is the maximum
prediction distance), we apply selected temporal rule of the form
r(k) to the events in S[ ]. To obtain the confidence degree
(CD) of a derived event, we adapt the score ( ) function
from (Gala´rraga et al. 2015) by aggregating the DSC of all
the temporal rules that can derive the event in a Noisy-OR
manner. The intuition is that events derived by more rules
should have a higher confidence degree. Formally, for an
event = P (e; e0; ) and the set of temporal rules that
can derive from the KG stream, the CD of is defined as
follows:</p>
      <p>CD( ) = 1</p>
      <p>DSC( ; )):
Y (1
2</p>
      <p>In Figure 2, we illustrate one snapshot of the stream where
the current point is , w = 4, and m = 2. In this example,
we consider one structure rule, r. In this time point, we learn
the DSC from current and previous time points while we
use this time point as the body of rules which get fired and
predict the new events for current time point and the future
ones.</p>
      <p>Algorithm 1 shows the data flow and major components
of our system for temporal rule learning and reasoning over
KG streams.</p>
      <p>In line 2, we obtain a set of structure rules R using static
rule learner StaticLearner, such as RLvLR, over the
structure training data S [0; n]. This is performed offline. Then,
in line 3, a set of candidate temporal rules of the form r(k)
is obtained with maximum k being m.</p>
      <p>The online stream learning and reasoning starts from
line 4. In line 5, current events at time point are read in,
and in line 7, past events outside of the shifting window are
forgotten. Thus, W consists of all the events in the current
shifting window.</p>
      <p>In line 9, candidate temporal rules are filtered based on
their DSC and DHC scores at time point . As discussed</p>
      <sec id="sec-3-1">
        <title>Algorithm 1 KG Stream Learning and Reasoning</title>
        <p>before, this involves aggregating previous DSC and DHC
scores, and is restricted by W the events available in the
shifting windows. After filtering, the set of selected rules
can be streamed out.</p>
        <p>The selected temporal rules can then be used for
reasoning. In line 12, each rule r(k) is applied to the current events
S[ ] to derive events in future time point + k. Note that
events at a time point is derived incrementally from a
sequence of past time points. Once all the learnt temporal rules
at time point have been applied, the derived events at ,
, will not change and can be streamed out.</p>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>Experiments</title>
      <p>
        We have implemented a system, StreamLearner, based on
the above algorithm and conducted several experiments to
evaluate it. In our implementation, RLvLR
        <xref ref-type="bibr" rid="ref11">(Omran, Wang,
and Wang 2018)</xref>
        is deployed for learning structure rules.
      </p>
      <p>
        Our experiments are designed to demonstrate that
temporal rules are an effective model to capture temporal
knowledge and thus can provide more accurate link prediction than
some existing statistical models, such as TransE
        <xref ref-type="bibr" rid="ref2">(Bordes et
al. 2013)</xref>
        and HOLE
        <xref ref-type="bibr" rid="ref10 ref9">(Nickel, Rosasco, and Poggio 2016)</xref>
        ,
that do not account for temporal knowledge or evolving data.
Our goal is not to compete with temporal statistical
models like Know-Evolve
        <xref ref-type="bibr" rid="ref15">(Trivedi et al. 2017)</xref>
        . To analyse the
benefit of having temporal rules over static rules in stream
reasoning, we also used a “static” version of StreamLearner
(StreamLearner-S), which only uses the static structure rules
(not the temporal rules). Specifically, our experimental
results aimed to validate the following observations:
1. StreamLearner significantly outperforms the baseline
methods StreamLearner-S, TransE and HOLE in terms of
accuracy in link prediction.
2. Stream learning of and link prediction through
temporal rules can be performed efficiently. When the sizes
of structure training data increased, the prediction
accuracy also increases without significant sacrifice on the
efficiency.
3. The accuracy of link prediction generally increases when
the sizes of shifting window increases or when the
minimum prediction distances reduces. StreamLearner still
outperforms StreamLearner-S in the cases of small
window sizes and long minimum prediction distances.
      </p>
      <p>
        In our experiments, we used the Integrated Crisis Early
Warning System (ICEWS) dataset
        <xref ref-type="bibr" rid="ref15">(Trivedi et al. 2017)</xref>
        ,
which is based on historical events including interactions
between socio-political agents (i.e., cooperative or
antagonistic actions between individuals, associations, organizations,
sectors and nation states). The events were automatically
recognized and extracted from the news. It contains events
from the year of 2014 with a 24hrs interval between each two
adjunct time points (that is, 365 time points in total). ICEWS
is an ideal benchmark for our experiments because the
behaviour of agents in this benchmark has complex interaction
patterns. We are unaware of any other benchmarks of a
similar type. We also adopted the ICEWS-500 as in
        <xref ref-type="bibr" rid="ref15">(Trivedi et
al. 2017)</xref>
        , which contains a small subset of ICEWS with 500
entities. We included this small subset to examine the
impact of data sizes on different systems. Some statistics about
the two datasets are shown in Table 1, including the
numbers of entities, numbers of events, numbers of predicates,
and numbers of time points.
      </p>
      <sec id="sec-4-1">
        <title>We have conducted two sets of experiments.</title>
        <p>In the first set of experiments, we used the facts from
the first 50 days (i.e., S [0; 50]) as the training data for
learning structure rules. We note that the size of the data
set is much smaller than the initial data sets in other
approaches for learning from streams. Since static rule learner
RLvLR learns static rules about specified predicates in rule
heads, called target predicates, we randomly selected 20
target predicates.</p>
        <p>
          We assessed the accuracy of link prediction fortnightly
after the 50th day. That is, 23 time points after the rules
structure training. For each of these time points k, we separated
the datasets into 70% training and 30% testing as in most
literature. The link prediction task is to identify for each
target predicate P and each entity e, an entity e0 such that
P (e; e0; k) is an event occurred in the KG stream; or
alternatively, to identify for each target predicate P and each entity
e, an entity e0 such that P (e0; e; k) is an event in the stream.
The prediction accuracy was measured by filtered Mean
Reciprocal Rank (MRR) and Hits@10 as in the literature
          <xref ref-type="bibr" rid="ref2">(Bordes et al. 2013)</xref>
          .
        </p>
        <p>In this experiment, the size of shifting window was fixed
to 10 days and the maximal prediction distance was also
10 days. For each time point k, SteamLearner applied the
learnt temporal rules to the training data in S[k], as well
as S[k 10; k 1], to derive missing events at k, whereas
StreamLearner-S applied all the structure rules to the
training data in S[k]. TransE and HOLE obtained their respective
statistical models from the training data in S[k].</p>
        <p>Table 2 shows the performance of StreamLearner,
StreamLearner-S, TransE and HOLE. We report the
numbers of temporal rules (#R), the numbers of structure rules
(#SR), MRR and Hits@10 (H@10) scores, averaged over all
selected time points and target predicates.</p>
        <p>The experimental results show that StreamLearner
significantly outperformed the baseline systems. In
particular, StreamLearner was around 4 times more accurate than
TransE and HOLE on Hits@10, and about 5 times more
accurate on MRR. StreamLearner also showed superior
performance to its static version, which clearly demonstrates
the benefit of temporal rules over static rules on stream
reasoning. Indeed, the average number of temporal rules is only
around 3 times more than that of structure rules. Considering
the number of candidate temporal rules (10 times of
structure rules), it shows that the temporal rules can model much
refined and more precise association among events.</p>
        <p>Figure 3 shows the detailed performance of
StreamLearner and the baseline systems, from which we can see
that of StreamLearner showed consistently superior
performance over the time.</p>
        <p>A major benefit of temporal rules compared to statistical
models is that their meanings are human understandable, and
hence the learned temporal rules themselves contain
valuable temporal knowledge about the domain. Although
entities and predicates in the ICWEC dataset are obfuscated and
thus it is difficult to assess the meaning of learnt temporal
rules, it is not hard to image the temporal knowledge behind
some common patterns. For illustration purpose, we present
the following two temporal rules whose predicate names are
replaced with meaningful terms from the ICEWS dictionary.
0:05 : rejectMaterialCooperation(y; x; t) !</p>
        <p>threatenWithSanctions(x; y; t):
0:15 : rejectMaterialCooperation(y; x; t) !</p>
        <p>threatenWithSanctions(x; y; t + 1):
The number before each rule is the corresponding DSC. The
two rules indicate that if country y rejects the material
cooperation with country x, then it is unlikely that y threatens
x with sanctions on the same day. But this is more likely to
happen on the next day.</p>
        <p>The quality of learnt temporal rules and their performance
in link prediction are affected by several factors related to the
KG streams, including the sizes of structure training data,
the window sizes, and the (minimum and maximum)
prediction distance. For the second set of experiments, we evaluate
how these factors affect the quality and performance of
temporal rules.</p>
        <p>The size of structure training data affects the quantity
and quality of the structure rules, which in turn affects the
learning of temporal rules. In particular, it impacts the
efficiency of StreamLearner. Table 3 shows the performance
of StreamLearner with different sizes n of structure training
data S [0; n], and we compare its performance with that of
StreamLearner-S. We report the numbers of structure rules
(#SR), stream learning and reasoning times (Time, in
seconds), MRR and Hits@10 (H@10) scores, averaged over all
selected time points and target predicates.</p>
        <p>Overall, allowing larger structure learning data provides
more structure rules and leads to better prediction accuracy
on both StreamLearner and StreamLearner-S. Yet, there is
trade-off between time efficiency and prediction accuracy,
and as the size of structure learning data increases, the
processing time of StreamLearner increases more significantly
than that of StreamLearner-S, due to the number of
candidate temporal rules. Yet the processing time of
StreamLearner remains acceptable (14.1 seconds) even when a
significantly large portion of the KG stream (250 out of
365) were used as structure training data. While
StreamLearner again significantly outperformed StreamLearner-S
in all cases, an interesting observation is when the available
data for rule structure learning is smaller, the benefit of using
temporal rules over static rules is more obvious. This
indicates when the available structural knowledge (i.e.,
association among facts, represented in structure rules and temporal
rules) is relatively limited, the temporal knowledge (i.e.,
association among events, represented in temporal rules) plays
a more significant role in prediction.</p>
        <p>The window sizes and the maximum prediction distances
both determine the amount of historical data that can be
utilised for learning and prediction, and thus affect the
performance of our system. For simplicity, in the following
experiments, we set the window sizes to be fixed over time and
equivalent to the maximum prediction distances. Figure 4
shows the performance of StreamLearner over window sizes
ranging from 1 to 15. Again, we used StreamLearner-S as a
baseline, whose performance is not impacted by the window
sizes, and MRR and Hits@10 scores are averaged over all
selected time points and target predicates.</p>
        <p>Generally speaking, the performance of StreamLearner
improves as the window size increases. It also reveals some
local optimal points, namely window sizes 3 and 10.
Although slight improvement in Hits@10 can be observed for
widow sizes larget than 10, MRR seems to be flattening.
This suggests that in real-life, events occurring further way
in the stream tend to be more loosely associated with the
current events, and in practice it could be effective to use small
window sizes (like 3 or 10).</p>
        <p>The minimum prediction distance also impacts the
learning and prediction, and probably more on prediction. In the
previous experiments, we set the minimum prediction
distance to be 0, which allowed events to be derived from the
current data. Clearly, as the minimum prediction distance
increases, the system is challenged to finalise the derived
events in distance. For instance, if the minimum prediction
distance is set to 3 then the learnt temporal rules are of the
form r(3); r(4); : : :. That means, all derived events at time
point ( ) are obtained at time point 3. This effectively
requires the prediction to happen at least 3 days ahead.</p>
        <p>In the following experiments, we evaluated the impact of
minimum prediction distance on the performance of
StreamLearner, using StreamLearner-S as a baseline. Note that if
the maximum prediction distance stays the same, the
increase of minimum prediction distance will reduce the
number of candidate temporal rules. To separate this factor from
the challenged post by distant prediction, we assume the
difference between the maximum and minimum prediction
distance remains 10. Figure 5 shows the performance of
StreamLearner over minimum prediction distances ranging
from 0 to 10. Again, the values are averaged.</p>
        <p>The performance of StreamLearner drops as the
prediction distances increase. An interesting observation is that the
accuracy decrease was not as dramatic as one would expect.
In particular, predicting one day or two days ahead had
comparable accuracy as “predicting” about today. Also, 7 turns
out to be a local optimal point, which may suggest weekly
pattern in the event association.</p>
      </sec>
    </sec>
    <sec id="sec-5">
      <title>Discussion and Conclusion</title>
      <p>
        The topic of our work is in the intersection of stream
reasoning and stream learning. There have been some approaches
to address these two issues but separately. Knowledge
representation and reasoning in the presence of data streams
has been investigated in
        <xref ref-type="bibr" rid="ref1 ref3 ref3 ref8">(Beck, Dao-Tran, and Eiter 2018;
Marx, Kro¨tzsch, and Thost 2017; Chekol and Pirr 2017)</xref>
        .
For instance,
        <xref ref-type="bibr" rid="ref3 ref8">(Marx, Kro¨tzsch, and Thost 2017)</xref>
        proposed
a multi-attributed relational structure (MARS) to present the
following rule:
8x; y; z1; z2; z3 : spouse(x; y)@fstart : z1; loc : z2; end : z3g !
spouse(y; x)@fstart : z1; loc : z2; end : z3g
But they did not investigate how to extract such rules from
data streams.
      </p>
      <p>
        In KG community, some methods have been proposed for
learning rules from a given (static) KG. Recently, the method
of embedding from representation learning is applied in rule
learning for (static) KGs
        <xref ref-type="bibr" rid="ref11 ref18 ref3">(Omran, Wang, and Wang 2018;
Yang, Yang, and Cohen 2017)</xref>
        , which has been proven quite
effective.
      </p>
      <p>
        There are numerous works on link prediction by
employing the method of embedding such as
        <xref ref-type="bibr" rid="ref15">(Trivedi et al. 2017;
Sadeghian et al. 2018)</xref>
        . Our method for rule learning from
KGs is different from theirs, while our method can also be
applied in link prediction. This is because we focus on
learning structural information in the form of first order rules.
      </p>
      <p>
        There are also some approaches to learning logic-based
models form streams of relational data such as
        <xref ref-type="bibr" rid="ref16 ref6 ref7 ref9">(Katzouris,
Artikis, and Paliouras 2015; Mitra and Baral 2016)</xref>
        . A
method is proposed in
        <xref ref-type="bibr" rid="ref16 ref6 ref7">(Katzouris, Artikis, and Paliouras
2015)</xref>
        for extracting event definitions automatically. Their
system incrementally refine the logical definition of events
based on temporal events information dataset. As the
method is based on refinement operators in inductive logic
programming, the resulting system is not scalable for
handling KGs.
      </p>
      <p>In this paper, we have proposed a method for learning
temporal rules from data streams in the format of
Knowledge Graphs (KGs). Such rules can be used for reasoning
about event over different time points. Especially,
temporal rules are useful for link prediction and event prediction
in the setting of KG data streams. The proposed method
is essentially a framework for rule learning from KG data
streams by extending existing rule learners for KGs. Based
on RLvLR, a state-of-the-art rule learner for KGs, we have
implemented a system StreamLearner, which can learn
temporal rules from KG data streams, completing dynamic KGs
and predicting events for them. Our experiments show that
StreamLearner significantly outperforms the base systems.
It is able to handle large KGs and a promising approach to
creating, maintaining and using data streams in the format
of KGs.</p>
      <p>There are still some interesting issues for future work. We
plan to develop a framework to handle more complex events
such as the event with the beginning and termination time or
the event with the location of the happening label.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          <string-name>
            <surname>Beck</surname>
            ,
            <given-names>H.</given-names>
          </string-name>
          ;
          <string-name>
            <surname>Dao-Tran</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ; and Eiter,
          <string-name>
            <surname>T.</surname>
          </string-name>
          <year>2018</year>
          .
          <article-title>LARS: A Logicbased framework for Analytic Reasoning over Streams</article-title>
          .
          <source>Artificial Intelligence</source>
          <volume>261</volume>
          :
          <fpage>16</fpage>
          -
          <lpage>70</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          <string-name>
            <surname>Bordes</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ;
          <string-name>
            <surname>Usunier</surname>
            ,
            <given-names>N.</given-names>
          </string-name>
          ;
          <string-name>
            <surname>Weston</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ;
          <string-name>
            <surname>Yakhnenko</surname>
            ,
            <given-names>O.</given-names>
          </string-name>
          ;
          <string-name>
            <surname>GarciaDuran</surname>
          </string-name>
          , A.;
          <string-name>
            <surname>Weston</surname>
          </string-name>
          , J.; and
          <string-name>
            <surname>Yakhnenko</surname>
            ,
            <given-names>O.</given-names>
          </string-name>
          <year>2013</year>
          .
          <article-title>Translating embeddings for modeling multi-relational data</article-title>
          .
          <source>In Advances in neural information processing systems.</source>
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          <string-name>
            <surname>Chekol</surname>
            ,
            <given-names>M. W.</given-names>
          </string-name>
          , and
          <string-name>
            <surname>Pirr</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          <year>2017</year>
          .
          <article-title>Marrying Uncertainty and Time in Knowledge Graphs</article-title>
          .
          <source>In AAAI 2017 (Proceedings of the 31th Conference on Artificial Intelligence)</source>
          ,
          <fpage>88</fpage>
          -
          <lpage>94</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          <string-name>
            <surname>Chen</surname>
            ,
            <given-names>Y.</given-names>
          </string-name>
          ; Daisy, .;
          <string-name>
            <surname>Wang</surname>
            ,
            <given-names>Z.</given-names>
          </string-name>
          ;
          <string-name>
            <surname>Goldberg</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ;
          <string-name>
            <surname>Chen</surname>
            ,
            <given-names>B. Y.</given-names>
          </string-name>
          ;
          <string-name>
            <surname>Wang</surname>
          </string-name>
          ,
          <string-name>
            <surname>D. Z. D.</surname>
          </string-name>
          ; and
          <string-name>
            <surname>Goldberg</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          <year>2016</year>
          .
          <article-title>ScaLeKB: scalable learning and inference over large knowledge bases</article-title>
          .
          <source>The International Journal on Very Large Data Bases</source>
          <volume>25</volume>
          :
          <fpage>893</fpage>
          -
          <lpage>918</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          2015.
          <article-title>Fast rule mining in ontological knowledge bases with AMIE+</article-title>
          .
          <source>The International Journal on Very Large Data Bases</source>
          <volume>24</volume>
          (
          <issue>6</issue>
          ):
          <fpage>707</fpage>
          -
          <lpage>730</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          <string-name>
            <surname>Gardner</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          , and Mitchell,
          <string-name>
            <surname>T.</surname>
          </string-name>
          <year>2015</year>
          .
          <article-title>Efficient and Expressive Knowledge Base Completion Using Subgraph Feature Extraction</article-title>
          .
          <source>In Conference on Empirical Methods on Natural Language Processing</source>
          , number September.
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          <string-name>
            <surname>Katzouris</surname>
            ,
            <given-names>N.</given-names>
          </string-name>
          ;
          <string-name>
            <surname>Artikis</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ; and Paliouras,
          <string-name>
            <surname>G.</surname>
          </string-name>
          <year>2015</year>
          .
          <article-title>Incremental learning of event definitions with Inductive Logic Programming</article-title>
          .
          <source>Machine Learning</source>
          <volume>100</volume>
          (
          <issue>2-3</issue>
          ):
          <fpage>555</fpage>
          -
          <lpage>585</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          <string-name>
            <surname>Marx</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ; Kro¨tzsch, M.; and
          <string-name>
            <surname>Thost</surname>
            ,
            <given-names>V.</given-names>
          </string-name>
          <year>2017</year>
          .
          <article-title>Logic on MARS: Ontologies for Generalised Property Graphs</article-title>
          .
          <source>In IJCAI.</source>
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          <string-name>
            <surname>Mitra</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          , and
          <string-name>
            <surname>Baral</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          <year>2016</year>
          .
          <article-title>Addressing a Question Answering Challenge by Combining Statistical Methods with Inductive Rule Learning and Reasoning</article-title>
          . In AAAI.
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          <string-name>
            <surname>Nickel</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ;
          <string-name>
            <surname>Rosasco</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          ; and Poggio,
          <string-name>
            <surname>T.</surname>
          </string-name>
          <year>2016</year>
          .
          <article-title>Holographic Embeddings of Knowledge Graphs</article-title>
          .
          <source>In AAAI.</source>
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          <string-name>
            <surname>Omran</surname>
            ,
            <given-names>P. G.</given-names>
          </string-name>
          ;
          <string-name>
            <surname>Wang</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          ; and
          <string-name>
            <surname>Wang</surname>
            ,
            <given-names>Z.</given-names>
          </string-name>
          <year>2018</year>
          .
          <article-title>Scalable Rule Learning via Learning Representation</article-title>
          .
          <source>In IJCAI.</source>
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          2018.
          <article-title>Temporal Reasoning Over Event Knowledge Graphs</article-title>
          .
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          <source>In 1st Workshop on Knowledge Base Construction, Reasoning and Mining</source>
          , volume
          <year>2065</year>
          ,
          <fpage>54</fpage>
          -
          <lpage>57</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          <string-name>
            <surname>Suchanek</surname>
            ,
            <given-names>F. M.</given-names>
          </string-name>
          ;
          <string-name>
            <surname>Kasneci</surname>
            ,
            <given-names>G.</given-names>
            ; and Weikum, G.
          </string-name>
          <year>2007</year>
          .
          <article-title>Yago: a core of semantic knowledge</article-title>
          .
          <source>In International conference on World Wide Web</source>
          ,
          <fpage>697</fpage>
          -
          <lpage>706</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          <string-name>
            <surname>Trivedi</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ; Dai,
          <string-name>
            <given-names>H.</given-names>
            ;
            <surname>Wang</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Y.</given-names>
            ; and
            <surname>Song</surname>
          </string-name>
          ,
          <string-name>
            <surname>L.</surname>
          </string-name>
          <year>2017</year>
          .
          <article-title>KnowEvolve: Deep Temporal Reasoning for Dynamic Knowledge Graphs</article-title>
          . In ICML.
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          <string-name>
            <surname>Wang</surname>
            ,
            <given-names>Z.</given-names>
          </string-name>
          , and
          <string-name>
            <surname>Li</surname>
            ,
            <given-names>J.-Z.</given-names>
          </string-name>
          <year>2015</year>
          .
          <article-title>RDF2Rules: Learning Rules from RDF Knowledge Bases by Mining Frequent Predicate Cycles</article-title>
          . Computer Research Repository.
        </mixed-citation>
      </ref>
      <ref id="ref17">
        <mixed-citation>
          <string-name>
            <surname>Yang</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          ;
          <string-name>
            <surname>Yih</surname>
          </string-name>
          , W.-t.;
          <string-name>
            <surname>He</surname>
            ,
            <given-names>X.</given-names>
          </string-name>
          ;
          <string-name>
            <surname>Gao</surname>
          </string-name>
          , J.; and
          <string-name>
            <surname>Deng</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          <year>2015</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref18">
        <mixed-citation>
          <string-name>
            <surname>Yang</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          ;
          <string-name>
            <surname>Yang</surname>
            ,
            <given-names>Z.</given-names>
          </string-name>
          ; and Cohen,
          <string-name>
            <surname>W. W.</surname>
          </string-name>
          <year>2017</year>
          .
          <article-title>Differentiable Learning of Logical Rules for Knowledge Base Reasoning</article-title>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>