Lune

OOPSLA2026Top-tier venue

Synthesizing Graph Queries from Demonstrations

Xiaoyu Liu, Qikang Liu, Evan Dyce, Keval Vora, Yuepeng Wang

Abstract

Writing graph queries is challenging for non-experts due to the complexity of graph data models and the need to identify proper graph patterns. While recent research has advanced query synthesis for relational and document databases, the problem of synthesizing graph queries remains under-explored. We present a novel approach for synthesizing graph queries from computation demonstrations, where users specify the desired output through expressions over properties of input graphs. Our method addresses the challenge of inferring meaningful graph patterns for matching and efficiently constructing the remaining components of the query. Specifically, we combine graph mining, which identifies candidate patterns across input graphs, with deduction-based pruning, which guides an efficient synthesis of the filtering predicate and return clause. We have implemented our approach in a tool called DMiner and evaluated it on 90 benchmarks. Experimental results show that DMiner successfully synthesizes desired queries for 87 benchmarks, with an average synthesis time of 0.6 seconds per query. This outperforms both enumerative search and LLM baselines. We also conducted a user study, which shows that users can provide demonstrations with modest effort and 87.5% of the provided demonstrations are sufficient for DMiner to synthesize the desired query.

Ask Lune

Know where this paper stands in minutes, not an afternoon.

Lune can read the top-tier papers that cite it and the ones closest to it, and tells you what it claims, what came after and where it falls short, each point cited to the paper it comes from. No skimming, no AI slop.

Questions to start from

Lune can draw on

its abstract · related work

Get the answer

Free to start. No credit card required.

Related papers

  1. Synthesizing Document Database Queries Using Collection AbstractionsQikang Liu, Yang He, Yanwen Cai, Byeongguk Kwak et al.ICSE 2025
  2. Synthesizing SpecificationsKanghee Park, Loris D'Antoni, Thomas W. RepsOOPSLA 2023 · 9 citations
  3. Relational Query Synthesis ⋈ Decision Tree LearningAaditya Naik, Aalok Thakkar, Adam Stein, Rajeev Alur et al.VLDB 2024 · 2 citations
  4. Geo: A Query Rewrite Framework for Graph Pattern MiningNazanin Yousefian, Kasra Jamshidi, Keval Vora, Anders MiltnerOOPSLA 2026
  5. Efficient Graph Matching with Pattern ReductionPingpeng Yuan, Yujiang Wang, Jiangji Peng, Tianyu Ma et al.ICDE 2026
Dusk over the sea between two cliffs drawn in fine vertical lines