DatalogMTL is a logic-based formal language for specifying and reasoning over complex temporal events in real-time systems, obtained by extending Datalog with operatorsl from Metric Temporal Logic MTL.

Since its introduction in 2017, we have intensively studied its non-trivial theoretical properties and a wide range of its practical applications, which we are excited to gather and share via this website.


DatalogMTL: Theory and Practice of Temporal Reasoning

Date: 31 July 2022 (during KR'22 at FLOC'22)


Temporal data is ubiquitous in many applications such as stock trading, network flow anomaly detection, and equipment malfunction monitoring. Data analysis in these applications typically relies on the ability to recognise temporal events. Constructing a framework suitable for such a reasoning is, however, a highly challenging task. On the one hand, it is often required to express complex temporal patterns and reason about real-time events. On the other hand, reasoning is performed in the presence of large-scale temporal datasets and ontologies, for which, efficient reasoning mechanisms are essential.

To address these requirements, a novel formalism, DatalogMTL, has been recently proposed as a suitable language for specifying and reasoning over complex temporal events in real-time systems. DatalogMTL, is an extension of the well-known rule-based language Datalog with highly expressive operators from metric temporal logic (MTL) interpreted over the rational timeline. As a result, we obtain a powerful language for temporal knowledge representation and reasoning, which has found applications in ontology-based query answering and stream reasoning, among others.

During the tutorial we will present DatalogMTL and survey recently obtained results on its theoretical properties, with a focus on computational complexity analysis and reasoning mechanisms. Moreover, we will show demos of systems implementing these mechanisms and invite participants of the tutorial to test these systems.


1. Introduction and motivations

2. DatalogMTL

  • a. Syntax
  • b. Semantics
  • c. Reasoning problems
  • d. Computational complexity

3. Reasoning techniques

  • a. Materialisation
  • b. Translation to Linear Temporal Logic
  • c. Automata-based approach
  • d. Rewriting to First Order Logic
  • e. Stream Reasoning

4. Systems and demos

  • a. MeTeoR
  • b. Ontop

5. Open problems and future work



D. Wang, P. Hu, P.A. Wałęga, B. Cuenca Grau, MeTeoR: Practical Reasoning in Datalog with Metric Temporal Operators, AAAI, 2022. [pdf]

P.A. Wałęga, M. Zawidzki, B. Cuenca Grau, Finitely Materialisable Datalog Programs with Metric Temporal Operators, KR, 2021. [pdf][video]

P.A. Wałęga, D.J. Cucala, E.V. Kostylev, B. Cuenca Grau, DatalogMTL with Negation under Stable Models Semantics, KR, 2021. [pdf][video]

D.J. Cucala, P.A. Wałęga, B. Cuenca Grau, E.V. Kostylev, Stratified Negation in Datalog With Metric Temporal Operators, AAAI, 2021. [pdf]

Bellomarini, L., Nissl, M. and Sallinger, E., Query Evaluation in DatalogMTL--Taming Infinite Query Results, arXiv, 2021. [pdf]

Bellomarini, L., Nissl, M. and Sallinger, E., Monotonic Aggregation for Temporal Datalog, CEUR-WS, 2021. [pdf]

P.A. Wałęga, B. Cuenca Grau, M.Kaminski, E.V. Kostylev, DatalogMTL over the Integer Timeline, KR, 2020. [pdf]

P.A. Wałęga, B. Cuenca Grau, M.Kaminski, E.V. Kostylev, Tractable Fragments of Datalog with Metric Temporal Operators, IJCAI, 2020. [pdf]

P.A. Wałęga, B. Cuenca Grau, M.Kaminski, E.V. Kostylev, DatalogMTL: Computational Complexity and Expressive Power, IJCAI, 2019. [pdf]

P.A. Wałęga, M.Kaminski, B. Cuenca Grau, Reasoning over Streaming Data in Metric Temporal Datalog, AAAI, 2019. [pdf]

E.G.Kalayci, al el., Ontology-based access to temporal data with Ontop: A framework proposal. Applied Mathematics and Computer Science, 2019. [pdf]

S. Brandt, E. Guzel Kalayci, V. Ryzhikov, G. Xiao and M. Zakharyaschev, Querying Log Data with Metric Temporal Logic. JAIR, 2018. [pdf]

S. Brandt, E. Guzel Kalayci, R. Kontchakov, V. Ryzhikov, G. Xiao, and M. Zakharyaschev. Ontology-Based Data Access with a Horn Fragment of Metric Temporal Logic. AAAI, 2017. [pdf]




MeTeoR is a temporal reasoning tool, which supports fact entailment over arbitrary (i.e., potentially recursive) DatalogMTL programs and large-scale temporal datasets. .



Ontop is a Virtual Knowledge Graph system. It exposes the content of arbitrary relational databases as knowledge graphs. These graphs are virtual, which means that data remains in the data sources instead of being moved to another database.