arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2512.12957cs.DBcs.LO
收藏

数据库研究需要一种抽象关系查询语言

Database Research needs an Abstract Relational Query Language

Northeastern University(东北大学)

Wolfgang Gatterbauer, Diandre Miguel Sabale

AI总结:

本文提出了一种抽象关系查询语言(ARQL),旨在通过分离查询意图与语法,提供统一的语义框架,以支持机器生成查询与人类验证调试的交互需求。

摘要:

在数十年里,SQL一直是构建查询的默认语言,但如今它越来越被当作一个需要被阅读和验证的artifact,而不是被作者编写。随着大语言模型(LLMs)的发展,查询越来越由机器生成,而人类则负责阅读、验证和调试这些查询。这种转变使关系查询语言变成了用于意图交流的接口,这将促使关系语言设计的重新思考,更广泛地说,也是关系接口设计的重新思考。我们主张这种重新思考需要一种抽象关系查询语言(ARQL)的支持:一种以语义优先的参考元语言,它将查询意图与面向用户的语法分离,并使底层的关系模式在不同面向用户的语言中显式且可比较。ARQL将查询分为(i)关系核心(决定意图的组合结构),(ii)模态(针对不同受众的该核心的替代表示),以及(iii)惯例(正交的环境级语义参数,用于解释核心,例如集合与袋语义,或空值的处理方式)。对于人类或机器的可用性则不再取决于选择特定的语言,而是取决于选择合适的模态。比较语言则变成一个问题,即它们支持哪些关系模式以及它们选择了哪些惯例。我们介绍了抽象关系演算(ARC),作为元语言ARQL的一个具体实例。ARC有三种模态:(i)一种基于理解的文本记法,(ii)一种抽象语言树(ALT)用于机器推理解释意义,以及(iii)一种用于人类的图示化分层图(higraph)表示。ARC提供了缺失的词汇,并充当了关系查询的罗塞塔石碑。

英文摘要:

For decades, SQL has been the default language for composing queries, but it is increasingly used as an artifact to be read and verified rather than authored. With Large Language Models (LLMs), queries are increasingly machine-generated, while humans read, validate, and debug them. This shift turns relational query languages into interfaces for back-and-forth communication about intent, which will lead to a rethinking of relational language design, and more broadly, relational interface design. We argue that this rethinking needs support from an Abstract Relational Query Language (ARQL): a semantics-first reference metalanguage that separates query intent from user-facing syntax and makes underlying relational patterns explicit and comparable across user-facing languages. An ARQL separates a query into (i) a relational core (the compositional structure that determines intent), (ii) modalities (alternative representations of that core tailored to different audiences), and (iii) conventions (orthogonal environment-level semantic parameters under which the core is interpreted, e.g., set vs. bag semantics, or treatment of null values). Usability for humans or machines then depends less on choosing a particular language and more on choosing an appropriate modality. Comparing languages becomes a question of which relational patterns they support and what conventions they choose. We introduce Abstract Relational Calculus (ARC), a strict generalization of Tuple Relational Calculus (TRC), as a concrete instance of ARQL. ARC comes in three modalities: (i) a comprehension-style textual notation, (ii) an Abstract Language Tree (ALT) for machine reasoning about meaning, and (iii) a diagrammatic hierarchical graph (higraph) representation for humans. ARC provides the missing vocabulary and acts as a Rosetta Stone for relational querying.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑