TL;DR
This paper maps out the complete computational complexity landscape for answering navigational path queries (RPQs and CRPQs) over knowledge bases governed by linear and guarded existential rules. The authors demonstrate that while adding linear rules does not increase data complexity beyond that of plain, ontology-free graph databases (remaining NL-complete), guarded rules elevate the problem to match the complexity of standard conjunctive queries (up to 2ExpTime-complete in combined complexity).
What Problem Does This Paper Address?
In ontology-mediated query answering (OMQA), database facts are enriched with an ontology (a set of logical rules) to infer implicit knowledge and provide more complete answers. While most research in this field focuses on Conjunctive Queries (CQs)—the logical equivalent of standard SQL SELECT-PROJECT-JOIN queries—modern applications like knowledge graphs and graph databases rely heavily on navigational queries.
These navigational queries, known as Regular Path Queries (RPQs) and Conjunctive Regular Path Queries (CRPQs), allow users to search for paths of arbitrary length defined by regular expressions (e.g., finding "indirect supervisors" or "any connected flight path").
The challenge arises when trying to answer these path queries under existential rules (specifically linear and guarded rules). Existential rules are highly expressive because they can introduce existential quantifiers in the rule heads, implying the existence of new, unseen entities (called "nulls"). This can cause the reasoning process (the "chase") to become infinite. Prior to this work, the exact computational complexity of combining path queries with these powerful rule frameworks was unknown.
Methods
The authors establish their complexity bounds using two distinct technical approaches:
- For Linear Rules (Chase-based Localization): Linear rules have a single atom in their body. The authors exploit a key property of linear rules: each database atom can be processed ("chased") independently. They show that any path traversing through inferred anonymous entities (nulls) is localized within the chase of a single initial database atom. They introduce the concept of an atom's type (abstracting away specific constants/nulls) and design an algorithm that builds a Loop table to track paths through these anonymous sections without explicitly generating them.
- For Guarded Rules (Guarded-to-Linear Reduction): Guarded rules allow multiple atoms in the body, provided there is a "guard" atom containing all the body's variables. To solve this, the authors develop a non-trivial, double-exponential reduction that transforms a guarded ruleset into a linear ruleset. They introduce locally complete derivations (where each step is closed under atomic entailment) and simulate them using linear rules over an extended vocabulary of "complex predicates" representing guarded sets of atoms.
Datasets
Not discussed in the paper. This is a purely theoretical paper establishing computational complexity bounds; no empirical evaluations or datasets were used.
Key Insights and Ideas
- The "Localization" of Anonymous Paths: The defining "aha moment" for linear rules is that paths passing through anonymous nulls do not wander aimlessly across the database; they stay confined within the logical sub-tree generated by a single database atom. This allows the algorithm to focus purely on "types" and "loops" rather than tracking an infinite web of nulls.
- Navigational Queries as Compensation: The authors note that navigational features in queries can sometimes compensate for limitations in the ontology language. For example, a regular expression path can express transitivity even if the underlying rule language cannot directly support it without losing its nice computational properties.
- Guarded-to-Linear Feasibility: Even though guarded rules allow complex multi-atom bodies, their variables are strictly bound by the guard atom. This structural restriction means they can be bundled into "complex predicates" that behave linearly, preserving the underlying structure needed for path routing.
Key Results
The paper provides a complete picture of the worst-case complexities, distinguishing between data complexity (where the query and rules are fixed) and combined complexity (where everything is part of the input).
Linear Rules
Data complexity for both RPQs and CRPQs is NL-complete, perfectly matching ontology-free graph databases. In combined complexity, the problem is generally ExpTime-complete, but drops significantly if the predicate arity (the number of arguments a relation can take) is bounded.
Guarded Rules
Answering path queries under guarded rules is no harder than answering standard CQs: PTime-complete in data complexity, ExpTime-complete for bounded arity, and 2ExpTime-complete for unbounded arity.
Limitations and Future Work
While the bounds are tight and theoretically optimal, the algorithms are primarily of a theoretical nature. Specifically, the guarded-to-linear reduction involves a double-exponential blow-up in the number of rules, making it impractical for direct implementation without significant optimization or structural restrictions.
For future work, the authors suggest exploring practical implementations for the linear case, noting that real-world graph queries are typically simple and the Loop table is data-independent. Additionally, the decidability and complexity of path queries under other major existential rule classes (like sticky rules or frontier-guarded rules) remain open challenges.
Summary updated