REVIEW 4 major objections 5 minor 44 references
Raqlet: Cross-Paradigm Compilation for Recursive Queries
T0 review · 4 major / 5 minor · reviewed 2026-08-06 · deepseek-v4-flash
Pith's one-line read Raqlet claims that recursive queries in Cypher, SQL/PGQ, and Datalog can all be lowered into a shared Datalog-inspired representation, giving one formal semantics and one optimizer for every paradigm.
desk verdict Solid compiler architecture for recursive queries, but the paper's semantic-preservation and golden-reference claims are undone by its own removal of ORDER BY/LIMIT and lack of any correctness evidence. read the letter →
The pith
A machine-rendered reading of the paper's core claim, the machinery that carries it, and where it could break.
The reading
What carries the argument
DLIR, a Datalog-inspired intermediate representation with stratified negation and aggregation, whose rules are anchored by the least-fixed-point semantics of Datalog. It is the layer where all input languages meet, where static analyses (linearity, mutual recursion, monotonicity, termination) run, and where transformations such as inlining, dead-rule elimination, and magic sets are applied before code generation to SQL, Datalog, or lower-level procedural IRs.
What would settle it
Compile a Cypher query that contains ORDER BY and LIMIT and compare the result set and order with a direct execution on the original graph database; any translation that drops these clauses will produce different observable output, showing that semantic preservation fails for that fragment. A broader suite of recursive queries with bag semantics and nested aggregation run through Raqlet and compared against reference engines would also bound the claim.
Extended reading notes
Core claim
Raqlet's central discovery is that Datalog's rule-based structure is a sufficient common denominator: graph patterns, filters, projections, and recursive predicates from Cypher and SQL/PGQ can be represented as DLIR rules, then emitted as recursive SQL or Datalog with set semantics. The paper defines three intermediate representations (PGIR, DLIR, SQIR) in a pipeline and concentrates static analysis and optimization at the DLIR layer, so analyses like linearity, mutual recursion, monotonicity, and termination are done once for all input languages. It also claims DLIR inherits well-defined formal semantics from stratified Datalog, making it a candidate golden reference implementation for grap
Load-bearing premise
The load-bearing premise is that Datalog-style set semantics over relations can faithfully capture Cypher and SQL/PGQ query semantics, including ordering, limits, and aggregation; the paper does not prove this and instead removes ORDER BY and LIMIT and uses DISTINCT in its example.
Editorial extensions
If this is right
- Users can write a recursive query in a graph language like Cypher and execute it on relational or Datalog engines after automatic translation, avoiding manual porting.
- Static analyses at the DLIR layer can reject queries a backend does not support (e.g., non-linear or mutually recursive queries on engines that only allow linear recursion) before execution.
- DLIR's formal Datalog semantics give a golden reference point for judging SQL:2023 and GQL implementations, exposed when systems disagree.
- Optimizations such as magic-set rewriting and rule inlining apply uniformly to queries from any source language, with preliminary experiments showing translated Datalog and SQL versions often outperform the original graph query.
- Layering additional IRs on the backend enables eventual low-level code generation from the same semantic core.
Reading between the lines
- If DLIR semantics are made machine-checked, the same core could serve as a differential-testing oracle for commercial graph and SQL systems, not just a compiler.
- The removal of ORDER BY and LIMIT suggests the unification is cleanest for set-oriented, order-insensitive queries; order- and bag-sensitive features likely need a separate semantics for each target, so the golden reference may only cover a fragment of the languages.
- The paper's performance results are on two queries; extending to the full set of social-network benchmark queries would likely reveal where specific backends dominate, turning the framework into a benchmark harness.
- Cross-paradigm translation may also enable mixing: a query written in Datalog could exploit graph-specific path indexing, or a graph query could benefit from relational aggregation optimizations, without rewriting.
Signed reviews
Editorial analysis
A structured set of objections, weighed in public.
Referee Report
Summary. Raqlet is a source-to-source compilation framework for recursive queries. It translates Cypher or SQL/PGQ into a property-graph IR (PGIR), then into a Datalog-inspired IR (DLIR), and finally into Datalog or recursive SQL (SQIR). The paper describes the architecture, several planned static analyses (linearity, mutual recursion, monotonicity, termination), a set of planned optimizations (inlining, dead-rule elimination, magic sets), and a preliminary experiment on two LDBC queries. The stated goals are cross-paradigm portability, static reasoning, and a formally grounded 'golden reference' semantics for SQL/PGQ and GQL/Cypher. The paper presents a running example, but the formal semantics and machine-checked proofs are explicitly left to future work.
Significance. If fully realized, the proposed framework would be a valuable contribution to the fragmented recursive-query landscape: it addresses a real interoperability problem, and the choice of Datalog-style fixpoint semantics as a common core is well motivated. The paper is clearly structured, and the running example helps convey the translation pipeline. However, the manuscript's central claims currently outrun its evidence. The semantic-preservation claim is undermined by an explicit removal of ORDER BY and LIMIT, the formal-semantics section describes only plans, and the experimental evaluation is too small to support the performance statements. The paper is better read as a vision or system-position statement than as a validation of the claimed cross-paradigm equivalence.
major comments (4)
- [Section 3 (System Overview)] The paper states: 'Given that most deductive databases utilize set semantics and lack certain features such as ordering and limiting the results, to achieve semantic equivalence in translated queries across different backends, we use RETURN DISTINCT instead and remove ORDER BY and LIMIT clauses in input Cypher queries.' This is an explicit admission that the translation is not semantics-preserving for the full input language: removing ORDER BY/LIMIT changes the result set whenever the original query truncates or orders its output, and RETURN DISTINCT collapses duplicates. Since the abstract and Section 6 claim a 'shared semantic basis' and 'golden reference implementation', this is not a local limitation. No formal statement is given of the fragment for which equivalence does hold, and the example translations do not establish equivalence even for that fragment.
- [Section 6 (Towards Formal Semantics)] The formal-semantics section says 'we plan to formalize DLIR semantics, Raqlet's translation pipeline, and DLIR optimizations using proof assistants such as Rocq or Lean.' Thus no formal semantics is actually supplied in this manuscript. The statement that 'DLIR serves as a golden reference implementation for the SQL:2023 and GQL standard' is an intention, not a result. Because the PGIR-to-DLIR and DLIR-to-SQL translations are only demonstrated through examples, a reader cannot verify the correctness of the pipeline for any nontrivial fragment.
- [Table 1 / Section 5 (Preliminary Experimental Results)] The evaluation contains two LDBC queries at SF10, with a single timing per cell, no error bars, no repeated runs, no data-size sweep, and no optimized Neo4j baseline. The text concludes that 'in most cases, translated Datalog and SQL queries have lower execution times compared to the original Cypher query.' The evidence is insufficient to support even this modest performance claim. More importantly, the experiment does not check that the translated queries produce the same results as the original Cypher queries, so it does not compensate for the missing correctness argument.
- [Section 3 (Running Example)] The running example is a non-recursive MATCH ... RETURN DISTINCT query. The paper's central topic is recursive query compilation, yet no recursive translation is shown anywhere in the pipeline. The recursion-related discussion in Section 4 is conceptual and references known techniques rather than demonstrating Raqlet's handling of recursive PGIR or DLIR constructs. This leaves the core claimed capability—compiling recursive queries across paradigms—unsubstantiated by any concrete example or translation rule.
minor comments (5)
- [Figure 3(d)] 'Soufflè' should be 'Soufflé' for consistency with the rest of the paper.
- [Section 5 (Code Generation)] There is a grammatical error: 'Raqlet’s allows for generating' should be 'Raqlet allows for generating'.
- [Section 6] 'fix-point logic' should be 'fixed-point logic' or 'fixpoint logic'.
- [Table 1] Please clarify whether the reported times are single runs, medians, or means, and define what the checkmark/cross in the 'Optimized' column means precisely.
- [Figure 2] The PG-Schema syntax shown is nonstandard (e.g., colons and arrow notation). A reference to the exact PG-Schema grammar or a note that this is a simplified notation would help reproducibility.
Circularity Check
No circularity: DLIR semantics are imported from external Datalog fixpoint semantics; the paper's admitted ORDER BY/LIMIT removal and planned formalization are evidentiary gaps, not by-construction reductions.
full rationale
Raqlet is a system/vision paper, not a derivation whose outputs are fitted to its inputs. The central translation chain (Cypher/SQL/PGQ -> PGIR -> DLIR -> SQIR/Datalog) is presented as an implemented pipeline, and DLIR's semantics are explicitly inherited from Datalog's least-fixed-point semantics, an external formal foundation. No parameter is fitted and then renamed as a prediction; the performance table is a preliminary benchmark, not a derived result. The strongest semantic claim—that DLIR can serve as a golden reference for SQL:2023/GQL—is not yet supported by a proof: Section 6 says 'we plan to formalize DLIR semantics, Raqlet's translation pipeline, and DLIR optimizations using proof assistants,' and Section 3 explicitly alters input queries ('we use RETURN DISTINCT instead and remove ORDER BY and LIMIT clauses in input Cypher queries'). This is a correctness/semantic-coverage gap, not circularity: the claim is not equivalent to its inputs by construction, and no equation or definition reduces the translation to its own premise. The paper contains self-citations ([20], [21], [34]-[37]), but they support peripheral landscape and implementation details (e.g., DuckDB benchmarks, nontermination properties, low-level IRs) and are not load-bearing for the cross-paradigm architecture. Under the hard rules, absent a specific reduction such as Eq. X = Eq. Y by construction or a fitted parameter renamed as a prediction, no circular step can be claimed. Hence score 0.
Assumptions & free parameters
assumptions (4)
- domain assumption Datalog least-fixed-point semantics are the correct ground truth for recursive queries.
- ad hoc to paper Cypher and SQL/PGQ can be fully captured by PGIR and then DLIR without semantic loss.
- ad hoc to paper Removing ORDER BY and LIMIT and using DISTINCT preserves semantic equivalence for the translated queries.
- domain assumption PG-Schema can be translated bijectively to DL-Schema EDBs.
invented entities (3)
-
PGIR (Property Graph IR)
-
DLIR (Datalog IR)
-
SQIR (SQL IR)
Cite this review
Pith. "Pith review of Raqlet: Cross-Paradigm Compilation for Recursive Queries." pith.science (2026). https://pith.science/paper/F26JYXEB
@misc{pith2026250803978,
author = {Pith},
title = {Pith review of: Raqlet: Cross-Paradigm Compilation for Recursive Queries},
year = {2026},
howpublished = {\url{https://pith.science/paper/F26JYXEB}},
note = {Machine review of arXiv:2508.03978}
}
read the original abstract
We introduce Raqlet, a source-to-source compilation framework that addresses the fragmentation of recursive querying engines spanning relational (recursive SQL), graph (Cypher, GQL), and deductive (Datalog) systems. Recent standards such as SQL:2023's SQL/PGQ and the GQL standard provide a common foundation for querying graph data within relational and graph databases; however, real-world support remains inconsistent across systems. Raqlet bridges this gap by translating recursive queries across paradigms through leveraging intermediate representations (IRs) grounded in well-defined semantics; it translates Cypher or SQL/PGQ to PGIR (inspired by Cypher), then into DLIR (inspired by Datalog), and finally to SQIR (inspired by recursive SQL). Raqlet provides a shared semantic basis that can serve as a golden reference implementation for language standards, while supporting static analysis and transformations (e.g., magic-set transformation) for performance tuning. Our vision is to make Raqlet a robust platform that enables rapid cross-paradigm prototyping, portable recursive queries, and formal reasoning about recursion even when targeting diverse query execution engines.
Figures
Reference graph
Works this paper leans on
-
[1]
Aho, Catriel Beeri, and Jeffrey D
Alfred V. Aho, Catriel Beeri, and Jeffrey D. Ullman. 1979. The Theory of Joins in Relational Databases. ACM Trans. Database Syst. 4, 3 (1979). https://doi.org/10. 1145/320083.320091
-
[2]
Marczak, Neil Conway, Joseph M
Peter Alvaro, William R. Marczak, Neil Conway, Joseph M. Hellerstein, David Maier, and Russell Sears. 2011. Dedalus: Datalog in Time and Space. In Datalog Reloaded, Oege de Moor, Georg Gottlob, Tim Furche, and Andrew Sellers (Eds.). Springer Berlin Heidelberg, Berlin, Heidelberg, 262–281
work page 2011
-
[3]
Renzo Angles, Marcelo Arenas, Pablo Barcelo, Aidan Hogan, Juan Reutter, and Domagoj Vrgoc. 2017. Foundations of Modern Query Languages for Graph Databases. arXiv:1610.06264 [cs.DB] https://arxiv.org/abs/1610.06264
work page Pith review arXiv 2017
-
[4]
Renzo et al. Angles. 2023. PG-Schema: Schemas for Property Graphs. Proc. ACM Manag. Data 1, 2, Article 198 (jun 2023), 25 pages. https://doi.org/10.1145/3589778 Amir Shaikhha†∗, Youning Xia†∗, Meisam Tarabkhah†∗, Jazal Saleem†,Anna Herlihy‡
doi:10.1145/3589778 2023
-
[5]
Molham Aref, Paolo Guagliardo, George Kastrinis, Leonid Libkin, Victor Marsault, Wim Martens, Mary McGrath, Filip Murlak, Nathaniel Nystrom, Liat Peterfreund, Allison Rogers, Cristina Sirangelo, Domagoj Vrgoc, David Zhao, and Abdul Zreika. 2025. Rel: A Programming Language for Relational Data. In Companion of the 2025 International Conference on Managemen...
arXiv 2025
-
[6]
Auerbach, Martin Hirzel, Louis Mandel, Avraham Shinnar, and Jérôme Siméon
Joshua S. Auerbach, Martin Hirzel, Louis Mandel, Avraham Shinnar, and Jérôme Siméon. 2017. Prototyping a query compiler using Coq (experience report). Proc. ACM Program. Lang. 1, ICFP (2017), 9:1–9:15. https://doi.org/10.1145/3110253
-
[7]
Francois Bancilhon et al. 1985. Magic Sets and Other Strange Ways to Implement Logic Programs (Extended Abstract)(PODS ’86). ACM, New York, NY, USA, 1–15
work page 1985
- [8]
Show all 44 references
-
[9]
Luigi Bellomarini, Emanuel Sallinger, and Georg Gottlob. 2018. The Vadalog System: Datalog-based Reasoning for Knowledge Graphs. Proc. VLDB Endow. 11, 9 (2018), 975–987. https://doi.org/10.14778/3213880.3213888
2018
-
[10]
Stefan Brass and Mario Wenzel. 2019. Performance Analysis and Comparison of Deductive Systems and SQL Databases. In Datalog 2.0 (CEUR Workshop Proceed- ings), Mario Alviano and Andreas Pieris (Eds.), Vol. 2368. CEUR-WS.org, 27–38. https://ceur-ws.org/Vol-2368/paper3.pdf
2019
-
[11]
Chakravarthy, John Grant, and Jack Minker
Upen S. Chakravarthy, John Grant, and Jack Minker. 1990. Logic-Based Approach to Semantic Query Optimization. ACM Trans. Database Syst. 15, 2 (1990), 162–207. https://doi.org/10.1145/78922.78924
1990
-
[12]
Yijian Cheng, Pengjie Ding, Tongtong Wang, Wei Lu, and Xiaoyong Du. 2019. Which Category Is Better: Benchmarking Relational and Graph Database Man- agement Systems. Data Science and Engineering 4 (12 2019). https://doi.org/10. 1007/s41019-019-00110-3
2019
-
[13]
Shumo Chu, Konstantin Weitz, Alvin Cheung, and Dan Suciu. 2017. HoTTSQL: proving query rewrites with univalent SQL semantics. InPLDI 2017, Albert Cohen and Martin T. Vechev (Eds.). ACM, 510–524. https://doi.org/10.1145/3062341. 3062348
2017 doi
-
[14]
Thi-Thu-Trang Do, Thai-Bao Mai-Hoang, Van-Quyet Nguyen, and Quyet-Thang Huynh. 2022. Query-based Performance Comparison of Graph Database and Relational Database (SoICT ’22). New York, NY, USA, 375–381. https://doi. org/10.1145/3568562.3568648
2022
-
[15]
Orri Erling et al. 2015. The LDBC Social Network Benchmark: Interactive Work- load. In SIGMOD. 619–630
2015
-
[16]
Nadime Francis et al. 2023. GPC: A Pattern Calculus for Property Graphs (PODS ’23). New York, NY, USA, 241–250
2023
-
[17]
Nadime Francis, Alastair Green, Paolo Guagliardo, Leonid Libkin, Tobias Lin- daaker, Victor Marsault, Stefan Plantikow, Mats Rydberg, Petra Selmer, and Andrés Taylor. 2018. Cypher: An Evolving Query Language for Property Graphs. In SIGMOD ’18. ACM, 1433–1445. https://doi.org/1...
2018
-
[18]
Amélie Gheerbrant, Leonid Libkin, Liat Peterfreund, and Alexandra Rogova
-
[19]
Watanabe, William A
Jiaqi Gu, Yugo H. Watanabe, William A. Mazza, Alexander Shkapsky, Mohan Yang, Ling Ding, and Carlo Zaniolo. 2019. RaSQL: Greater Power and Performance for Big Data Analytics with Recursive-aggregate-SQL on Spark (SIGMOD ’19). Association for Computing Machinery, New York, NY, ...
2019
-
[20]
Anna Herlihy, Anastasia Ailamaki, and Martin Odersky. 2025. Static Typing Meets Adaptive Optimization: A Unified Approach to Recursive Queries (DBPL ’25). Association for Computing Machinery, New York, NY, USA, Article 2, 6 pages. https://doi.org/10.1145/3735106.3736533
2025
-
[21]
Anna Herlihy, Amir Shaikhha, Anastasia Ailamaki, and Martin Odersky. 2025. Language-Integrated Recursive Queries. arXiv:2504.02443 [cs.PL] https://arxiv. org/abs/2504.02443
2025 arXiv
-
[22]
Aidan Hogan. 2020. SPARQL Query Language. Springer International Publishing, Cham, 323–448. https://doi.org/10.1007/978-3-030-51580-5_6
2020 doi
-
[23]
ISO/IEC. 1999. ISO/IEC 9075:1999 — Information Technology — Database Lan- guages — SQL. https://www.iso.org/standard/23493.html. International Organi- zation for Standardization
1999
-
[24]
ISO/IEC. 2023. ISO/IEC 9075-16:2023 — Information Technology — Database Languages — SQL — Part 16: Property Graph Queries (SQL/PGQ). https://www. iso.org/standard/76584.html. International Organization for Standardization
2023
-
[25]
ISO/IEC. 2024. ISO/IEC 39075:2024 Information technology — Programming languages — GQL. https://www.iso.org/standard/78175.html. International Organization for Standardization
2024
-
[26]
Michael Jungmair, André Kohn, and Jana Giceva. 2022. Designing an open framework for query optimization and compilation. Proc. VLDB Endow. 15, 11 (July 2022), 2389–2401. https://doi.org/10.14778/3551793.3551801
2022
-
[27]
David Klopp, Sebastian Erdweg, and André Pacak. 2024. A Typed Multi-level Datalog IR and Its Compiler Framework. Proc. ACM Program. Lang. 8, OOPSLA2, Article 327 (Oct. 2024), 29 pages. https://doi.org/10.1145/3689767
2024 doi
-
[28]
Louisa Lambrecht, Torsten Grust, Altan Birler, and Thomas Neumann. 2025. Trampoline-Style Queries for SQL. In Proc. CIDR. Amsterdam, The Netherlands
2025
-
[29]
Mendelzon, and Yehoshua Sagiv
David Maier, Alberto O. Mendelzon, and Yehoshua Sagiv. 1979. Testing Im- plications of Data Dependencies. ACM Trans. Database Syst. 4, 4 (1979). https://doi.org/10.1145/320107.320115
1979
-
[30]
Thomas Neumann. 2011. Efficiently Compiling Efficient Query Plans for Modern Hardware. Proc. VLDB Endow. 4, 9 (2011), 539–550. https://doi.org/10.14778/ 2002938.2002940
2011
-
[31]
Thomas Neumann and Viktor Leis. 2024. A Critique of Modern SQL and a Proposal Towards a Simple and Expressive Query Language. In CIDR 2024 . www.cidrdb.org. https://www.cidrdb.org/cidr2024/papers/p48-neumann.pdf
2024
-
[32]
Tamer Özsu
Anil Pacaci, Alice Zhou, Jimmy Lin, and M. Tamer Özsu. 2017. Do We Need Specialized Graph Databases? Benchmarking Real-Time Social Networking Ap- plications (GRADES’17). Association for Computing Machinery, New York, NY, USA, Article 12, 7 pages. https://doi.org/10.1145/307844...
2017
-
[33]
Alexandra Rogova et al . 2023. A Researcher’s Digest of GQL. https://api. semanticscholar.org/CorpusID:260068940
2023
-
[34]
Hesam Shahrokhi, Amirali Kaboli, Mahdi Ghorbani, and Amir Shaikhha. 2024. PyTond: Efficient Python Data Science on the Shoulders of Databases. In ICDE. 423–435
2024
-
[35]
Amir Shaikhha, Mathieu Huot, Jaclyn Smith, and Dan Olteanu. 2022. Functional collection programming with semi-ring dictionaries. Proc. ACM Program. Lang. 6, OOPSLA1 (2022), 1–33. https://doi.org/10.1145/3527333
2022 doi
-
[36]
Amir Shaikhha, Yannis Klonatos, Lionel Parreaux, Lewis Brown, Mohammad Dashti, and Christoph Koch. 2016. How to Architect a Query Compiler. In SIGMOD’16, Fatma Özcan, Georgia Koutrika, and Sam Madden (Eds.). ACM, 1907–1922. https://doi.org/10.1145/2882903.2915244
2016
-
[37]
Amir Shaikhha, Dan Suciu, Maximilian Schleich, and Hung Q. Ngo. 2024. Opti- mizing Nested Recursive Queries. Proc. ACM Manag. Data 2, 1 (2024), 16:1–16:27. https://doi.org/10.1145/3639271
2024 doi
-
[38]
Chandan Sharma, Pierre Genevès, Nils Gesbert, and Nabil Layaïda. 2025. Schema- Based Query Optimisation for Graph Databases. Proc. ACM Manag. Data 3, 1, Article 72 (Feb. 2025), 29 pages. https://doi.org/10.1145/3709722
2025 doi
-
[39]
Yannis Smaragdakis and Martin Bravenboer. 2010. Using Datalog for Fast and Easy Program Analysis. In Datalog. https://api.semanticscholar.org/CorpusID: 2014940
2010
-
[40]
Michael Stonebraker and Joseph M Hellerstein. 1998. Readings in database systems
1998
-
[41]
Steer, Dávid Szakállas, Altan Birler, Mingxi Wu, Yuchen Zhang, and Peter Boncz
Gábor Szárnyas, Jack Waudby, Benjamin A. Steer, Dávid Szakállas, Altan Birler, Mingxi Wu, Yuchen Zhang, and Peter Boncz. 2022. The LDBC Social Network Benchmark: Business Intelligence Workload. Proc. VLDB Endow. 16, 4 (Dec. 2022), 877–890. https://doi.org/10.14778/3574245.3574270
2022
-
[42]
D. J. Troy, C. T. Yu, and W. Zhang. 1989. Linearization of Nonlinear Recursive Rules. IEEE Trans. Softw. Eng. 15, 9 (Sept. 1989), 1109–1119. https://doi.org/10. 1109/32.31368
1989
-
[43]
Ngo, Reinhard Pichler, and Dan Suciu
Yisu Remy Wang, Mahmoud Abo Khamis, Hung Q. Ngo, Reinhard Pichler, and Dan Suciu. 2022. Optimizing Recursive Queries with Progam Synthesis. In SIGMOD ’22, PA, USA, June 12 - 17, 2022 , Zachary G. Ives, Angela Bonifati, and Amr El Abbadi (Eds.). ACM, 79–93. https://doi.org/10.1...
2022
-
[2025]
VLDB Endowment, 1798–1810
GQL and SQL/PGQ: Theoretical models and expressive power (Proceedings of the VLDB Endowment) . VLDB Endowment, 1798–1810. https://doi.org/10. 14778/3725688.3725707
Reviewed August 6, 2026 · model on record in the stance chip above.
Discussion (0). Continue with ORCID to comment.