The formalism of RPQs (regular path queries) is an important building block of most query languages for graph databases. RPQs are generally evaluated under homomorphism semantics; in particular only the endpoints of the matched walks are returned. Practical applications often need the full matched walks to compute aggregate values. In those cases, homomorphism semantics are not suitable since the number of matched walks can be infinite. Hence, graph-database engines adapt the semantics of RPQs, often neglecting theoretical red flags. For instance, the popular query language Cypher uses trail semantics, which ensures the result to be finite at the cost of making computational problems intractable. We propose a new kind of semantics for RPQs, including in particular simple-run and binding-trail semantics, as a candidate to reconcile theoretical considerations with practical aspirations. Both ensure the output to be finite in a way that is compatible with homomorphism semantics: projection on endpoints coincides with homomorphism semantics. Hence, testing the emptiness of result is tractable, and known methods readily apply. Moreover, simple-run and binding-trail semantics support bag semantics, and enumeration of the bag of results is tractable
翻译:RPQ(定期路径查询)的正规化是图形数据库中大多数查询语言的重要基石。 RPQ(定期路径查询) 通常是用同质语义来评价, 特别是只返回匹配行的终点。 实际应用通常需要完全匹配的行走来计算总值。 在这些情况下, 单态语义并不合适, 因为匹配行走的次数可能无限。 因此, 图形数据库引擎可以调整RPQ的语义, 常常忽略理论红旗。 例如, 流行的查询语言 Cypher 使用线索语义, 以确保结果以计算问题难以解决的代价来限制结果。 我们为 RPQ 提出了一种新的语义, 包括特别简单运行和紧凑的曲义, 作为将理论考虑与实际愿望相调的候选者。 两者都确保输出是有限的, 与单态语义语义的语义: 对终点的预测与同正态语义的语义相吻合。 因此, 测试结果的偏差性是可移动的, 并且已知的沙标是容易应用的, 。