We study the problem of querying data sources that accept only a limited set of queries, such as sources accessible by Web services which can implement very large (potentially infinite) families of queries. We revisit a classical setting in which the application queries are conjunctive queries and the source accepts families of (possibly parameterized) conjunctive queries specified as the expansions of a (potentially recursive) Datalog program with parameters. We say that query Q is expressible by the program P if it is equivalent to some expansion of P. Q is supported by P if it has an equivalent rewriting using some finite set of P's expansions. We present the first study of expressibility and support for sources that satisfy integrity constraints, which is generally the case in practice. We start by closing a problem left open by prior work even while ignoring constraints, namely the precise relationship between expressibility and support: surprisingly, we show them to be inter-reducible in PTIME in both the absence and the presence of constraints. This enables us to employ the same algorithm for solving both problems. We identify practically relevant restrictions on the program specifying the views that ensure decidability under a mix of key and weakly acyclic foreign key constraints, and beyond. We show that these restrictions are as permissive as possible, since their slightest relaxation leads to undecidability. We present an algorithm that is guaranteed to be sound when applied to unrestricted input and in addition complete under the restrictions. As a side-effect of our investigation, we improve the previously best known upper bound for deciding support in the constraint-free case.
The authors of these documents have submitted their reports to this technical report series for the purpose of non-commercial dissemination of scientific work. The reports are copyrighted by the authors, and their existence in electronic format does not imply that the authors have relinquished any rights. You may copy a report for scholarly, non-commercial purposes, such as research or instruction, provided that you agree to respect the author's copyright. For information concerning the use of this document for other than research or instructional purposes, contact the authors. Other information concerning this technical report series can be obtained from the Computer Science and Engineering Department at the University of California at San Diego, firstname.lastname@example.org.
[ Search ]