Optimization of Kleene closure regular path query on large RDF graphs
Abstract As the core operator of regular path query (RPQ), the Kleene closure is essentially a recursive operation based on predicates. It has more expressive power than first-order logic, but its algorithmic complexity is an NP-hard problem and expensive to execute. Most approaches implement Kleene closure via online recursive queries (inefficient for large-scale data), yet significant reusable intermediate results emerge during execution. This paper proposes an efficient query optimization method based on offline preprocessing and tree-structured strategies to address the challenges of NP-hard complexity and low execution efficiency caused by the recursive nature of Kleene closure RPQs (KRPQs). The core contributions of this work include: (i) recursive index tree: by precomputing and materializing intermediate results of predicate paths offline, Kleene closure queries are transformed into non-recursive SPARQL queries. This allows direct retrieval of answer branches from the preconstructed index tree, eliminating redundant computations and reducing online complexity. (ii) Selectivity-driven dynamic optimization: a heuristic cost model estimates intermediate result sizes to guide query plan generation, minimizing redundant operations. (3) Query decomposition tree for nested KRPQs: a hierarchical decomposition algorithm processes nested Kleene closures layer-by-layer from inner to outer expressions, overcoming limitations of existing methods in handling complex nested structures. Experiments on large-scale RDF datasets demonstrate that the method reduces average response times by 50%–70% for single-predicate and expression-based Kleene closure queries compared to systems like Virtuoso, Jena, and KRPQ, with over 60% improvement for complex nested queries. Additionally, multithreaded preprocessing and path pool optimizations achieve up to a 76$\times $ reduction in index construction time. Experiments show that the method can significantly reduce the time of KRPQs based on large RDF graphs.
Authors
- Tenglong Ren (ORCID: https://orcid.org/0009-0007-4215-4170)
- Xiaowang Zhang (ORCID: https://orcid.org/0000-0002-3931-3886)
- Zhiyong Feng (ORCID: https://orcid.org/0000-0001-8158-7453)
Institutions
- Tianjin University (CN)
Publication Details
- Journal
- The Computer Journal
- Published
- 2025-04-26
- DOI
- https://doi.org/10.1093/comjnl/bxaf061
- Primary Topic
- Data Management and Algorithms
- Type
- article
- Field-Weighted Citation Impact
- 0.00
Funders
- National Natural Science Foundation of China