Localized RETE for Incremental Graph Queries
Matthias Barkowsky, Holger Giese
TL;DR
The paper tackles the inefficiency of global RETE-based incremental graph queries when users are interested in a subgraph $H_p \subseteq H$. It proposes a marking-sensitive, localized RETE extension that anchors execution to the relevant subgraph while lazily fetching necessary external elements via Localized Search structures $LNS$ and Request Projection Structures $RPS$, ensuring completeness under $H_p$. The authors prove that localized RETE nets yield complete results with a bounded memory footprint and present an execution order, along with empirical evaluations across synthetic, real AS graphs, and the LDBC benchmark, showing memory and initial/execution-time benefits in favorable subgraph scenarios, at the cost of linear overhead in unfavorable cases. The approach facilitates integration with lazy-loading persistence layers and sets the stage for future work on nested graph conditions and bulk partial-loading. Overall, the work demonstrates a principled trade-off for subgraph-centered incremental querying that can substantially improve scalability when users work on partially loaded models.
Abstract
Context: The growing size of graph-based modeling artifacts in model-driven engineering calls for techniques that enable efficient execution of graph queries. Incremental approaches based on the RETE algorithm provide an adequate solution in many scenarios, but are generally designed to search for query results over the entire graph. However, in certain situations, a user may only be interested in query results for a subgraph, for instance when a developer is working on a large model of which only a part is loaded into their workspace. In this case, the global execution semantics can result in significant computational overhead. Contribution: To mitigate the outlined shortcoming, in this paper we propose an extension of the RETE approach that enables local, yet fully incremental execution of graph queries, while still guaranteeing completeness of results with respect to the relevant subgraph. Results: We empirically evaluate the presented approach via experiments inspired by a scenario from software development and an independent social network benchmark. The experimental results indicate that the proposed technique can significantly improve performance regarding memory consumption and execution time in favorable cases, but may incur a noticeable linear overhead in unfavorable cases.
