Graphiti: Bridging Graph and Relational Database Queries

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: He, Yang, Fang, Ruijie, Dillig, Isil, Wang, Yuepeng
Format: Preprint
Published: 2025
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866912309174075392
author He, Yang
Fang, Ruijie
Dillig, Isil
Wang, Yuepeng
author_facet He, Yang
Fang, Ruijie
Dillig, Isil
Wang, Yuepeng
contents This paper presents an automated reasoning technique for checking equivalence between graph database queries written in Cypher and relational queries in SQL. To formalize a suitable notion of equivalence in this setting, we introduce the concept of database transformers, which transform database instances between graph and relational models. We then propose a novel verification methodology that checks equivalence modulo a given transformer by reducing the original problem to verifying equivalence between a pair of SQL queries. This reduction is achieved by embedding a subset of Cypher into SQL through syntax-directed translation, allowing us to leverage existing research on automated reasoning for SQL while obviating the need for reasoning simultaneously over two different data models. We have implemented our approach in a tool called Graphiti and used it to check equivalence between graph and relational queries. Our experiments demonstrate that Graphiti is useful both for verification and refutation and that it can uncover subtle bugs, including those found in Cypher tutorials and academic papers.
format Preprint
id arxiv_https___arxiv_org_abs_2504_03182
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Graphiti: Bridging Graph and Relational Database Queries
He, Yang
Fang, Ruijie
Dillig, Isil
Wang, Yuepeng
Programming Languages
This paper presents an automated reasoning technique for checking equivalence between graph database queries written in Cypher and relational queries in SQL. To formalize a suitable notion of equivalence in this setting, we introduce the concept of database transformers, which transform database instances between graph and relational models. We then propose a novel verification methodology that checks equivalence modulo a given transformer by reducing the original problem to verifying equivalence between a pair of SQL queries. This reduction is achieved by embedding a subset of Cypher into SQL through syntax-directed translation, allowing us to leverage existing research on automated reasoning for SQL while obviating the need for reasoning simultaneously over two different data models. We have implemented our approach in a tool called Graphiti and used it to check equivalence between graph and relational queries. Our experiments demonstrate that Graphiti is useful both for verification and refutation and that it can uncover subtle bugs, including those found in Cypher tutorials and academic papers.
title Graphiti: Bridging Graph and Relational Database Queries
topic Programming Languages
url https://arxiv.org/abs/2504.03182