Proving Cypher Query Equivalence
Lei Tang, Wensheng Dou, Yingying Zheng, Lijie Xu, Wei Wang, Jun Wei, Tao Huang
Abstract
Graph database systems store graph data as nodes and relationships, and utilize graph query languages (e.g., Cypher) for efficiently querying graph data. Proving the equivalence of graph queries is an important foundation for optimizing graph query performance, ensuring graph query reliability, etc. Although researchers have proposed many SQL query equivalence provers for relational database systems, these provers cannot be directly applied to prove the equivalence of graph queries. The difficulty lies in the fact that graph query languages (e.g., Cypher) adopt significantly different data models (property graph model vs. relational model) and query patterns (graph pattern matching vs. tabular tuple calculus) from SQL.
In this paper, we propose GraphQE, an automated prover to determine whether two Cypher queries are semantically equivalent. We design a U-semiring based Cypher algebraic representation to model the semantics of Cypher queries. Our Cypher algebraic representation is built on the algebraic structure of unbounded semirings, and can sufficiently express nodes and relationships in property graphs and complex Cypher queries. Then, determining the equivalence of two Cypher queries is transformed into determining the equivalence of the corresponding Cypher algebraic representations, which can be verified by SMT solvers. To evaluate the effectiveness of GraphQE, we construct a dataset consisting of 148 pairs of equivalent Cypher queries. Among them, we have successfully proven 138 pairs of equivalent Cypher queries, demonstrating the effectiveness of GraphQE.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext 63175a8b-bc37-4f67-82ca-1e84cb9265cbCited by top-tier papers3
- Detecting Schema-Related Logic Bugs in Relational DBMSs via Equivalent Database ConstructionJiansen Song, Wensheng Dou, Yingying Zheng, Yu Gao et al.VLDB 2025 · 6 citations
- Simple Testing Can Expose Most Critical Transaction Bugs: Understanding and Detecting Write-Specific Serializability Violations in Database SystemsZiyu Cui, Wensheng Dou, Yu Gao, Rui Yang et al.VLDB 2025 · 4 citations
- Detecting Isolation Anomalies in Relational DBMSsRui Yang, Ziyu Cui, Wensheng Dou, Yu Gao et al.ISSTA 2025 · 3 citations
Builds on8
- WeTune: Automatic Discovery and Verification of Query Rewrite RulesZhaoguo Wang, Zhou Zhou, Yicun Yang, Haoran Ding et al.SIGMOD 2022 · 35 citations
- Testing Graph Database Engines via Query PartitioningMatteo Kamm, Manuel Rigger, Chengyu Zhang, Zhendong SuISSTA 2023 · 29 citations
- Testing Graph Database Systems via Graph-Aware Metamorphic RelationsZeyang Zhuang, Penghui Li, Pingchuan Ma, Wei Meng et al.VLDB 2024 · 23 citations
- Proving Query Equivalence Using Linear Integer ArithmeticHaoran Ding, Zhaoguo Wang, Yicun Yang, Dexin Zhang et al.SIGMOD 2024 · 20 citations
- QED: A Powerful Query Equivalence Decider for SQLShuxian Wang, Sicheng Pan, Alvin CheungVLDB 2024 · 19 citations
Related papers
- Graphiti: Bridging Graph and Relational Database QueriesYang He, Ruijie Fang, Isil Dillig, Yuepeng WangPLDI 2025 · 3 citations
- Transforming Property GraphsAngela Bonifati, Filip Murlak, Yann RamusatVLDB 2024 · 9 citations
- GDsmith: Detecting Bugs in Cypher Graph Database EnginesZiyue Hua, Wei Lin, Luyao Ren, Zongyang Li et al.ISSTA 2023 · 24 citations
- Computing Why-Provenance for Property Graph QueriesKoumudi Ganepola, Maxime Jakubowski, Katja HoseVLDB 2026
- G-View: View Management for Graph DatabasesYunjia Zheng, Charlotte Sacré, Mohanna Shahrad, Owen Lipchitz et al.VLDB 2025
