TL;DR
This paper investigates query languages for graph databases, highlighting that existing languages struggle to balance expressiveness with computational efficiency. The authors demonstrate that "Walk Logic" (WL) is too computationally expensive for practical use, and introduce "Register Logic" (RL) as a more balanced alternative that can express complex data-driven path queries while maintaining elementary complexity.
What Problem Does This Paper Address?
Graph databases are increasingly popular for applications like social networks and the semantic web. However, querying these graphs presents a challenge: how to express queries that consider both the graph's structure (topology) and the data associated with nodes and edges. Traditional query languages, like Conjunctive Regular Path Queries (CRPQs), are good at expressing topological properties but fall short when it comes to relating data values across different parts of the graph or within paths. This limitation makes it difficult to answer queries like "find pairs of people connected by professional links who are also of the same age." The paper aims to find a query language that can express such rich, data-aware path queries while remaining computationally feasible.
Methods
The paper introduces and analyzes two query languages: Walk Logic (WL) and Register Logic (RL).
- Walk Logic (WL): This logic extends first-order logic with path quantification and the ability to compare data values at different positions within paths or across paths. The authors' key contribution here is proving that the data complexity of WL (i.e., the complexity when the query is fixed and the graph is the input) is non-elementary. This means WL is computationally too expensive for practical applications, as its evaluation time grows incredibly fast with the size of the graph.
- Register Logic (RL): To address WL's complexity issue, the authors propose RL, an extension of "Regular Expressions with Memory" (REMs). RL builds upon REMs by adding Boolean combinations, existential quantification over nodes and paths, and crucially, register assignment quantification. This allows RL to compare data values across different paths and express branching properties of the graph. The paper demonstrates that RL can express many natural graph properties that WL can, and importantly, it preserves elementary data complexity (specifically, PSPACE-complete for data complexity and EXPSPACE for combined complexity).
The paper also introduces "Register Logic+" (RL+), a fragment of RL that is tractable in data complexity (NLOGSPACE), and "Nested REMs" (NREM), which extend REMs with a nesting operator to increase expressiveness without sacrificing tractability.
Datasets
Not discussed in the paper. The paper focuses on theoretical aspects of query languages and their expressive power and complexity, rather than empirical evaluation on specific datasets.
Key Insights and Ideas
- The Non-Elementary Cost of Expressiveness: The most striking insight is that Walk Logic, while expressive, has a non-elementary data complexity. This is a strong theoretical result that effectively rules out its practical use for large graph databases. It highlights a fundamental trade-off between query expressiveness and computational feasibility.
- RL as a Balanced Alternative: Register Logic (RL) emerges as a promising solution. It manages to capture much of WL's expressive power, particularly for data-aware path queries, while remaining within the bounds of elementary complexity. This suggests that RL could be a practical choice for real-world graph querying.
- The Power of Registers: The introduction of register assignment quantification in RL is a key innovation. It allows for sophisticated comparisons of data values across different paths, a capability that is crucial for many complex graph queries.
- NREM and Tractability: The introduction of Nested REMs (NREM) and the RL+ fragment shows that it's possible to achieve tractability in data complexity for certain expressive query patterns, even when dealing with complex data interactions.
Key Results
- WL Data Complexity: The data complexity of Walk Logic (WL) is proven to be non-elementary. This is a significant theoretical result that implies WL is impractical for large-scale graph databases.
- RL Complexity: Register Logic (RL) has PSPACE-complete data complexity and EXPSPACE-complete combined complexity. This is considered elementary and much more manageable than WL.
- RL Expressiveness: RL is shown to be incomparable in expressive power to WL. It can express many natural graph properties that WL can, and vice-versa. RL can express queries that REMs cannot, such as the example query (Q) from the introduction.
- NRL+ Tractability: The logic NRL+ (a fragment of RL with nested REMs) is shown to be NLOGSPACE-complete in data complexity, making it highly efficient for certain types of queries.
Limitations and Future Work
- Expressive Power of NRL+: The paper leaves open the question of whether NRL+ is strictly more expressive than RL.
- WL Expressiveness Gaps: The paper mentions that bipartiteness in WL is still an open question, and whether connected graphs with an even number of nodes are expressible in WL is also an open problem.
- Extensions of Walk Logic: The authors suggest studying extensions of WL, such as those incorporating regularity tests, and comparing their expressive power to RL and other logics.
- XML-based Query Languages: The paper briefly mentions that XML-based query languages like XPath might offer alternative approaches for data value comparisons, but are not directly comparable in expressive power to the logics studied here.
Summary updated