Path queries are a core feature of modern graph query languages such as Cypher, SQL/PGQ, and GQL. These languages provide a rich set of features for matching paths, such as restricting to certain path modes (shortest, simple, trail) and constraining the edge labels along the path by a regular expression. In this paper we present PathFinder, a unifying approach for dealing with path queries in all these query languages. PathFinder leverages a compact representation of the (potentially exponential number of) paths that can match a given query, extends it with pipelined execution, and supports all commonly used path modes. In the paper we describe the algorithmic backbone of PathFinder, provide a reference implementation, and test it over a large set of real-world queries and datasets. Our results show that PathFinder exhibits very stable behavior, even on large data and complex queries, and its performance is an order of magnitude better than that of many modern graph engines.
翻译:路径查询是现代图查询语言(如Cypher、SQL/PGQ和GQL)的核心功能。这类语言提供了丰富的路径匹配特性,包括限制特定路径模式(最短、简单、轨迹)以及通过正则表达式约束路径上的边标签。本文提出PathFinder——一种统一处理所有上述查询语言中路径查询的方法。PathFinder利用路径的紧凑表示(可能包含指数级数量的匹配路径),通过流水线执行扩展该表示,并支持所有常用路径模式。本文阐述了PathFinder的核心算法机制,提供了参考实现,并在大量真实查询与数据集上进行了测试。结果表明,即便面对大规模数据和复杂查询,PathFinder仍展现出高度稳定的性能,其表现优于多数现代图引擎一个数量级。