A graph database is a digraph whose arcs are labeled with symbols from a fixed alphabet. A regular graph pattern (RGP) is a digraph whose edges are labeled with regular expressions over the alphabet. RGPs model navigational queries for graph databases called conjunctive regular path queries (CRPQs). A match of a CRPQ in the database is witnessed by a special navigational homomorphism of the corresponding RGP to the database. We study the complexity of deciding the existence of a homomorphism between two RGPs. Such homomorphisms model a strong type of containment between the two corresponding CRPQs. We show that this problem can be solved by an EXPTIME algorithm (while general query containmement in this context is EXPSPACE-complete). We also study the problem for restricted RGPs over a unary alphabet, that arise from some applications like XPath or SPARQL. For this case, homomorphism-based CRPQ containment is in NP. We prove that certain interesting cases are in fact polynomial-time solvable.
翻译:[摘要] 图数据库是一种有向图,其弧线标有固定字母表中的符号。正则图模式(RGP)是一种有向图,其边标有字母表上的正则表达式。RGP 建模了用于图数据库的导航查询,称为合取正则路径查询(CRPQ)。数据库中 CRPQ 的匹配由对应 RGP 到数据库的特定导航同态来见证。我们研究判定两个 RGP 之间是否存在同态问题的复杂性。此类同态建模了对应两个 CRPQ 之间的一种强包含关系。我们证明该问题可通过 EXPTIME 算法求解(而在此上下文中,一般查询包含问题是 EXPSPACE 完全的)。我们还研究了源于某些应用(如 XPath 或 SPARQL)的、基于一元字母表的受限 RGP 问题。在此情况下,基于同态的 CRPQ 包含问题属于 NP。我们证明某些有趣实例实际上可在多项式时间内求解。