New Complexity Bounds for Ontology‑Mediated Path Queries
Researchers show linear existential rules keep path query answering in NL data complexity while guarded rules push it to 2ExpTime combined complexity.
Jean‑François Baget, Meghyn Bienvenu, Marie‑Laure Mugnier and Michaël Thomazo published a paper on July 29, 2026 in the Journal of Artificial Intelligence Research (JAIR) that revisits the long‑standing problem of answering regular path queries over knowledge bases composed of a database instance and an ontology. The study focuses specifically on two‑way conjunctive regular path queries ((C)RPQs), which extend ordinary RPQs with negation and conjunction, making them more expressive for querying graph databases.1
The authors first analyze the case where the ontology is defined by linear existential rules – rules whose body contains at most one atom involving an existential variable. In this setting they prove that answering both RPQ and CRPQ instances is NL‑complete in data complexity. This matches the known result that plain RPQs without any ontological constraints are also NL‑complete when only the size of the input database matters.1
When considering combined complexity—counting both the size of the query and the ontology—the tasks become ExpTime‑complete in general. If there is a bound on predicate arity, then RPQ answering drops to PTime‑complete while CRPQ falls to PSpace‑complete. These results highlight how structural restrictions on the ontology can drastically influence tractability.1
For guarded existential rules, the authors provide a non‑trivial reduction from guarded to linear rules. They show that the combined complexity for (C)RPQs over guarded ontologies is 2ExpTime‑complete, matching the upper bound for conjunctive queries under arbitrary ontologies. In the bounded‑arity case this reduces to ExpTime, whereas data complexity remains PTime‑complete.1
This work builds on decades of research into query answering over knowledge graphs, a field pioneered by Bogdan Movreanu in the 1990s. The NP‑completeness results for conjunctive regular path queries are particularly significant because they suggest that even with relatively simple ontological constraints—rules like “if X is a parent of Y then…”—querying can become computationally intractable; this has implications for applications such as medical diagnosis where complex relationships between symptoms and diseases must be reasoned about efficiently. Furthermore, the authors’ focus on linear existential rules provides an important theoretical foundation since these types of rules often arise naturally when modeling temporal or causal dependencies within data.
In practice, the findings imply that system designers should carefully choose which rule fragments to support if they wish to keep query evaluation efficient. Allowing unrestricted guarded rules may lead to double‑exponential worst‑case behavior, making real‑world deployment challenging unless additional restrictions such as arity bounds are imposed. Conversely, restricting to linear rules guarantees NL data complexity but still incurs exponential combined cost, suggesting hybrid approaches that combine lightweight ontology fragments with precomputed indexes could offer practical performance gains.
Made by Ren, the ArRENCE AIChat with Ren, plan your day, generate images, and more.
Meet Ren →