Reasoning About Time in DatalogMTL: Course Notes
Abstract
Many real-world applications, such as those in healthcare, finance, and logistics, require reasoning over temporal data. Standard rule-based languages like Datalog, however, lack explicit mechanisms for handling time and temporal dependencies. In this chapter, we discussDatalogMTL, an extension of Datalog with operators frommetric temporal logic that allow to express complex temporal properties. We focus on reasoning algorithms for DatalogMTL, discussing bothmaterialisation, based on fixpoint applications of the immediate consequence operator, and anovel saturation-based extensionthat detects and halts infinite derivations, ensuring both completeness and termination of reasoning.
Keywords and phrases:
DatalogMTL, Logic Programming, Temporal ReasoningCategory:
Invited PaperCopyright and License:
2012 ACM Subject Classification:
Theory of computation Modal and temporal logics ; Theory of computation Programming logicAcknowledgements:
These course notes are based on the author’s research on DatalogMTL, previously presented in several co-authored papers [54, 53, 55]. The author is deeply grateful to all colleagues with whom he had the pleasure of collaborating on this topic, in particular Bernardo Cuenca Grau and Michał Zawidzki, whose contributions were essential for establishing the results discussed here.Funding:
This research is partially funded by the European Union (ERC, ExtenDD, project number: 101054714). Views and opinions expressed are however those of the authors only and do not necessarily reflect those of the European Union or the European Research Council. Neither the European Union nor the granting authority can be held responsible for them.Editors:
Alessandro Artale, Meghyn Bienvenu, Yazmín Ibáñez García, and Filip MurlakSeries and Publisher:
Open Access Series in Informatics, Schloss Dagstuhl – Leibniz-Zentrum für Informatik
1 All We Need Is Time
Many application domains, such as healthcare, finance, and logistics are inherently temporal. Events like medical appointments or financial transactions take place in time, and reasoning about them requires explicit consideration of the temporal dimension. Datalog – a state-of-the-art rule-based language for reasoning over structured data [1, 33, 22] – is, however, atemporal. It allows us to write rules such as
stating that if a patient is immune, their test needs to be negative. However, such rules do not allow us to represent the temporal relation between events, for example that a patient needs to be immune continuously in the last five days to be guaranteed to have a negative test. How can we perform temporal reasoning in Datalog?
One approach is to enrich Datalog with numbers representing points of time, and with arithmetic operators allowing to express dependencies between time points. For example one could write the following rule
stating that if a patient is immune continuously within a time interval of length 5 at least, then they will have a negative result of a test performed within the time interval . Available Datalog engines such as Nemo [27], RDFox [33], and Vadalog [9] often allow for exploiting arithmetic operators, but such an extension quickly leads to undecidability of reasoning.
Another approach, which will be the focus of this course, is to design extensions of Datalog tailored specifically for temporal reasoning. Instead of arithmetic operators, they use temporal operators. For example, we can use an operator , stating that an event happened continuously for the past interval of length 5, to write the following rule:
Such temporal languages are carefully crafted to balance expressive power with computational complexity. In particular, they aim to capture rich temporal properties while ensuring that reasoning remains decidable and can be carried out algorithmically.
Among temporal extensions of Datalog, we will focus on DatalogMTL [12, 46], which augments Datalog with operators from Metric Temporal Logic (MTL) [29] such as already presented . Such operators have high expressive power, and so, DatalogMTL subsumes many other temporal dialects of Datalog. DatalogMTL provides a versatile temporal reasoning language with applications in areas such as Semantic Web, Stream Reasoning, and Knowledge Graphs. Among others, DatalogMTL has been applied in ontology-based data access [11], economic fact-checking [31], human movement description [35], and verification of banking agreements [34].
To provide a better intuition about DatalogMTL, let us illustrate the language with some examples of facts and rules. DatalogMTL facts are annotated with time points (or time intervals) in which they hold, and rules allow us to express temporal dependencies between events.
Example 1.
Consider an exemplary DatalogMTL dataset, denoted by , which we will use throughout this paper. It contains two facts:
stating that Ben got vaccinated at the time point and that he had no symptoms continuously within the interval .
Note that the timeline in DatalogMTL is an abstract sequence of rational time points. Nevertheless, it is easy to give it an intuitive interpretation. For instance if we assume that the first day (of the current year) in our database corresponds to the interval , the second day to , and so on, then facts in state that Ben was vaccinated at 4 p.m. on July 19 and that he had no symptoms since midnight on July 1 until noon on August 30.
Rules in DatalogMTL, in turn, extend classical Datalog with temporal operators, which enable reasoning over the temporal dimension of data. These operators are indexed by time intervals capturing the metric dependencies. In what follows we will provide examples of temporal operators that can be used in DatalogMTL. First, we present the “diamond” operators – for “sometime in the future” and – for “sometime in the past”. With such operators we can write the following expressions:
-
, which states that Vaccinated will hold at some point between 1 and 2 time units in the future. More precisely, this expression is true at a time point if there exists a moment within the interval at which Vaccinated holds.
-
, which uses the past version of . The formula holds at all time points such that Vaccinated holds at some time point in the interval .
DatalogMTL allows also to use “box” versions of the above “diamond” operators, for instance:
-
holds true at time points such that Vaccinated holds continuously in the interval .
-
holds true at time points such that Vaccinated holds continuously in the interval .
Finally, there are also metric version of “until” and “since” operators as presented below:
-
holds true at time points such that Vaccinated holds at some time point and NoSympt holds from until this .
-
holds true at time points such that Vaccinated holds at some time point and NoSympt holds from since this .
We will provide formal semantics of all these operators in the following section, but it is already worth presenting what kind of reasoning scenarios DatalogMTL allows us to express. To this end, consider the following example that models how immunity may arise either from vaccination or from prior exposure to a disease.
Example 2.
Consider a scenario where evidence suggests that immunity to a disease lasts for at least 90 days under the following conditions: an individual has been vaccinated and, within 3–4 weeks afterwards, either remained asymptomatic or tested negative. Also, an individual is immune if they were infected within the past six months (183 days), excluding the most recent ten days during which they showed no symptoms. In addition, individuals who have been immune for at least five days are observed to test negative. These conditions can be formalised in a DatalogMTL program consisting of the following rules:
| (1) | ||||
| (2) | ||||
| (3) | ||||
| (4) |
In particular, Rule (1) checks whether an individual remained without symptoms between and days since receiving vaccination (using the “since” operator ); Rule (2) checks whether they received a negative test and got vaccinated at some point in the last to days (using the “diamond past” operator ). Rule (3) checks whether an individual infected at some point in the last six months excluding the last 10 days (operator ) remained continuously without symptoms in the last 10 days (using the “box past” operator ). Finally, Rule (4) states that if an individual was immune continuously for the last 5 days (operator ), they will have a negative test.
As the example above shows, DatalogMTL allows us to express quite complex temporal rules. The main question we will consider is how to construct reasoning algorithms for this language?
We will begin in Section 2 with a formal presentation of the syntax and semantics of DatalogMTL. In Section 3, we study materialisation as a reasoning mechanism for DatalogMTL and identify the cases where it yields a complete reasoning procedure. However, materialisation alone often proves insufficient. This motivates Section 4, where we present the technically most challenging result: a saturation mechanism that detects loops in infinite derivations and thereby enables complete reasoning even when pure materialisation fails. Finally, in Section 5, we discuss related work on DatalogMTL, provide references for further reading, and highlight several interesting open problems in this research area.
2 Getting Formal with DatalogMTL
In this section, we will provide a formal definition of syntax and semantics of DatalogMTL, as well as introduce the standard reasoning tasks in this setting. For crucial notions, we will provide examples and illustrations to help the reader become familiar with them, as their understanding is essential for the subsequent sections.
2.1 Timeline and Time Intervals
We focus on the original setting for DatalogMTL, where the timeline is dense and consists of rational numbers. However, it is worth noting that DatalogMTL was also considered over the discrete integer timeline [47]. Formally, we let the (rational) timeline be the set of rational (both positive and negative) numbers and we will call each element of the timeline a time point. An interval is a non-empty subset of satisfying the following standard properties:
-
for all with and , it is the case that , and
-
both the greatest lower bound and the least upper bound of belong to .
The bounds and are called the left and right endpoints of , respectively, and is the length of . An interval is punctual if it contains exactly one number, it is positive if it does not contain negative numbers (i.e., ), and it is bounded if both its left and right endpoints are rational numbers.
We use the standard representation for intervals , where the left bracket is either or , the right bracket is either or , and and are representations of the left and right endpoints of , respectively. For example, the following represent three different intervals: , , and . As usual, brackets and indicate that the corresponding endpoints are included in the interval, whereas and indicate that they are not included. We abbreviate a punctual interval as . For example instead of we may simply write .
2.2 Syntax of DatalogMTL
We let a relational atom be of the form , with an -ary predicate and an -ary tuple of terms (i.e., constants and variables). For example is a relational atom with a predicate Vaccinated of arity 1 and with a single constant , whereas is a relational atom using a variable instead of a constant. We allow also for predicates of arity 0, such as Sunny, which do not require terms. A metric atom is an extension of a relational atom with metric temporal operators. In particular, a metric atom is an expression given by the following grammar, where ranges over relational atoms and over positive non-empty intervals:
For example is a metric atom. Notice that the definition allows also for arbitrary nesting of temporal operators, so is also a metric atom.
A rule is an expression built from metric atoms as follows:
| (5) |
where each is a metric atom and is a metric atom allowing only for “boxes” among temporal operators, namely is generated by the following grammar:111Notice that we disallow in , which ensures that no inconsistency can occur; DatalogMTL is often considered with rules allowing for in , but to simplify the setting we will not consider such rules.
The fact that we disallow some temporal operators in is dictated by complexity results; if we allow for being an arbitrary metric atom, reasoning would become undecidable. The conjunction in Expression (5) is the rule’s body, each is a body atom, and is the rule’s head. As an example of DatalogMTL rules, consider Rules (1)–(4) from in Example 2. A program, like , is a finite set of rules222Precisely speaking we require also that rules are safe, namely each variable mentioned in the head of a rule occurs also in its body, and this occurrence is not in a left operand of or ; without this restriction we could write rules like , which are usually disallowed in Datalog..
An expression (e.g. a metric atom, rule, or program) is ground if it mentions no variables. Hence is ground, but is not. A fact over an interval is an expression , with a ground relational atom. A dataset, for example from Example 1, is a finite set of facts.
The grounding of a program , written as , is the ground program obtained as the set of all ground rules that can be obtained by assigning constants to variables in . The grounding of with respect to a dataset , written as , is the restriction of rules which do mention only those constants which are present in or .
2.3 Semantics of DatalogMTL
We will focus in this course on the standard continuous semantics of DatalogMTL, as opposed to the alternative pointwise semantics [36]. In the standard setting an interpretation is a function which specifies, for each ground relational atom and each time point , whether is satisfied at , in which case we write . This notion extends to complex ground metric atoms as given in Table 1.
| iff | ||||
| iff | ||||
| iff | ||||
| iff | ||||
| iff | ||||
| iff |
The meaning of past operators , , and is additionally visualised in figures below. The first figure shows that holds at if holds at some time point located within the interval . The second figure indicates that holds at if holds continuously in the interval . The third figure, in turn, shows that holds at if holds at some time point within and holds continuously from this time point up to the time point . The meaning of future operators , , and is symmetric to the meaning of the corresponding past operators , , and , respectively.
To illustrate the notion of satisfaction in an interpretation, consider the following example.
Example 3.
Consider an interpretation represented by the dataset from Example 1, that is, and , for all . By the semantics of metric operators in Table 1, the following hold (as depicted in the figure below):
-
for all , since for each of these time points , holds in some time point within the interval .
-
for all , as for any such , holds continuously in the interval .
-
for all , as for all these , holds in some time point in such that holds continuously between this time point and .
We say that an interpretation satisfies a fact , written , if for all . Moreover, satisfies a ground rule if, whenever satisfies each body atom of at a time point , then also satisfies the head of at . Furthermore, satisfies a rule if it satisfies its every ground instance, that is, each rule in . We say that is a model of a program if satisfies each rule in . An interpretation is a model of a dataset if satisfies each fact in . A dataset entails a fact if each model of is also a model of . A program and a dataset entail a fact , written , if each model of both and is also a model of .
An interpretation contains an interpretation , written , if implies , for each ground relational atom and each time point . We say that is the least interpretation in a set of interpretations if , for every . Each dataset admits the least interpretation among all models of ; we say that a dataset represents an interpretation if .
The immediate consequence operator , for a program , is a function mapping an interpretation to the least interpretation containing and satisfying the following property for each : whenever satisfies each body atom of at a time point , then satisfies the head of at . The successive application of to defines a transfinite sequence of interpretations , for ordinals , as follows:
The canonical interpretation of and is the interpretation , where is the first uncountable ordinal. It is known that is the least model of and [11]. In other words, to compute the least model of and , we can apply until a fixpoint is reached, that is, no more information can be derived.
To illustrate the process of applying , which is the basic reasoning mechanism in DatalogMTL, let us consider the following example.
Example 4.
Consider the program and dataset from Examples 2 and 1. The interpretations obtained by applying correspond to the following datasets:
| : | , | |
|---|---|---|
| : | , | , |
| , | , | |
| : | , | |
| : | same facts as in | |
Since , the fixpoint is reached, and so further applications of cannot derive any new information. Therefore, we obtain that , for any ordinal . Hence is the canonical interpretation of and .
2.4 Reasoning Problems
The main reasoning problem in DatalogMTL we will consider is fact entailment: the problem of checking whether a program and a dataset entail a given relational fact. For instance, Example 4 shows that and logically entail , because this fact holds in the canonical interpretations . Indeed, it was derived after two applications of the immediate consequence operator.
Another standard problem is consistency checking, which is to check whether a given program and a dataset admit a common model. Notice that our definition of a DatalogMTL rule does not allow for to occur in a head. As a result, in our setting every program , together with any dataset admit a common model, and the canonical interpretation is the minimal among their models. However, if we allowed for in rule heads, which is often considered in the literature, some pairs of a program and dataset would not admit models. For instance this would be the case for a dataset with a single fact and a program with a single rule , which clearly leads to inconsistency (derivation of ).
In the passing, we observe that if we allow for in rule heads, then consistency checking and fact entailment in DatalogMTL reduce to the complements of each other. Specifically, to check whether a program and a dataset are inconsistent, it suffices to check whether they entail fact , for a fresh atom occurring neither in nor in . Indeed, is entailed, that is holds in all models of and only if and have no models, that is, if and are not consistent. In turn, to check whether and entail a fact , it suffices to check whether the following program and dataset are inconsistent, with a fresh predicate of the same arity as , a tuple of distinct variables, and an arbitrary time point belonging to the interval :
Intervals and are constructed using and ; for example, if , then and , whereas if , then stands for . As an exercise, we invite the reader to verify the correctness of the reduction when , namely that and entail if and only if and are inconsistent.
It is also worth to mention known computational complexity results. Fact entailment in DatalogMTL is of high complexity; it is ExpSpace-complete [12] and PSpace-complete when measured with respect to the size of a dataset, that is, in data complexity [46]. Tractability in data complexity can be achieved by disallowing certain metric operators and restricting the form of rules [48].
In the remaining sections we will focus on algorithms for checking entailment. In particular, we will be interested in constructing the canonical interpretation for a given program and dataset . Once this is done, entailment of any fact can be checked by simply verifying if contains this fact or not. However, as we will show in the next section, construction of the canonical interpretation in DatalogMTL is a very non-trivial task.
3 The Never-Ending Story of Materialisation
In this section, we examine the application of standard naïve materialisation as a reasoning technique for DatalogMTL. While materialisation is highly efficient, unlike in classical Datalog it is not guaranteed to terminate in DatalogMTL. We complement this negative result with a positive one, identifying classes of DatalogMTL programs for which materialisation is guaranteed to terminate and thus yields a complete reasoning algorithm.
3.1 Naïve Materialisation
Materialisation-based reasoning is the most common technique of choice implemented in scalable Datalog reasoners [13, 32, 19, 9]. Facts entailed by a program and a dataset are derived in successive rounds of rule applications, mimicking applications of the immediate consequence operator. The process continues until a fixpoint is reached and a full materialisation – representing the canonical interpretation – has been computed. At this point, entailment (or answer to more complicated queries) can be checked directly over the computed materialisation.
In this section, we formulate a (possibly non-terminating) generic reasoning procedure for DatalogMTL based on materialisation. In this process, rules are applied by first identifying maximal intervals in which all ground body atoms of a rule hold simultaneously, and then determining intervals in which the head atoms should be derived. Details of this process are presented in Algorithm 1, which performs a single round of rule applications for a given input program and dataset.
To familiarise the reader with this algorithm, let us consider the following example.
Example 5.
Given the program and dataset , Algorithm 1 applies Rule (1) by first identifying as the subset-maximal interval such that we have . Hence, the application of the rule derives, as shown in the table from Example 4.
The result of applying Algorithm 1 to and is always a dataset (i.e., a finite object), and the following proposition establishes that this dataset represents the interpretation obtained by a single application of the immediate consequence operator associated to to the dataset . Thus, Algorithm 1 provides a syntactic counterpart to the application of the immediate consequence operator.
Proposition 6.
On input and , Algorithm 1 outputs a dataset representing .
Proof.
In each iteration of the loop, Algorithm 1 extends (in Line 9) the dataset with . Thus, to prove that the output of Algorithm 1 represents , it suffices to show that, after performing one iteration of the loop (Lines 3–9) for a rule , the dataset represents .
Indeed, for each body atom of , set (computed in Line 6) consists of intervals containing exactly those time points for which holds in . Thus, (computed in Line 7) consists of intervals containing exactly those time points in which all the body atoms of simultaneously hold in . Then intervals in (computed in Line 8) contain exactly those time points for which the head atom of is entailed by holding in intervals from . Therefore, represents , as required.
We next introduce Procedure 2 which, given a program and a dataset as input, performs materialisation by iteratively calling Algorithm 1 to compute a sequence of datasets, where each represents the interpretation .
The following Proposition 7 is a direct consequence of Proposition 6.
Proposition 7.
After iterations of the loop from Algorithm 2 on input and , the dataset represents .
If at some point in the sequence computed by Procedure 2, then Procedure 2 outputs . In particular, if we consider our exemplary program and dataset as input, Procedure 2 will stop after three iterations and return the dataset representing , as shown in Example 4.
In general, however, the procedure may not terminate. This is why we refer to it as a Procedure rather than an Algorithm. Indeed, for some programs and datasets, the construction of the canonical interpretation requires infinitely many applications of the immediate consequence operator. To illustrate such a behaviour consider the following example.
Example 8.
Consider a program and a dataset . If the proposition holds at some time point , then ensures that holds also in the interval . It follows that , for each , and that the canonical interpretation is reached only after (recall that is the first infinite ordinal, corresponding to the order type of the natural numbers ) applications of to .
An interesting question arises: for which DatalogMTL programs and datasets, application of the immediate consequence operator reaches a fixpoint in finitely many steps? In other words, when Procedure 2 is guaranteed to terminate, and so, it becomes an algorithm? Notice that this is an important question, as the answer would allow us to determine in which cases the procedure computes the full materialisation and becomes a decision procedure that can be used for checking entailment.
3.2 Finite Materialisability
To answer the questions from the end of the previous subsection, we will introduce the notion of finitely materialisable DatalogMTL programs. Intuitively, those are programs for which applications of the immediate consequence operator (or equivalently materialisation steps) allow us to obtain a fixpoint in a finite number of steps.
Definition 9.
Let be a program and an ordinal number. We say that the immediate consequence operator converges for a dataset in steps if .
Program is finitely materialisable for a dataset if converges for in some finite number of steps (or, equivalently, if Procedure 2 terminates in finite number of steps on input and ).
It follows from Proposition 7 that, for each program that is finitely materialisable for a dataset , there exists a dataset representing the canonical interpretation . The converse, however, does not hold: the canonical interpretation of a program and a dataset may admit a finite representation, but may be not finitely materialisable for , as we show next.
Example 10.
As shown in Example 4, program is finitely materialisable for dataset , and the dataset representing also represents the canonical interpretation. In contrast, if we consider program and dataset from Example 8, we can observe that the canonical interpretation can be represented by a single fact , whereas the operator does not converge for in a finite number of steps.
The notion of finite materialisability in Definition 9 is data dependent, in that a given program could be finitely materialisable for a given dataset, but perhaps not for a different dataset. We next provide a data-independent notion of finite materialisability.
Definition 11.
A program is called finitely materialisable if is finitely materialisable for all dataset.
Which programs satisfy this stronger notion of finite materialisability? As we show next, any non-recursive DatalogMTL program is guaranteed to be finitely materialisable.
Intuitively non-recursive programs are programs whose rules do not contain derivation loops such as in the rules and , where derivation of allows to derive , which allows to derive again, etc. Formally, (non)recursive programs are defined using the notion of the dependency graph of a program. The dependency graph of is a directed graph with a vertex for each predicate in and an edge if there is a rule mentioning in its body and in its head. For example the dependency graph of our is depicted below.
A program is said to be recursive, if its dependency graph is cyclic. Clearly the dependency graph above is cyclic, which implies that is a recursive program.
Next, we will show that each non-recursive program is finitely materialisable, by establishing a bound on the number of rounds of rule applications until the canonical interpretation is reached. In particular, we will show that this bound is given by the number of predicates occurring in
Proposition 12.
For any non-recursive program and for any dataset , it holds that .
Proof.
For each predicate in or , we let be the length of a longest path in the dependency graph of , which ends in (or 0 if no such path exists). Note that since is non-recursive, its dependency graph has no cycles, and so, , for each . Thus, it suffices to show that, for each relational fact , if , then . We proceed by induction on .
For the base case, assume that , for some with . Since , either does not occur in , or occurs in and has no incoming edges. In both cases implies that , and so, .
For the inductive step, assume that , where . If , then , and so, . Otherwise, there exists a rule in and a time point such that all the body atoms of are satisfied at and the head of being satisfied at entails . By the definition of the dependency graph, we have for each predicate occurring in the body of . Therefore, by the inductive assumption, all the body atoms of must be satisfied at in . Consequently, , and so, .
Moreover, the following example shows that the bound on the number of applications of the immediate consequence operator in Proposition 12 is optimal.
Example 13.
Consider an arbitrary and a program comprising the rules
Clearly, is non-recursive and . Now, consider a dataset . We obtain that, for each , the interpretation entails . Thus, , so the bound on the number of rounds of rule application to materialise a non-recursive program, established in Proposition 12, cannot be decreased.
Both data-dependent and data-independent notions of finite materialisability in DatalogMTL have been studied in depth, giving rise to a number of interesting results. It is worth mentioning that tight complexity bounds and algorithms for finite materialisability checking have been established. Moreover, efficiently verifiable sufficient conditions for finite materialisability has been provided [53, 54].
To conclude this section, let us recall that materialisation is an iterative procedure that applies the immediate consequence operator repeatedly to the input dataset. Unlike in atemporal Datalog, materialisation in DatalogMTL is not guaranteed to terminate. Nevertheless, one can check whether a given program is finitely materialisable, that is, whether materialisation on this program is guaranteed to halt after finitely many steps. In particular, as we have shown, all non-recursive DatalogMTL programs enjoy this property.
In the next section, we turn to a different reasoning approach for DatalogMTL. Rather than restricting the language to ensure termination of materialisation, we show a more sophisticated mechanism that can detect infinite derivations and exploit this information to compute the full materialisation using a terminating algorithm.
4 Taming the Infinite: The Saturation Algorithm
In this section we present a more sophisticated reasoning algorithm for DatalogMTL. This algorithm [55, 3] will perform standard materialisation steps, but instead of running until a fixpoint is reached, it halts once a partial materialisation satisfies a condition we call saturation. As we will show, saturation is guaranteed to occur after a bounded number of materialisation steps, and the full canonical interpretation can then be reconstructed from the saturated partial materialisation. As a result, we will obtain a terminating procedure that is both sound and complete.
A key advantage of this approach is that it does not require syntactic restrictions on the interplay of rules, such as the absence of recursion discussed in the previous section, nor does it rely on the assumption that the program is finitely materialisable. The only requirement is that all intervals in the program and dataset are bounded, that is, they do not use or as interval endpoints. This restriction still captures a large and expressive fragment of DatalogMTL. Notice, in particular, that our from Example 2 is a bounded program. Moreover, it is known that complexity-wise reasoning in bounded DatalogMTL is as hard as reasoning in the unrestricted language [53]. Extending the algorithm to the setting of unbounded intervals remains an interesting open challenge.
In the following subsections we will observe that canonical interpretations have a regular form. Then we will introduce the concept of saturated interpretations and their unfoldings into canonical interpretations. Finally, we will show a full reasoning algorithm.
4.1 -ruler and -intervals
The aim of this short subsection is to show an interesting result about the regular form of the canonical interpretation [46]. The main concepts that we will use to describe this regularity are those of a -ruler and the corresponding -intervals.
Definition 14.
For a program and a dataset , we let the -ruler be the set of all time points of the form , for a time point mentioned in (as an endpoint of some interval), , and , where is the product of all denominators occurring in the representation of the rational endpoints of the intervals mentioned in (if has no intervals with rational endpoints, then , and hence, ). A -interval, in turn, is either a punctual interval over a time point on the -ruler, or an interval of the form , where and are consecutive time points on the -ruler.
Example 15.
Consider the program and the dataset from Example 2. Since all rational numbers occurring in are integers, . Furthermore, as , , and are the only numbers occurring in , the -ruler consists of all rational numbers of the form , , and , for any integer . Hence, -intervals are, for example, , , , and , as depicted below.
Now, we say that an interpretation is a -interpretation if, for every fact , it holds that implies , where is the -interval containing . In other words, relational atoms hold uniformly over the -intervals. The main result, we will need in the remaining parts of this section, is that the canonical interpretation and all partial materialisations are -interpretations [46] as stated next.
Theorem 16.
The canonical interpretation of a program and a dataset , as well as the interpretations for any ordinal , are -interpretations.
The proof of this statement is not hard – it can be obtained by induction on , by showing that is a -interpretation, and each application of the immediate consequence operator leads to a -interpretation. We invite the reader to write a full proof as an exercise.
In the next subsection we will use the above observation about the canonical intepretation structure to define saturated interpretations.
4.2 Saturated Interpretations and Their Unfoldings
The main aim of this subsection is to present saturation conditions stating the properties that a partial materialisation needs to satisfy so that the it can be used to recover the full canonical interpretation. We call an interpretation satisfying these conditions saturated and show how to compute relevant periods and exploit them to unfold the interpretation into the canonical interpretation of and .
For convenience of presentation, we fix for the remainder of this subsection an arbitrary bounded program , bounded dataset , and natural number . To make the first observation we need to introduce additional notions. We let the depth of a rule , written as , be the sum of the right endpoints in all intervals occurring in (or if mentions no intervals). For example, the depth of Rule (3) is . The depth of a program , written as , is the maximum depth of its rules; hence, bounded programs have finite depth. Moreover, for an interpretation and an interval , we let the projection of over be the interpretation that coincides with on and makes all relational atoms false outside .
As shown in the following proposition, the depth of a bounded rule determines the time points that can be “affected” by an application of this rule.
Proposition 17.
For every interpretation , time point , and bounded rule , it holds that satisfies at if and only if so does .
Proof.
By definition, satisfies at if and only if the body of does not hold at or the head of holds at . By the definition of , all the facts corresponding to the satisfaction of the body and the head of at are over intervals contained in . This implies the claim in the proposition.
Our next aim is to define a saturated interpretation. For this, however, we will need to introduce additional concepts.
For a dataset , we let and be the minimal and maximal numbers mentioned as interval endpoints in (if does not mention any numbers, we let both and be ). We say that an interpretation satisfies in an interval if, for each and each , whenever satisfies each body atom of at , then satisfies the head of at . Furthermore, we say that an interpretation is a shift of if there exists a rational number such that if and only if , for each fact .
With the above concepts introduced, we are ready to present the definition of a saturated interpretation.
Definition 18.
Interpretation is saturated if there exist closed intervals , , , and of length , whose endpoints are located on the -ruler and satisfy and , and such that the following properties hold:
-
satisfies in ;
-
and are shifts of and , respectively.
Any pair of intervals and , for , , , as above, will be referred to as periods of .
Intuitively, a saturated interpretation contains a “central fragment” which satisfies and such that a single application of does not derive any new facts within this fragment (i.e., the interpretation satisfies within ). In the left segment of this “central fragment” there are two intervals and – each of length – in which satisfies the same relational facts modulo a shift. Analogously, in the right segment of the “central fragment” there are intervals and also with repeating contents.
It is worth emphasising that in the definition of a saturated interpretation (first item), we consider only a single materialisation step, which can be effectively checked. As we will show in Theorem 21, rather surprisingly, this condition is enough to guarantee that a saturated interpretation can be unfolded into the canonical interpretation.
We next define the unfolding of a saturated interpretation relatively to a pair of its periods. Although there can be many such pairs of intervals, the key properties of the unfolding are independent of the choice of periods.
Definition 19.
The -unfolding, of a saturated interpretation with periods , is the interpretation such that:
-
,
-
is a shift of , for any ,
-
is a shift of , for any .
We observe that the unfolding is unique and can be obtained from the least interpretation coinciding with on by subsequently copying the fragment of this interpretation that spans infinitely many times to the left and the fragment of this interpretation that spans infinitely many times towards the right on the timeline.
In Theorem 21 we will show that the unfolding of a saturated interpretation coincides with the canonical interpretation. The proof of this theorem exploits the following technical lemma.
Lemma 20.
Let be a closed interval of length and a dataset representing . Then both of the following hold:
-
1.
If , then .
-
2.
If , then .
Proof sketch.
Both items have similar proofs, so we focus on the first one. The inclusion follows from the fact that , so . To show that it suffices to prove inductively that, for every ordinal and relational fact with , if , then .
Theorem 21.
The -unfolding of a saturated interpretation with periods coincides with the canonical interpretation .
Proof sketch.
We first show that . Since is the least model of and , it suffices to show that is a model of and . As , we obtain that the projection of over is a model of . However, by Definition 19, and coincide on , so is also a model of . To show that satisfies in , it suffices, by Proposition 17, to show that the projection of over satisfies in ; this holds since and coincide on and satisfies in , as it is saturated. It remains to argue that satisfies at each outside . Assume that , so . Then, there exists a unique pair of and such that . This, by the definition of , implies that is a shift of . Thus, by Proposition 17, satisfies at if and only if satisfies at . The latter holds since and, as we already showed, satisfies in . The proof for is similar, so .
We show that . The projection of over is in since and coincide on this interval and . To show that the projection of over is in , we argue that by induction on consecutive timepoints on the -ruler, with . The base holds since and coincide on . For the inductive step, let , , , and . Hence, it suffices to show that . We note that is a shift of by the construction of and the fact that . Thus, by the inductive assumption and , we obtain that is a shift of . By the construction of we know that is a shift of and since the lengths of and equal , we can use Lemma 20 to show that is a shift of . By the inductive assumption, and so, . The proof of the inclusion is symmetric; thus, .
Theorem 21 states that the unfolding of a saturated interpretation around any pair of its periods coincides with the canonical interpretation. Thus, we can refer to an unfolding of a saturated interpretation without explicitly referring to its periods.
We conclude this section by establishing a bound , depending on and , which ensures that is saturated for some . Intuitively, is the number of facts that we can construct by combining atoms relevant to and with -intervals contained in a sufficiently large interval . The interval is chosen so that , and such that its fragments and to the left and right of , respectively, contain so many intervals of length with endpoints on the -ruler, that their contents need to repeat. These repetitions guarantee the existence of intervals from Definition 18.
Theorem 22.
There exists such that is saturated, where the bound is as follows.
Let be the number of ground relational atoms in the grounding of with constants from and , let be the number of -intervals within , and let , where and are sequences of consecutive time points on the -ruler, while . Then is the product of and the number of -intervals contained in .
Proof sketch.
The canonical interpretation satisfies at most relational facts over -intervals contained in . Since each application of (before reaching a fixpoint) introduces at least one new relational fact over a -interval, there needs to exist such that . We argue that is saturated for such by showing that contains intervals satisfying the conditions from Definition 18. To show the existence of and , we observe that contains intervals of length whose endpoints are located on the -ruler to the left of . We can show that there must exist amongst them two distinct intervals and such that is a shift of . Indeed, each interval of the form , for on the -ruler, contains the same number of -intervals as does, which equals . In each of these -intervals there can hold at most combinations of relational atoms, which gives rise to different contents of an interval of the form . Additionally, these intervals can differ depending on the location of -intervals they contain. By the definition of the -ruler, there are at most different layouts of -intervals contained in an interval of the form . Hence, in total, there are at most intervals of the form with different contents. Thus, in a set of such intervals, there needs to be a pair of distinct intervals and such that is a shift of . Analogously, we can show the existence of required and to the right of , so the second item from Definition 18 holds. Moreover, since and , we obtain that satisfies in . Thus, the first item from Definition 18 holds as well, and so, is saturated.
The bound from Theorem 22 is doubly exponential in the size of and , but only exponential in the size of . This bound shows us how much time is needed to perform reasoning, which is consistent with the computational complexity of reasoning in DatalogMTL, namely ExpSpace in combined complexity [11] and PSpace in data complexity [46].
In the next section we will exploit the obtained results to provide a terminating reasoning algorithm.
4.3 Reasoning Algorithm Based on Saturation
The results from the previous section suggest the reasoning procedure formalised in Algorithm 3, which checks if a bounded program and a dataset entail a fact .
The algorithm successively applies the rules of to the dataset (Line 8) until one of two stopping conditions hold. The first condition (Line 3) detects if the materialisation constructed thus far entails the input fact , in which case the algorithm reports that the input fact is entailed. The second condition checks if is saturated (i.e., represents a saturated interpretation). To this end, the algorithm computes in Line 4 two non-empty intervals which are periods of (if is saturated), or introduces two empty intervals (if is not saturated). If is saturated, the algorithm exploits and its periods to check whether is entailed (Lines 6–7).
We next describe in detail the computations of the algorithm and establish its correctness. In what follows, we fix an arbitrary input , , and to Algorithm 3 and assume that the notions of a saturated interpretation and its periods are relative to and . We also let the projection of a dataset over an interval be the dataset obtained by intersecting all intervals in facts from with .
Rule Application.
In each iteration of the loop, Algorithm 3 applies the procedure (Line 8), which implements a single round of rule applications to , and thus, mimics an application of the immediate consequence operator to . Hence, in the beginning of a st iteration of the loop, the dataset in Algorithm 3 represents .
First Stopping Condition.
In Line 3, Algorithm 3 checks whether the materialisation constructed so far entails the input fact . Since facts in are stored in a coalesced form, to check if , it suffices to scan and verify whether there is with .
Second Stopping Condition.
Algorithm 3 calls the procedure in Line 4 to check, in an iteration of the loop, if is saturated. The procedure searches for intervals satisfying the conditions in Definition 18 and returns the periods of the interpretation if it is saturated or a pair of empty intervals otherwise. To this end, the procedure performs one round of rule applications to , computing . Then, it computes an interval as either the empty interval (if and do not coincide on ), or otherwise as the maximal interval containing and such that and coincide on . Interval is next used to search for and , namely all pairs of intervals contained in , located to the left of , with endpoints on the -ruler, and of lengths , are compared. The first pair of such intervals with the same contents in is set as and ; otherwise and are empty intervals. In a similar way intervals and are computed. Finally, the procedure outputs a pair of intervals , or if any of the intervals is empty.
Fact Entailment Checking after Saturation.
After constructing a saturated dataset (representing , for some ) with periods , Algorithm 3 calls the procedure (Line 6) to check whether the input fact holds in the unfolding of . This can be easily checked by exploiting Definition 19 of unfolding.
From our theoretical results in the previous subsection it follows that the algorithm is sound and complete:
Theorem 23.
Algorithm 3 outputs if , otherwise it outputs . Moreover, the algorithm terminates after at most (c.f. Theorem 22) iterations of its main loop.
We conclude this section with an example illustrating the execution of Algorithm 3.
Example 24.
Consider , , and a query fact . After 5 iterations of the loop in Algorithm 3, the dataset consists of facts and , for all . The stopping condition from Line 3 does not hold, but the condition in Line 5 does. Indeed, is saturated and its periods computed in Line 4 are and . The unfolding of is the canonical interpretation of and depicted in the figure below. Then, in Line 6, Algorithm 3 can exploit , , and to detect entailment of any fact. In particular, the input fact is entailed, and so, Algorithm 3 returns in Line 6.
5 Time to Conclude
We have introduced DatalogMTL, as an expressive rule-based language for temporal reasoning. After presenting formal syntax and semantics of DatalogMTL, we have discussed its reasoning algorithms. In particular, we have discussed two ways to perform reasoning. The first is based on iterative application of rules of a DatalogMTL program until no further facts can be derived. Such a procedure can be easily implemented, but it does not guarantee termination. Then, we have presented an algorithm which extends materialisation with checking an additional condition – which we call saturation. A saturated partial materialisation can always be constructed in a bounded number of steps, and can be used to construct the full canonical interpretation.
In what follows we will present a list of further research topics and papers on DatalogMTL, as well as some interesting open problems.
5.1 Further Reading and Related Work
DatalogMTL was first introduced under the continuous semantics and over the rational timeline [11]. The complexity of standard reasoning tasks in DatalogMTL and its fragments was further investigated [12, 46, 48, 8]. DatalogMTL has also been studied over the integer timeline [47] and under the event-based semantics [36]. DatalogMTL has recently been extended with negation-as-failure under the stable model semantics, first for stratified programs [38] and subsequently for the general case [52]. It was also studied in the setting of existential rules [30]. Very recently, inconsistency handling in DatalogMTL has been studied, by introducing temporal versions of conflicts and repairs, as well as establishing the computational complexity of their generation [10].
MeTeoR [41] is the first reasoner to support the full DatalogMTL language by combining materialisation-based and automata-based techniques, and has been successfully applied for solving stream reasoning tasks [37]. It has been further optimised with several techniques such as seminaive materialisation [40, 42] and magic sets [45]. Earlier systems with DatalogMTL support, such as the Ontop platform [28], performed reasoning via rewriting into SQL and were restricted to non-recursive programs. Reasoning methods based on solving linear inequalities for a language similar to DatalogMTL were also introduced [14]. Another reasoning approach has been recently introduced by extending the Datalog system Vadalog [7]. DatalogMTL has proved useful for temporal stream reasoning [49, 37, 50], temporal ontology-based data access [11], specification and verification of banking agreements [34], fact-checking economic claims [31], and for describing dance movements [35], among others. DatalogMTL has been also studied in the context of learning temporal rules from datasets [43] and to study the ability of LLMs to perform temporal reasoning [20, 44].
Extensions of DatalogMTL with non-monotonic negation are closely related to temporal extensions of answer set programming (ASP) [2]. Particularly relevant is a recently introduced extension of ASP with MTL operators [16]. Previously, ASP was also extended with LTL operators, giving rise to temporal equilibrium logic TEL [18, 23, 15], which has been implemented in the Telingo system [17]. Additionally, LARS [6] combines ASP and MTL operators for reasoning over data streams. It is worth observing that, unlike DatalogMTL, all these temporal extensions of ASP are interpreted over the integer timeline. Bidirectional ASP programs provide another related extension of ASP with functional symbols – they allow for modeling the integer timeline while ensuring decidability of reasoning [24, 25]. Operators from MTL have also been exploited in temporal extensions of description logics (DLs) [26, 5, 39, 4].
5.2 Open Problems
Research on DatalogMTL has opened a number of interesting directions and left several important questions unanswered. We highlight some of them below:
-
Algorithms: The saturation-based algorithm presented in Section 4 is designed only for the bounded setting, namely for programs and datasets that do not use or as interval endpoints. Extending this approach to the full language of DatalogMTL remains an open problem. Such an extension appears to require not just the computation of a single saturated interpretation, but rather a sequence of them. Developing such an algorithm and establishing its correctness constitutes a significant technical challenge of high theoretical and practical importance.
-
Computational Complexity: A number of tight complexity bounds for DatalogMTL and its fragments are already known. However, one fragment whose complexity remains unresolved – despite substantial effort – is DatalogMTL, which allows only core rules (rules with head or at most one body atom) and restricts temporal operators to . Interestingly, similar “core box” fragments also lack tight complexity results in other temporal logics, such as interval temporal logics. This suggests the existence of a broader complexity challenge. Progress on DatalogMTL could provide insights that extend beyond this language, potentially unlocking solutions to analogous problems in other temporal frameworks.
-
Characterisation of Neural Models: Recent work has established a close correspondence between the expressive power of Datalog and Graph Neural Networks (GNNs) – neural architectures designed for processing graph-structured data [21]. In parallel, temporal extensions of GNNs have emerged [51]. This naturally raises the question of whether the expressive power of such temporal architectures can be captured by temporal extensions of Datalog, such as DatalogMTL.
The open problems we have listed illustrate just some of the many directions in which the study of DatalogMTL can advance. They range from fundamental algorithmic challenges, through unresolved complexity questions, to emerging connections with neural models. This list is by no means exhaustive, and together these questions highlight exciting opportunities for future research.
References
- [1] Serge Abiteboul, Richard Hull, and Victor Vianu. Foundations of Databases. Addison-Wesley, 1995.
- [2] Felicidad Aguado, Pedro Cabalar, Martín Diéguez, Gilberto Pérez, Torsten Schaub, Anna Schuhmann, and Concepción Vidal. Linear-time temporal answer set programming. Theory and Practice of Logic Programming, pages 1–55, 2021.
- [3] Wałęga Przemysław Andrzej, Michał Zawidzki, and Christoph Haase. Computing all facts entailed by an ltl specification. In Proceedings of the International Conference on Principles of Knowledge Representation and Reasoning, volume 19, pages 679–689, 2023.
- [4] Alessandro Artale and Enrico Franconi. A temporal description logic for reasoning about actions and plans. Journal of Artificial Intelligence Research, 9:463–506, 1998. doi:10.1613/JAIR.516.
- [5] Franz Baader, Stefan Borgwardt, Patrick Koopmann, Ana Ozaki, and Veronika Thost. Metric temporal description logics with interval-rigid names. ACM Trans. Comput. Log., 21(4):30:1–30:46, 2020. doi:10.1145/3399443.
- [6] Harald Beck, Minh Dao-Tran, Thomas Eiter, and Christian Folie. Stream reasoning with LARS. KI - Künstliche Intelligenz, 32(2):193–195, 2018. doi:10.1007/S13218-018-0537-9.
- [7] Luigi Bellomarini, Livia Blasi, Markus Nissl, and Emanuel Sallinger. The temporal vadalog system: Temporal datalog-based reasoning. Theory and Practice of Logic Programming, 25(2):168–196, 2025. doi:10.1017/S1471068425000018.
- [8] Luigi Bellomarini, Markus Nissl, and Emanuel Sallinger. Query evaluation in DatalogMTL – taming infinite query results. CoRR, abs/2109.10691, 2021. arXiv:2109.10691.
- [9] Luigi Bellomarini, Emanuel Sallinger, and Georg Gottlob. The Vadalog system: Datalog-based reasoning for knowledge graphs. Proceedings of the VLDB Endowment, 11(9):975–987, 2018. doi:10.14778/3213880.3213888.
- [10] Meghyn Bienvenu, Camille Bourgaux, and Atefe Khodadaditaghanaki. Inconsistency handling in datalogmtl. arXiv preprint arXiv:2505.10394, 2025. doi:10.48550/arXiv.2505.10394.
- [11] Sebastian Brandt, Elem Güzel Kalayci, Roman Kontchakov, Vladislav Ryzhikov, Guohui Xiao, and Michael Zakharyaschev. Ontology-based data access with a Horn fragment of metric temporal logic. In Proc. of AAAI, pages 1070–1076, 2017. doi:10.1609/AAAI.V31I1.10696.
- [12] Sebastian Brandt, Elem Güzel Kalaycı, Vladislav Ryzhikov, Guohui Xiao, and Michael Zakharyaschev. Querying log data with metric temporal logic. J. Artif. Intell. Res., 62:829–877, 2018. doi:10.1613/JAIR.1.11229.
- [13] François Bry, Norbert Eisinger, Thomas Eiter, Tim Furche, Georg Gottlob, Clemens Ley, Benedikt Linse, Reinhard Pichler, and Fang Wei. Foundations of rule-based query answering. In Reasoning Web, volume 4636, pages 1–153, 2007. doi:10.1007/978-3-540-74615-7_1.
- [14] Christoph Brzoska. Programming in metric temporal logic. Theoretical Computer Science, 202(1-2):55–125, 1998. doi:10.1016/S0304-3975(97)00139-4.
- [15] Pedro Cabalar. Temporal ASP: From logical foundations to practical use with telingo. In Mantas Šimkus and Ivan Varzinczak, editors, Reasoning Web. Declarative Artificial Intelligence, pages 94–114, 2022.
- [16] Pedro Cabalar, Martín Diéguez, Torsten Schaub, and Anna Schuhmann. Towards metric temporal answer set programming. Theory and Practice of Logic Programming, 20(5):783–798, 2020. doi:10.1017/S1471068420000307.
- [17] Pedro Cabalar, Roland Kaminski, Philip Morkisch, and Torsten Schaub. telingo = asp + time. In Marcello Balduccini, Yuliya Lierler, and Stefan Woltran, editors, Logic Programming and Nonmonotonic Reasoning, pages 256–269, 2019. doi:10.1007/978-3-030-20528-7_19.
- [18] Pedro Cabalar and Gilberto Pérez Vega. Temporal equilibrium logic: A first approach. In Roberto Moreno Díaz, Franz Pichler, and Alexis Quesada Arencibia, editors, Computer Aided Systems Theory, pages 241–248, 2007. doi:10.1007/978-3-540-75867-9_31.
- [19] David Carral, Irina Dragoste, Larry González, Ceriel J. H. Jacobs, Markus Krötzsch, and Jacopo Urbani. Vlog: A rule engine for knowledge graphs. In The Semantic Web - ISWC, volume 11779, pages 19–35, 2019. doi:10.1007/978-3-030-30796-7_2.
- [20] Andrea Colombo, Teodoro Baldazzi, Luigi Bellomarini, Andrea Gentili, and Emanuel Sallinger. Llm-based datalogmtl modelling of micar-compliant crypto-assets markets. In Datalog in Academia and Industry (Datalog-2.0 2024), volume 3801, pages 17–22, 2024. URL: https://ceur-ws.org/Vol-3801/short1.pdf.
- [21] David Jaime Tena Cucala, Bernardo Cuenca Grau, Egor V. Kostylev, and Boris Motik. Explainable GNN-based models over knowledge graphs. In International Conference on Learning Representations ICLR, 2022.
- [22] Evgeny Dantsin, Thomas Eiter, Georg Gottlob, and Andrei Voronkov. Complexity and expressive power of logic programming. ACM Computing Surveys, 33(3), 2001. doi:10.1145/502807.502810.
- [23] Martín Diéguez. Temporal answer set programming. In Agostino Dovier and Vítor Santos Costa, editors, International Conference on Logic Programming, ICLP, volume 17, pages 445–450, 2012. doi:10.4230/LIPICS.ICLP.2012.445.
- [24] Thomas Eiter and Mantas Simkus. Bidirectional answer set programs with function symbols. In International Joint Conference on Artificial Intelligence, IJCAI, pages 765–771, 2009. URL: http://ijcai.org/Proceedings/09/Papers/132.pdf.
- [25] Thomas Eiter and Mantas Simkus. FDNC: decidable nonmonotonic disjunctive logic programs with function symbols. ACM Transactions on Computational Logic, 11(2):14:1–14:50, 2010. doi:10.1145/1656242.1656249.
- [26] Víctor Gutiérrez-Basulto, Jean Christoph Jung, and Ana Ozaki. On metric temporal description logics. In European Conference on Artificial Intelligence ECAI, volume 285, pages 837–845, 2016. doi:10.3233/978-1-61499-672-9-837.
- [27] Alex Ivliev, Lukas Gerlach, Simon Meusel, Jakob Steinberg, and Markus Krötzsch. Nemo: your friendly and versatile rule reasoning toolkit. In International Conference on Principles of Knowledge Representation and Reasoning KR, pages 743–754, 2024.
- [28] Elem Güzel Kalayci, Sebastian Brandt, Diego Calvanese, Vladislav Ryzhikov, Guohui Xiao, and Michael Zakharyaschev. Ontology–based access to temporal data with Ontop: A framework proposal. Int. J. Appl. Math., 29(1):17–30, 2019. doi:10.2478/AMCS-2019-0002.
- [29] Ron Koymans. Specifying real-time properties with metric temporal logic. Real-Time Syst., 2(4):255–299, 1990. doi:10.1007/BF01995674.
- [30] Matthias Lanzinger, Markus Nissl, Emanuel Sallinger, and Przemysław Andrzej Wałęga. Temporal datalog with existential quantification. In Proc. of IJCAI, pages 3277–3285, 2023.
- [31] Marco Mori, Paolo Papotti, Luigi Bellomarini, and Oliver Giudice. Neural machine translation for fact-checking temporal claims. In Extraction and VERification Workshop (FEVER), pages 78–82, 2022.
- [32] Boris Motik, Yavor Nenov, Robert Piro, Ian Horrocks, and Dan Olteanu. Parallel materialisation of Datalog programs in centralised, main-memory RDF systems. In Conference on Artificial Intelligence AAAI, pages 129–137, 2014. doi:10.1609/AAAI.V28I1.8730.
- [33] Yavor Nenov, Robert Piro, Boris Motik, Ian Horrocks, Zhe Wu, and Jay Banerjee. Rdfox: A highly-scalable rdf store. In International Semantic Web Conference, pages 3–20. Springer, 2015. doi:10.1007/978-3-319-25010-6_1.
- [34] Markus Nissl and Emanuel Sallinger. Modelling smart contracts with DatalogMTL. In Proc. of EDBT/ICDT, 2022.
- [35] Katerina El Raheb, Theofilos Mailis, Vladislav Ryzhikov, Nicolas Papapetrou, and Yannis E. Ioannidis. Balonse: Temporal aspects of dance movement and its ontological representation. In International Conference, ESWC, volume 10250, pages 49–64, 2017. doi:10.1007/978-3-319-58451-5_4.
- [36] Vladislav Ryzhikov, Przemysław Andrzej Wałęga, and Michael Zakharyaschev. Data complexity and rewritability of ontology-mediated queries in metric temporal logic under the event-based semantics. In Proc. of IJCAI, pages 1851–1857, 2019.
- [37] Patrik Schneider, Daniel Alvarez-Coello, Anh Le-Tuan, Manh Nguyen-Duc, and Danh Le-Phuoc. Stream reasoning playground. In The Semantic Web: 19th International Conference, ESWC, pages 406–424, 2022. doi:10.1007/978-3-031-06981-9_24.
- [38] David J. Tena Cucala, Przemysław Andrzej Wałęga, Bernardo Cuenca Grau, and Egor V. Kostylev. Stratified negation in Datalog with metric temporal operators. In Proc. of AAAI, pages 6488–6495, 2021.
- [39] Veronika Thost. Metric temporal extensions of DL-Lite and interval-rigid names. In Principles of Knowledge Representation and Reasoning KR, pages 665–666. AAAI Press, 2018. URL: https://aaai.org/ocs/index.php/KR/KR18/paper/view/18035.
- [40] Dingmin Wang, Bernardo Cuenca Grau, Przemysław Andrzej Wałęga, and Pan Hu. Practical reasoning in datalogmtl. Theory and Practice of Logic Programming, 25(2):225–255, 2025. doi:10.1017/S1471068424000164.
- [41] Dingmin Wang, Pan Hu, Przemysław Andrzej Wałęga, and Bernardo Cuenca Grau. MeTeoR: Practical reasoning in Datalog with metric temporal operators. In Proc. of AAAI, pages 5906–5913, 2022.
- [42] Dingmin Wang, Przemysław Andrzej Wałęga, and Bernardo Cuenca Grau. Seminaive materialisation in DatalogMTL. In International Joint Conference on Rules and Reasoning, pages 183–197. Springer, 2022.
- [43] Dingmin Wang, Przemysław Andrzej Wałęga, and Bernardo Cuenca Grau. MTLearn: extracting temporal rules using datalog rule learners. In Proceedings of the International Conference on Principles of Knowledge Representation and Reasoning, volume 21, pages 962–973, 2024.
- [44] Dingmin Wang, Bocheng Zou, and Zhen Han. tBen: Benchmarking and testing the rule-based temporal logic reasoning ability of large language models with datalogmtl, 2024.
- [45] Shaoyu Wang, Kaiyue Zhao, Dongliang Wei, Przemysław Andrzej Wałęga, Dingmin Wang, Hongming Cai, and Pan Hu. Goal-driven reasoning in datalogmtl with magic sets. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 39, pages 15203–15211, 2025.
- [46] Przemysław Andrzej Wałęga, Bernardo Cuenca Grau, Mark Kaminski, and Egor V. Kostylev. DatalogMTL: Computational complexity and expressive power. In Proc. of IJCAI, pages 1886–1892, 2019.
- [47] Przemysław Andrzej Wałęga, Bernardo Cuenca Grau, Mark Kaminski, and Egor V. Kostylev. DatalogMTL over the integer timeline. In Proc. of KR, pages 768–777, 2020.
- [48] Przemysław Andrzej Wałęga, Bernardo Cuenca Grau, Mark Kaminski, and Egor V. Kostylev. Tractable fragments of Datalog with metric temporal operators. In Proc. of IJCAI, pages 1919–1925, 2020.
- [49] Przemysław Andrzej Wałęga, Mark Kaminski, and Bernardo Cuenca Grau. Reasoning over streaming data in metric temporal Datalog. In Proc. of AAAI, pages 3092–3099, 2019.
- [50] Przemysław Andrzej Wałęga, Mark Kaminski, Dingmin Wang, and Bernardo Cuenca Grau. Stream reasoning with DatalogMTL. J. Web Semant., 76:100776, 2023. doi:10.1016/J.WEBSEM.2023.100776.
- [51] Przemysław Andrzej Wałęga and Michael Rawson. Expressive power of temporal message passing. In Proc. of AAAI, pages 21000–21008, 2025.
- [52] Przemysław Andrzej Wałęga, David J. Tena Cucala, Egor V. Kostylev, and Bernardo Cuenca Grau. DatalogMTL with negation under stable models semantics. In Proc. of KR, pages 609–618, 2021.
- [53] Przemysław Andrzej Wałęga, Michał Zawidzki, and Bernardo Cuenca Grau. Finitely materialisable Datalog programs with metric temporal operators. In Proc. of KR, pages 619–628, 2021.
- [54] Przemysław Andrzej Wałęga, Michał Zawidzki, and Bernardo Cuenca Grau. Finite materialisability of Datalog programs with metric temporal operators. J. Artif. Intell. Res., 76, 2023. doi:10.1613/JAIR.1.14040.
- [55] Przemysław Andrzej Wałęga, Michał Zawidzki, Dingmin Wang, and Bernardo Cuenca Grau. Materialisation-based reasoning in DatalogMTL with bounded intervals. In AAAI Conference on Artificial Intelligence, pages 6566–6574, 2023.
