Incremental Maintenance of DatalogMTL Materialisations
Kaiyue Zhao, Dingqi Chen, Shaoyu Wang, Pan Hu
TL;DR
The paper tackles the problem of maintaining DatalogMTL materialisations under dynamic updates by introducing DRedMTL, an incremental algorithm built on the classic DRed approach but adapted for temporal recursion through periodic materialisations. It develops a seminaïve evaluation operator tailored to the DatalogMTL setting and a period identification mechanism to ensure finite termination, enabling unfolding of infinite temporal reasoning into a finite representation. The method employs a trio of periodic operators (Ext, Aln, Cup) and three update phases (Overdelete, Rederive, Insert) to update the materialisation efficiently without full recomputation. Experiments on multiple public benchmarks demonstrate substantial speedups over rematerialisation, especially for small updates, highlighting the approach's practicality for streaming and time-sensitive domains. The work lays the foundation for scalable, dynamic temporal reasoning in real-world applications and suggests avenues for integrating with other incremental strategies and stream-processing frameworks.
Abstract
DatalogMTL extends the classical Datalog language with metric temporal logic (MTL), enabling expressive reasoning over temporal data. While existing reasoning approaches, such as materialisation based and automata based methods, offer soundness and completeness, they lack support for handling efficient dynamic updates, a crucial requirement for real-world applications that involve frequent data updates. In this work, we propose DRedMTL, an incremental reasoning algorithm for DatalogMTL with bounded intervals. Our algorithm builds upon the classical DRed algorithm, which incrementally updates the materialisation of a Datalog program. Unlike a Datalog materialisation which is in essence a finite set of facts, a DatalogMTL materialisation has to be represented as a finite set of facts plus periodic intervals indicating how the full materialisation can be constructed through unfolding. To cope with this, our algorithm is equipped with specifically designed operators to efficiently handle such periodic representations of DatalogMTL materialisations. We have implemented this approach and tested it on several publicly available datasets. Experimental results show that DRedMTL often significantly outperforms rematerialisation, sometimes by orders of magnitude.
