Abstract
The basic querying mechanism over semistructured data, namely regular path queries, asks for all pairs of objects that are connected by a path conforming to a regular expression. We consider conjunctive two-way regular path queries (C2RPQc’s), which extend regular path queries with two features. First, they add the inverse operator, which allows for expressing navigations in the database that traverse the edges both backward and forward. Second, they allow for using conjunctions of atoms, where each atom specifies that a regular path query with inverse holds between two terms, where each term is either a variable or a constant. For such queries we address the problem of view-based query answering, which amounts to computing the result of a query only on the basis of a set of views. More specifically, we present the following results: (1) We exhibit a mutual reduction between query containment and the recognition problem for view-based query answering for C2RPQc’s, i.e., checking whether a given tuple is in the certain answer to a query. Based on such a result, we can show that the problem of view-based query answering for C2RPQc’s is EXPSPACE-complete. (2) By exploiting techniques based on alternating two-way automata we show that for the restricted class of tree two-way regular path queries (in which the links between variables form a tree), query containment and view-based query answering are, rather surprisingly, in PSPACE (and hence, PSPACE-complete). (3) We present a technique to obtain view-based query answering algorithms that compute the whole set of tuples in the certain answer, instead of requiring to check each tuple separately. The technique is parametric wrt the query language, and can be applied both to C2RPQc’s and to tree-queries.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
S. Abiteboul, P. Buneman, and D. Suciu. Data on the Web: from Relations to Semistructured Data and XML. Morgan Kaufmann, Los Altos, 2000.
S. Abiteboul and O. Duschka. Complexity of answering queries using materialized views. In Proc. of PODS’98, pages 254–265, 1998.
S. Abiteboul, D. Quass, J. McHugh, J. Widom, and J. L. Wiener. The Lorel query language for semistructured data. Int. J. on Digital Libraries, 1(1):68–88, 1997.
F. N. Afrati, M. Gergatsoulis, and T. Kavalieros. Answering queries using materialized views with disjunction. In Proc. of ICDT’99, volume 1540 of LNCS, pages 435–452. Springer, 1999.
A. V. Aho, Y. Sagiv, and J. D. Ullman. Equivalence among relational expressions. SIAM J. on Computing, 8:218–246, 1979.
D. Barbará and T. Imieliński. Sleepers and workaholics: Caching strategies in mobile environments. In Proc. of ACM SIGMOD, pages 1–12, 1994.
C. Beeri, A. Y. Levy, and M.-C. Rousset. Rewriting queries using views in description logics. In Proc. of PODS’97, pages 99–108, 1997.
J.-C. Birget. State-complexity of finite-state devices, state compressibility and incompressibility. Mathematical Systems Theory, 26(3):237–269, 1993.
J. A. Brzozowski and E. Leiss. Finite automata and sequential networks. Theor. Comp. Sci., 10:19–35, 1980.
P. Buneman. Semistructured data. In Proc. of PODS’97, pages 117–121, 1997.
P. Buneman, S. Davidson, G. Hillebrand, and D. Suciu. A query language and optimization technique for unstructured data. In Proc. of ACM SIGMOD, pages 505–516, 1996.
D. Calvanese, G. De Giacomo, and M. Lenzerini. On the decidability of query containment under constraints. In Proc. of PODS’98, pages 149–158, 1998.
D. Calvanese, G. De Giacomo, and M. Lenzerini. Answering queries using views over description logics knowledge bases. In Proc. of AAAI 2000, pages 386–391, 2000.
D. Calvanese, G. De Giacomo, M. Lenzerini, and M. Y. Vardi. Rewriting of regular expressions and regular path queries. In Proc. of PODS’99, pages 194–204, 1999.
D. Calvanese, G. De Giacomo, M. Lenzerini, and M. Y. Vardi. Answering regular path queries using views. In Proc. of ICDE 2000, pages 389–398, 2000.
D. Calvanese, G. De Giacomo, M. Lenzerini, and M. Y. Vardi. Containment of conjunctive regular path queries with inverse. In Proc. of KR 2000, pages 176–185, 2000.
D. Calvanese, G. De Giacomo, M. Lenzerini, and M. Y. Vardi. Query processing using views for regular path queries with inverse. In Proc. of PODS 2000, pages 58–66, 2000.
D. Calvanese, G. De Giacomo, M. Lenzerini, and M. Y. Vardi. View-based query processing and constraint satisfaction. In Proc. of LICS 2000, pages 361–371, 2000.
D. Chamberlin, D. Florescu, J. Robie, J. Simeon, and M. Stefanescu. XQuery: A query language for XML. W3C Working Draft, Feb. 2001. Available at http://www.w3.org/TR/xquery .
E. P. F. Chan. Containment and minimization of positive conjunctive queries in oodb’s. In Proc. of PODS’92, pages 202–211, 1992.
A. K. Chandra, D. C. Kozen, and L. J. Stockmeyer. Alternation. J. of the ACM, 28(1):114–133, 1981.
A. K. Chandra and P. M. Merlin. Optimal implementation of conjunctive queries in relational data bases. In Proc. of STOC’77, pages 77–90, 1977.
S. Chaudhuri, S. Krishnamurthy, S. Potarnianos, and K. Shim. Optimizing queries with materialized views. In Proc. of ICDE’95, Taipei (Taiwan), 1995.
S. Chaudhuri and M. Y. Vardi. On the equivalence of recursive and nonrecursive Datalog programs. In Proc. of PODS’92, pages 55–66, 1992.
C. Chekuri and A. Rajaraman. Conjunctive query containment revisited. In Proc. of ICDT’97, pages 56–70, 1997.
J. Clark and S. DeRose. XML Path Language (XPath) version 1.0-W3C recommendation 16 november 1999. Technical report, World Wide Web Consortium, 1999. Available at http://www.w3.org/TR/1999/REC-xpath-19991116.
S. Cohen, W. Nutt, and A. Serebrenik. Rewriting aggregate queries using views. In Proc. of PODS’99, pages 155–166, 1999.
A. C. K. David S. Johnson. Testing containment of conjunctive queries under functional and inclusion dependencies. J. of Computer and System Sciences, 28(1):167–189, 1984.
A. Deutsch, M. F. Fernandez, D. Florescu, A. Levy, and D. Suciu. XML-QL: A query language for XML. Submission to the World Wide Web Consortium, Aug. 1998. Available at http://www.w3.org/TR/NOTE-xml-ql .
A. Deutsch and V. Tannen. Optimization properties for classes of conjunctive regular path queries. In Proc. of DBPL 2001, 2001.
O. M. Duschka and M. R. Genesereth. Answering recursive queries using views. In Proc. of PODS’97, pages 109–116, 1997.
M. F. Fernandez, D. Florescu, J. Kang, A. Y. Levy, and D. Suciu. Catching the boat with strudel: Experiences with a web-site management system. In Proc. of ACM SIGMOD, pages 414–425, 1998.
D. Florescu, A. Levy, and D. Suciu. Query containment for conjunctive queries with regular expressions. In Proc. of PODS’98, pages 139–148, 1998.
G. Grahne and A. O. Mendelzon. Tableau techniques for querying information sources through global schemas. In Proc. of ICDT’99, volume 1540 of LNCS, pages 332–347. Springer, 1999.
S. Grumbach, M. Rafanelli, and L. Tininini. Querying aggregate data. In Proc. of PODS’99, pages 174–184, 1999.
J. E. Hopcroft and J. D. Ullman. Introduction to Automata Theory, Languages, and Computation. Addison Wesley Publ. Co., Reading, Massachussetts, 1979.
A. C. Klug. On conjunctive queries containing inequalities. J. of the ACM, 35(1):146–160, 1988.
O. Kupferman, N. Piterman, and M. Y. Vardi. Extended temporal logic revisited. In Proc. of CONCUR 2001, volume 2154 of LNCS, pages 519–535. Springer, 2001.
R. E. Ladner, R. J. Lipton, and L. J. Stockmeyer. Alternating pushdown and stack automata. SIAM J. on Computing, 13(1):135–155, 1984.
A. Y. Levy, A. O. Mendelzon, Y. Sagiv, and D. Srivastava. Answering queries using views. In Proc. of PODS’95, pages 95–104, 1995.
A. Y. Levy and M.-C. Rousset. Combining Horn rules and description logics in CARIN. Artificial Intelligence, 104(1–2):165–209, 1998.
A. Y. Levy and D. Suciu. Deciding containment for queries with complex objects. In Proc. of PODS’97, pages 20–31, 1997.
J. McHugh and J. Widom. Optimizing branching path expressions. Technical report, Stanford University, 1999. Available at http://www-db.stanford.edu[chexxx]penalty-[chexxx]@M/pub/papers/mp.ps.
T. Milo and D. Suciu. Index structures for path expressions. In Proc. of ICDT’99, volume 1540 of LNCS, pages 277–295. Springer, 1999.
Y. Papakonstantinou and V. Vianu. DTD inference for views of XML data. In Proc. of PODS 2000, pages 35–46, 2000.
A. Rajaraman, Y. Sagiv, and J. D. Ullman. Answering queries using templates with binding patterns. In Proc. of PODS’95, 1995.
Y. Sagiv and M. Yannakakis. Equivalences among relational expressions with the union and difference operators. J. of the ACM, 27(4):633–655, 1980.
H. Seidl. Deciding equivalence of finite tree automata. SIAM J. on Computing, 19(3):424–437, 1990.
O. Shmueli. Equivalence of Datalog queries is undecidable. J. of Logic Programming, 15(3):231–241, 1993.
D. Srivastava, S. Dar, H. V. Jagadish, and A. Levy. Answering queries with aggregation using views. In Proc. of VLDB’96, pages 318–329, 1996.
O. G. Tsatalos, M. H. Solomon, and Y. E. Ioannidis. The GMAP: A versatile tool for phyisical data independence. VLDB Journal, 5(2):101–118, 1996.
J. D. Ullman. Information integration using logical views. In Proc. of ICDT’97, volume 1186 of LNCS, pages 19–40. Springer, 1997.
R. van der Meyden. The Complexity of Querying Indefinite Information. PhD thesis, Rutgers University, 1992.
M. Y. Vardi. A note on the reduction of two-way automata to one-way automata. Information Processing Letters, 30(5):261–264, 1989.
V. Vianu. A web odyssey: From Codd to XML. In Proc. of PODS 2001, 2001. Invited talk.
J. Widom (ed.). Special issue on materialized views and data warehousing. IEEE Bull. on Data Engineering, 18(2), 1995.
J. Widom (ed.). Special issue on materialized views and data warehousing. IEEE Bull. on Data Engineering, 22(3), 1999.
M. Yannakakis. Algorithms for acyclic database schemes. In Proc. of VLDB’81, pages 82–94, 1981.
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2002 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Calvanese, D., De Giacomo, G., Lenzerini, M., Vardi, M.Y. (2002). View-Based Query Answering and Query Containment over Semistructured Data. In: Ghelli, G., Grahne, G. (eds) Database Programming Languages. DBPL 2001. Lecture Notes in Computer Science, vol 2397. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-46093-4_3
Download citation
DOI: https://doi.org/10.1007/3-540-46093-4_3
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-44080-2
Online ISBN: 978-3-540-46093-0
eBook Packages: Springer Book Archive