Approximation and Semantic Treewidth of Conjunctive Regular Path Queries
Abstract
We show that the problem of whether a query is equivalent to a query of treewidth $k$ is decidable, for the class of Unions of Conjunctive Regular Path Queries with twoway navigation (UC2RPQs). A previous result by Barceló, Romero, and Vardi has shown decidability for the case $k=1$, and here we show that decidability in fact holds for any arbitrary $k>1$. The algorithm is in 2ExpSpace, but for the restricted but practically relevant case where all regular expressions of the query are of the form $a^*$ or $(a_1 + \dotsb + a_n)$ we show that the complexity of the problem drops to $\Pi_2^p$. We also investigate the related problem of approximating a UC2RPQ by queries of small treewidth. We exhibit an algorithm which, for any fixed number $k$, builds the maximal underapproximation of treewidth $k$ of a UC2RPQ. The maximal underapproximation of treewidth $k$ of a query $q$ is a query $q'$ of treewidth $k$ which is contained in $q$ in a maximal and unique way, that is, such that for every query $q''$ of treewidth $k$, if $q''$ is contained in $q$ then $q''$ is also contained in $q'$.
 Publication:

arXiv eprints
 Pub Date:
 December 2022
 DOI:
 10.48550/arXiv.2212.01679
 arXiv:
 arXiv:2212.01679
 Bibcode:
 2022arXiv221201679F
 Keywords:

 Computer Science  Logic in Computer Science;
 Computer Science  Databases;
 Computer Science  Formal Languages and Automata Theory
 EPrint:
 Long version of a paper accepted at ICDT 2023