Answering Path Queries under Linear and Guarded Existential Rules
This paper establishes the data and combined complexity of answering two-way regular path queries over knowledge bases defined by linear and guarded existential rules, demonstrating that these tasks match the complexity profiles of standard conjunctive queries and, in the linear case, plain graph database queries.
Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer
Imagine you are trying to find a specific friend in a massive, chaotic city. You have a map (the database) showing where people are right now, but you also have a rulebook (the ontology) that tells you things the map doesn't show directly. For example, the rulebook might say, "If Alice is friends with Bob, then Bob is friends with Alice," or "If you follow someone, you are connected to them." In the world of computer science, this is called ontology-mediated query answering. It's like having a super-smart guide who doesn't just look at the raw data but uses logic to fill in the gaps, giving you a much more complete picture of the world.
However, asking questions gets tricky when you start asking about paths. Instead of just asking, "Is Alice friends with Bob?" you might ask, "Can I get from Alice to Bob by following a chain of friends, even if that chain is super long and loops around?" These are called path queries. They are essential for navigating complex networks like social media or the Semantic Web. But here's the catch: when you combine these path-finding questions with a powerful rulebook, the computer's job can become incredibly hard, sometimes even impossible to solve in a reasonable amount of time. The big question scientists have been wrestling with is: How hard is it, really, to answer these path questions when we have different types of rulebooks?
This paper is like a group of detectives (Jean-François Baget, Meghyn Bienvenu, Marie-Laure Mugnier, and Michaël Thomazo) who decided to map out the difficulty of these path queries for two very popular types of rulebooks: Linear Rules and Guarded Rules. Think of "Linear Rules" as simple, one-step instructions (like "If A is true, then B is true"), and "Guarded Rules" as slightly more complex instructions that require a specific "guardian" fact to be present before they can trigger (like "If A is true AND B is true, then C is true"). The authors didn't just guess; they proved exactly how much computing power is needed to solve these puzzles, creating a precise "difficulty chart" for computer scientists.
The Detective Work: Mapping the Difficulty
The authors approached this problem by treating the computer's reasoning process like a game of "chase." Imagine a game where you start with a few known facts and keep applying rules to generate new facts until you can't make any more. This is called the chase. The challenge with path queries is that the "chase" can go on forever, creating an infinite web of connections. The researchers wanted to know: Can we stop the game early and still know the answer? And how much time does it take to check if a path exists?
They broke their investigation down into two main scenarios: Data Complexity (how hard is it when the rulebook is small and fixed, but the city is huge?) and Combined Complexity (how hard is it when both the rulebook and the city are huge?).
The Simple Rules: Linear Rules
First, they looked at Linear Rules. These are the "simple" rules where the body of the rule is just a single fact.
- The Discovery: They found that if you are just looking at a specific dataset (Data Complexity), answering these path questions is surprisingly easy. It's as easy as navigating a simple maze on a phone; the computer can do it in NL-complete time. This is the same speed as answering path questions on a plain map without any rulebook at all!
- The Catch: If you start changing the rules themselves (Combined Complexity), things get harder. If the rules are simple and short, it's still manageable (PTime). But if the rules can get arbitrarily long and complex, the difficulty jumps to ExpTime-complete. This means the time needed to solve the problem grows exponentially, like a snowball rolling down a hill, but it's still solvable.
The Complex Rules: Guarded Rules
Next, they tackled Guarded Rules. These are more powerful and flexible, allowing for more complex relationships, but they come with a "guard" that must be satisfied.
- The Discovery: Here, the authors used a clever trick. They showed that you can translate these complex "Guarded" rules into the simpler "Linear" rules, but with a twist: the translation makes the set of rules explode in size.
- The Result: Because of this explosion, answering path queries under Guarded Rules is significantly harder. In the general case (unbounded arity), the difficulty skyrockets to 2ExpTime-complete. This is a double-exponential jump, meaning the time required grows so fast it's almost unimaginable for large inputs. However, if you limit the size of the rules (bounded arity), it drops down to ExpTime-complete, which is the same difficulty level as answering standard questions (not just path questions) under these rules.
The "Loop" and the "Proof Scheme"
How did they prove all this? They invented some cool mental tools.
For the Linear Rules, they realized that even though the "chase" creates an infinite web, any path that wanders off into the "unknown" (the anonymous part of the chase) and comes back to a known fact must have started and ended within the "shadow" of a single original fact. They called these "loops." By pre-calculating all possible loops for every type of fact, they could build a "cheat sheet" (a table) that lets the computer guess the path without having to simulate the infinite chase. This is why the data complexity is so low; the computer just looks up the loop in the cheat sheet.
For CRPQs (which are even more complex path queries that can ask about multiple paths at once), they used a concept called "Proof Schemes." Imagine a proof scheme as a small, finite blueprint of the infinite chase. Instead of building the whole infinite city, the computer builds a tiny, representative model that proves a path exists. They showed that if a path exists, there is always a "small" blueprint that proves it. This allowed them to prove that even though the problem is hard, it's not impossible—it just requires a lot of memory and time.
What They Didn't Find (And Why It Matters)
The paper is very careful about what it doesn't claim. It doesn't say that path queries are easy for all types of rulebooks. In fact, it highlights that for some other types of rules (like "sticky" rules or those that allow rewriting), the problem might be undecidable (impossible to solve) or at least much harder without a clear upper limit. The authors explicitly note that while they have solved the complexity puzzle for Linear and Guarded rules, the landscape for other rule types remains a mystery.
They also clarify that while their results are mathematically proven, the algorithms for the hardest cases (like the 2ExpTime ones) are currently too slow to be practical for real-world use. They are theoretical maps, not ready-to-drive cars. However, for the simpler Linear rules, they suggest that their "loop" method could be turned into a fast, practical tool, especially if we preprocess the data to fill in the gaps before the user even asks a question.
The Big Picture
In the end, this paper provides the first complete "difficulty map" for navigating path queries under two major types of logical rules. It tells us that:
- Simple rules (Linear) are great for data-heavy tasks because they are fast to query, even with complex paths.
- Powerful rules (Guarded) are flexible but come with a heavy computational cost, especially when the rules get long.
- Path queries are fundamentally harder than standard questions, but we now know exactly how much harder they are.
This work is a foundational step. It doesn't just say "it's hard"; it gives us the precise mathematical boundaries of that hardness. For computer scientists building the next generation of knowledge graphs and AI systems, this is the difference between guessing how much server power you need and knowing exactly how much you need to buy. It turns a foggy, uncertain journey into a well-lit path, showing us exactly where the steep cliffs are and where the smooth roads lie.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.