相同模式,不同答案:GQL 与 SQL/PGQ 路径模式的参考语义与分歧图谱
Same Pattern, Different Answer: A Reference Semantics and Divergence Map for GQL and SQL/PGQ Path Patterns
浏览论文内容
中文总结 AI 辅助
针对GQL与SQL/PGQ路径模式,构建可执行参考语义并测试五个引擎,发现大量静默分歧和自一致性缺陷,结果开源。
中文摘要 AI 辅助
GQL(ISO/IEC 39075:2024)是首个国际标准的图查询语言,而SQL/PGQ(ISO/IEC 9075-16:2023)将相同的模式匹配核心GPML嵌入到SQL中。两者都为路径模式定义了精确的语义:四种路径模式、四种选择器、量化片段。引擎对这些模式的计算结果从未被测量过。关于GQL的工作是理论性的,不运行引擎;跨引擎的工作测量性能并将语义归一化。我们为GPML路径核心构建了一个可执行的参考语义,并对照标准参考说明中打印的六个工作答案进行验证。然后,我们对五个产品的六个版本——Kuzu、DuckPGQ、Neo4j 5.26和2026.04、Memgraph、Apache AGE——运行了一个包含17个构造的测试套件,将每个单元格评分为一致、分歧、拒绝或在相应方言中无法表达。17个构造中有9个在被接受的引擎中产生了多个答案。在26个分歧中,15个是静默的——查询运行、返回不同的多重集、不引发错误——静默比率为0.58。根据每个引擎手册声明的路径模式对每个分歧进行评分,将语言与实现分开:15个中有9个是文档化的差异,6个是偏离引擎所实现的标准。一个不需要参考语义的变形层发现了39个自一致性违规,产生两个最小缺陷。我们测量的引擎中,没有一个能解析标准自身示例所写的顺序,除了作者自己的引擎——该引擎是在此套件报告差距后添加的。套件、语义、复现器和结果均为开源。
英文摘要
GQL (ISO/IEC 39075:2024) is the first international standard for a graph query language, and SQL/PGQ (ISO/IEC 9075-16:2023) embeds the same pattern-matching core, GPML, in SQL. Both fix a precise semantics for path patterns: four path modes, four selectors, quantified segments. What engines compute for those patterns has never been measured. Work on GQL is theoretical and runs no engine; cross-engine work measures performance and normalises the semantics away. We build an executable reference semantics for the GPML path core and gate it against the six worked answers printed in the standard's own reference exposition. We then run a 17-construct suite against six releases of five products - Kuzu, DuckPGQ, Neo4j at 5.26 and 2026.04, Memgraph, Apache AGE - scoring each cell as conforming, diverging, rejected, or inexpressible in that dialect. Nine of seventeen constructs draw more than one answer across the engines that accepted them. Of 26 disagreements, 15 are silent - the query runs, returns a different multiset, raises no error - a silence ratio of 0.58. Scoring each divergence against the path mode each engine's manual declares separates language from implementation: 9 of 15 are documented differences, 6 are departures from the standard the engine implements. A metamorphic layer needing no reference semantics finds 39 self-consistency violations, yielding two minimal defects. No engine we measured parses the order the standard's own examples are written in, except the authors' own, which added it after this suite reported the gap. Suite, semantics, reproducers and results are open source.
发表机构
- VaidhyaMegha Private Limited(VaidhyaMegha私人有限公司)
机构由 AI 辅助整理,请以论文原文为准。