Materialisation facilitates Datalog reasoning by precomputing all consequences of the facts and the rules so that queries can be directly answered over the materialised facts. However, storing all materialised facts may be infeasible in practice, especially when the rules are complex and the given set of facts is large. We observe that for certain combinations of rules, there exist data structures that compactly represent the reasoning result and can be efficiently queried when necessary. In this paper, we present a general framework that allows for the integration of such optimised storage schemes with standard materialisation algorithms. Moreover, we devise optimised storage schemes targeting at transitive rules and union rules, two types of (combination of) rules that commonly occur in practice. Our experimental evaluation shows that our approach significantly improves memory consumption, sometimes by orders of magnitude, while remaining competitive in terms of query answering time.
翻译:物质化通过预计算所有事实和规则的推论结果,使查询能够直接基于物质化事实进行回答,从而促进Datalog推理。然而,在实践中存储所有物质化事实可能不可行,尤其是当规则复杂且给定事实集规模较大时。我们观察到,对于某些规则组合,存在能够紧凑表示推理结果的数据结构,并且在需要时可高效查询。本文提出一个通用框架,允许将此类优化存储方案与标准物质化算法相结合。此外,我们针对实践中常见的两种规则类型——传递规则和联合规则——设计了优化存储方案。实验评估表明,我们的方法显著降低了内存消耗(有时降低数个数量级),同时在查询回答时间方面仍具有竞争力。