View-Based Tree-Language Rewritings for XML

  • Laks V. S. Lakshmanan
  • Alex Thomo
Part of the Lecture Notes in Computer Science book series (LNCS, volume 8367)


We study query rewriting using views (QRV) for XML. Our queries and views are regular tree languages (RTLs) represented by tree automata over marked alphabets, where the markers serve as “node selectors”. We formally define query rewriting using views for RTLs and give an automata-based algorithm to compute the maximally contained rewriting. The formalism we use is equal in power with Monadic Second Order (MSO) logic, and our algorithm for computing QRV is the first to target this expressive class. Furthermore we prove a tight lower bound, thus showing that our algorithm is optimal. Another strength of our automata-based approach is that we are able to cast computing QRV into executing a sequence of intuitive operations on automata, thus rendering our approach practical as it can be easily implemented utilizing off-the-shelf automata toolboxes. Finally, we generalize our framework to account for more complex queries in the spirit of the FOR clause in XQuery. For this generalization as well, we give an optimal algorithm for computing the maximally contained rewriting of queries using views.


XML View-Based Rewriting Tree Automata 


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Afanasiev, L., Blackburn, P., Dimitriou, I., Gaiffe, B., Goris, E., Marx, M., de Rijke, M.: PDL for ordered trees. Journal of Applied Non-Classical Logics 15(2), 115–135 (2005)CrossRefzbMATHMathSciNetGoogle Scholar
  2. 2.
    Afrati, F.N., Chirkova, R., Gergatsoulis, M., Kimelfeld, B., Pavlaki, V., Sagiv, Y.: On rewriting XPath queries using views. In: EDBT (2009)Google Scholar
  3. 3.
    Arenas, M., Barceló, P., Libkin, L.: Combining temporal logics for querying XML documents. In: Schwentick, T., Suciu, D. (eds.) ICDT 2007. LNCS, vol. 4353, pp. 359–373. Springer, Heidelberg (2006)CrossRefGoogle Scholar
  4. 4.
    Arion, A., Benzaken, V., Manolescu, I., Papakonstantinou, Y.: Structured materialized views for XML queries. In: VLDB (2007)Google Scholar
  5. 5.
    Balmin, A., Özcan, F., Beyer, K.S., Cochrane, R., Pirahesh, H.: A framework for using materialized XPath views in XML query processing. In: VLDB (2004)Google Scholar
  6. 6.
    Calvanese, D., De Giacomo, G., Lenzerini, M., Vardi, M.Y.: An automata-theoretic approach to regular XPath. In: Gardner, P., Geerts, F. (eds.) DBPL 2009. LNCS, vol. 5708, pp. 18–35. Springer, Heidelberg (2009)CrossRefGoogle Scholar
  7. 7.
    Calvanese, D., Giacomo, G.D., Lenzerini, M., Vardi, M.Y.: Node selection query languages for trees. In: AAAI (2010)Google Scholar
  8. 8.
    Cautis, B., Deutsch, A., Onose, N.: XPath rewriting using multiple views: Achieving completeness and efficiency. In: WebDB (2008)Google Scholar
  9. 9.
    Claves, P., Jansen, D., Holtrup, S.J., Mohr, M., Reis, A., Schatz, M., Thesing, I.: LETHAL: Library for working with finite tree and hedge automata (2009),
  10. 10.
    Comon, H., Dauchet, M., Gilleron, R., Löding, C., Jacquemard, F., Lugiez, D., Tison, S., Tommasi, M.: Tree automata techniques and applications (2007)Google Scholar
  11. 11.
    Fan, W., Geerts, F., Jia, X., Kementsietsidis, A.: Rewriting regular XPath queries on XML views. In: ICDE (2007)Google Scholar
  12. 12.
    Filiot, E.: Ranked and unranked tree automata libraries (grappa),
  13. 13.
    Filiot, E., Niehren, J., Talbot, J.-M., Tison, S.: Composing monadic queries in trees. In: PLAN-X (2006)Google Scholar
  14. 14.
    Frick, M., Grohe, M., Koch, C.: Query evaluation on compressed trees (extended abstract). In: LICS (2003)Google Scholar
  15. 15.
    Lakshmanan, L.V.S., Thomo, A.: View-based tree-language rewritings for XML (2013),
  16. 16.
    Lakshmanan, L.V.S., Wang, H., Zhao, Z.J.: Answering tree pattern queries using views. In: VLDB (2006)Google Scholar
  17. 17.
    Libkin, L., Sirangelo, C.: Reasoning about XML with temporal logics and automata. J. Applied Logic 8(2), 210–232 (2010)CrossRefzbMATHMathSciNetGoogle Scholar
  18. 18.
    Miklau, G., Suciu, D.: Containment and equivalence for a fragment of XPath. JACM 51(1), 2–45 (2004)CrossRefMathSciNetGoogle Scholar
  19. 19.
    Neven, F.: Design and Analysis of Query Languages for Structured Documents–A Formal and Logical Approach. PhD thesis. Limburgs Universitair Centrum (1999)Google Scholar
  20. 20.
    Neven, F., Schwentick, T.: Expressive and efficient pattern languages for tree-structured data. In: PODS (2000)Google Scholar
  21. 21.
    Neven, F., Schwentick, T.: Query automata over finite trees. TCS 275(1-2), 633–674 (2002)CrossRefzbMATHMathSciNetGoogle Scholar
  22. 22.
    Neven, F., Schwentick, T.: On the complexity of XPath containment in the presence of disjunction, DTDs, and variables. Logical Methods in Computer Science 2(3) (2006)Google Scholar
  23. 23.
    Niehren, J., Planque, L., Talbot, J.-M., Tison, S.: N-ary queries by tree automata. In: DBPL (2005)Google Scholar
  24. 24.
    Onose, N., Deutsch, A., Papakonstantinou, Y., Curtmola, E.: Rewriting nested XML queries using nested views. In: SIGMOD Conf. (2006)Google Scholar
  25. 25.
    Schwentick, T.: On diving in trees. In: Nielsen, M., Rovan, B. (eds.) MFCS 2000. LNCS, vol. 1893, pp. 660–669. Springer, Heidelberg (2000)CrossRefGoogle Scholar
  26. 26.
    Schwentick, T.: Automata for XML - a survey. J. Comput. Syst. Sci. 73(3), 289–315 (2007)CrossRefzbMATHMathSciNetGoogle Scholar
  27. 27.
    ten Cate, B., Segoufin, L.: XPath, transitive closure logic, and nested tree walking automata. In: PODS (2008)Google Scholar
  28. 28.
    Thatcher, J.W., Wright, J.B.: Generalized finite automata theory with an application to a decision problem of second-order logic. Mathematical Systems Theory 2(1), 57–81 (1968)CrossRefMathSciNetGoogle Scholar
  29. 29.
    Thomo, A., Venkatesh, S.: Rewriting of VPLs for XML data integration. In: CIKM (2008)Google Scholar
  30. 30.
    Wang, J., Li, J., Yu, J.X.: Answering tree pattern queries using views: A revisit. In: EDBT (2011)Google Scholar
  31. 31.
    Xu, W., Özsoyoglu, Z.M.: Rewriting XPath queries using materialized views. In: VLDB (2005)Google Scholar
  32. 32.
    Yu, C., Popa, L.: Constraint-based XML query rewriting for data integration. In: SIGMOD (2004)Google Scholar

Copyright information

© Springer International Publishing Switzerland 2014

Authors and Affiliations

  • Laks V. S. Lakshmanan
    • 1
  • Alex Thomo
    • 2
  1. 1.University of British ColumbiaVancouverCanada
  2. 2.University of VictoriaVictoriaCanada

Personalised recommendations