We propose GLL-based context-free path querying algorithm which handles queries in Extended Backus-Naur Form (EBNF) using Recursive State Machines (RSM). Utilization of EBNF allows one to combine traditional regular expressions and mutually recursive patterns in constraints natively. The proposed algorithm solves both the reachability-only and the all-paths problems for the all-pairs and the multiple sources cases. The evaluation on realworld graphs demonstrates that utilization of RSMs increases performance of query evaluation. Being implemented as a stored procedure for Neo4j, our solution demonstrates better performance than a similar solution for RedisGraph. Performance of our solution of regular path queries is comparable with performance of native Neo4j solution, and in some cases our solution requires significantly less memory.
翻译:本文提出了一种基于GLL的上下文无关路径查询算法,该算法利用递归状态机处理扩展巴科斯范式形式的查询。扩展巴科斯范式的使用允许用户将传统正则表达式与互递归模式自然地组合在约束条件中。所提出的算法能够解决全对和多源情况下的可达性查询与全路径查询问题。在真实世界图上的评估表明,递归状态机的使用能够提升查询执行的性能。作为Neo4j的存储过程实现后,我们的方案展现出比RedisGraph相似方案更优的性能。在正则路径查询方面,我们的方案性能与Neo4j原生方案相当,且在部分场景下内存需求显著更低。