The study of graph queries in database theory has spanned more than three decades, resulting in a multitude of proposals for graph query languages. These languages differ in the mechanisms. We can identify three main families of languages, with the canonical representatives being: (1) regular path queries, (2) walk logic, and (3) first-order logic with transitive closure operators. This paper provides a complete picture of the expressive power of these languages in the context of data graphs. Specifically, we consider a graph data model that supports querying over both data and topology. For example, "Does there exist a path between two different persons in a social network with the same last name?". We also show that an extension of (1), augmented with transitive closure operators, can unify the expressivity of (1)--(3) without increasing the query evaluation complexity.
翻译:数据库理论中对图查询的研究已跨越三十余载,催生了众多图查询语言的提案。这些语言在机制上各有不同。我们可以识别出三大语言族系,其典型代表分别为:(1) 正则路径查询,(2) 游走逻辑,以及(3) 带传递闭包算子的—阶逻辑。本文在数据图的语境下,完整描绘了这些语言的表达能力图景。具体而言,我们考虑一种支持对数据和拓扑结构同时进行查询的图数据模型。例如,“在社交网络中,是否存在两个姓氏相同的人之间存在一条路径?”。我们还证明,对(1)进行扩展——通过增加传递闭包算子——能够在不增加查询评估复杂度的前提下,统一(1)–(3)的表达能力。