skip to main content
10.1145/1411204.1411209acmconferencesArticle/Chapter ViewAbstractPublication PagesicfpConference Proceedingsconference-collections
research-article

FLUX: functional updates for XML

Published:20 September 2008Publication History

ABSTRACT

XML database query languages have been studied extensively, but XML database updates have received relatively little attention, and pose many challenges to language design. We are developing an XML update language called FLUX, which stands for FunctionaL Updates for XML, drawing upon ideas from functional programming languages. In prior work, we have introduced a core language for FLUX with a clear operational semantics and a sound, decidable static type system based on regular expression types.

Our initial proposal had several limitations. First, it lacked support for recursive types or update procedures. Second, although a high-level source language can easily be translated to the core language, it is difficult to propagate meaningful type errors from the core language back to the source. Third, certain updates are wellformed yet contain path errors, or "dead" subexpressions which never do any useful work. It would be useful to detect path errors, since they often represent errors or optimization opportunities.

In this paper, we address all three limitations. Specifically, we present an improved, sound type system that handles recursion. We also formalize a source update language and give a translation to the core language that preserves and reflects typability. We also develop a path-error analysis (a form of dead-code analysis) for updates.

Skip Supplemental Material Section

Supplemental Material

Video

References

  1. A. Balmin, Y. Papakonstantinou, and V. Vianu. Incremental validation of XML documents. ACM Transactions on Database Systems, 29 (4): 710--751, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. D. Barbosa, A. O. Mendelzon, L. Libkin, L. Mignet, and M. Arenas. Efficient incremental validation of XML documents. In ICDE, pages 671--682. IEEE Computer Society, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Michael Benedikt, Angela Bonifati, Sergio Flesca, and Avinash Vyas. Verification of tree updates for optimization. In Kousha Etessami and Sriram K. Rajamani, editors, CAV, volume 3576 of Lecture Notes in Computer Science, pages 379--393. Springer, 2005a. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Michael Benedikt, Angela Bonifati, Sergio Flesca, and Avinash Vyas. Adding updates to XQuery: Semantics, optimization, and static analysis. In Daniela Florescu and Hamid Pirahesh, editors, XIME-P, 2005b.Google ScholarGoogle Scholar
  5. Véronique Benzaken, Giuseppe Castagna, and Alain Frisch. CDuce: an XML-centric general-purpose language. In ICFP '03: Proceedings of the eighth ACM SIGPLAN international conference on Functional programming, pages 51--63, New York, NY, USA, 2003. ACM Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Geert Jan Bex, Frank Neven, and Jan Van den Bussche. DTDs versus XML schema: a practical study. In WebDB '04: Proceedings of the 7th International Workshop on the Web and Databases, pages 79--84, New York, NY, USA, 2004. ACM Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Peter Buneman, Shamim A. Naqvi, Val Tannen, and Limsoon Wong. Principles of programming with complex objects and collection types. Theor. Comp. Sci., 149 (1): 3--48, 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Cristiano Calcagno, ilippa Gardner, and Uri Zarfaty. Context logic and tree update. In Proceedings of the 32nd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL 2005), pages 271--282, New York, NY, USA, 2005. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Don Chamberlin and Jonathan Robie. XQuery update facility requirements. W3C Working Draft, June 2005. http://www.w3.org/TR/xquery-update-requirements/.Google ScholarGoogle Scholar
  10. Don Chamberlin, Mike Carey, Daniela Florescu, Donald Kossmann, and Jonathan Robie. XQueryP: Programming with XQuery. In XIME-P, 2006.Google ScholarGoogle Scholar
  11. Don Chamberlin, Daniela Florescu, Jim Melton, Jonathan Robie, and Jérôme Siméon. XQuery update facility. W3C Candidate Recommendation, March 2008. http://www.w3c.org/TR/xquery-update-10/.Google ScholarGoogle Scholar
  12. James Cheney. Lux: A lightweight, statically typed XML update language. In PLAN-X, pages 25--36, 2007.Google ScholarGoogle Scholar
  13. James Cheney. Regular expression subtyping for XML query and update languages. In Proceedings of the 17th European Symposium on Programming (ESOP 2008), number 4960 in LNCS, pages 32--46, 2008a. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. James Cheney. Flux: Functional updates for XML. Technical Report 2008. http://www.w3c.org/TR/xquery-update-10/.Google ScholarGoogle Scholar
  15. Byron Choi. What are real DTDs like? In WebDB, pages 43--48, 2002.Google ScholarGoogle Scholar
  16. J. Clark. XSL transformations (XSLT). W3C Recommendation, November 1999. http://www.w3.org/TR/xslt.Google ScholarGoogle Scholar
  17. Dario Colazzo, Giorgio Ghelli, Paolo Manghi, and Carlo Sartiani. Static analysis for path correctness of XML queries. J. Funct. Program., 16 (4-5): 621--661, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Denise Draper, Peter Fankhauser, Mary Fernández, Ashok Malhotra, Kristoffer Rose, Michael Rys, Jérôme Siméon, and ilip Wadler. XQuery 1.0 and XPath 2.0 formal semantics. W3C Recommendation, January 2007. http://www.w3.org/TR/xquery-semantics/.Google ScholarGoogle Scholar
  19. Mary F. Fernandez, Jérôme Siméon, and ilip Wadler. A semi-monad for semi-structured data. In Proceedings of the 8th International Conference on Database Theory (ICDT 2001), pages 263--300, London, UK, 2001. Springer-Verlag. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Alain Frisch. OCaml + XDuce. In ICFP '06: Proceedings of the eleventh ACM SIGPLAN international conference on Functional programming, pages 192--200, New York, NY, USA, 2006. ACM Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. Vladimir Gapeyev, Franc¸ois Garillot, and Benjamin C. Pierce. Statically typed document transformation: An Xtatic experience. In Giuseppe Castagna and Mukund Raghavachari, editors, PLAN-X, pages 2--13. BRICS, 2006.Google ScholarGoogle Scholar
  22. Philippa Gardner, Gareth Smith, Mark Wheelhouse, and Uri Zarfaty. Local hoare reasoning about DOM. In Proceedings of the 2008 Symposium on Principles of Database Systems (PODS 2008), pages 261--270, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. G. Ghelli, K. Rose, and J. Sim´eon. Commutativity analysis in XML update languages. In Dan Suciu and Thomas Schwentick, editors, Proceedings of the 11th International Conference on Database Theory (ICDT 2007), pages 374--388, January 2007a. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. Giorgio Ghelli, Christopher Re, and Jérôme Siméon. XQuery!: An XML query language with side effects. In EDBT Workshops, volume 4254 of Lecture Notes in Computer Science, pages 178--191. Springer, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Giorgio Ghelli, Nicola Onose, Kristoffer Rose, and Jérôme Siméon. A better semantics for XQuery with side-effects. In Marcelo Arenas and Michael I. Schwartzbach, editors, DBPL, volume 4797 of Lecture Notes in Computer Science, pages 81--96. Springer, 2007b. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Haruo Hosoya and Benjamin C. Pierce. XDuce: A statically typed XML processing language. ACM Trans. Internet Technology, 3(2):117--148, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. Haruo Hosoya, Jérôme Vouillon, and Benjamin C. Pierce. Regular expression types for XML. ACM Trans. Program. Lang. Syst., 27(1):46--90, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. John Hughes. Generalising monads to arrows. Sci. Comput. Program., 37 (1-3):67--111, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. Andreas Laux and Lars Martin. XUpdate - XML update language. http://xmldb-org.sourceforge.net/xupdate/-xupdate-wd.html, September 2000. Work in progress.Google ScholarGoogle Scholar
  30. Hartmut Liefke and Susan B. Davidson. Specifying updates in biomedical databases. In SSDBM, pages 44--53, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. Anders Møller and Michael I. Schwartzbach. The design space of type checkers for XML transformation languages. In Proceedings of the 10th International Conference on Database Theory (ICDT 2005), pages 17--36, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. Gargi Sur, Joachim Hammer, and Jérôme Siméon. UpdateX - an XQuery-based language for processing updates in XML. In PLAN-X, 2004.Google ScholarGoogle Scholar
  33. Igor Tatarinov, Zachary G. Ives, Alon Y. Halevy, and Daniel S. Weld. Updating XML. In SIGMOD Conference, pages 413--424, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. Guoren Wang, Mengchi Liu, and Li Lu. Extending XML-RL with update. In IDEAS, pages 66--75. IEEE Computer Society, 2003.Google ScholarGoogle Scholar

Index Terms

  1. FLUX: functional updates for XML

          Recommendations

          Comments

          Login options

          Check if you have access through your login credentials or your institution to get full access on this article.

          Sign in
          • Published in

            cover image ACM Conferences
            ICFP '08: Proceedings of the 13th ACM SIGPLAN international conference on Functional programming
            September 2008
            422 pages
            ISBN:9781595939197
            DOI:10.1145/1411204
            • cover image ACM SIGPLAN Notices
              ACM SIGPLAN Notices  Volume 43, Issue 9
              ICFP '08
              September 2008
              399 pages
              ISSN:0362-1340
              EISSN:1558-1160
              DOI:10.1145/1411203
              Issue’s Table of Contents

            Copyright © 2008 ACM

            Publisher

            Association for Computing Machinery

            New York, NY, United States

            Publication History

            • Published: 20 September 2008

            Permissions

            Request permissions about this article.

            Request Permissions

            Check for updates

            Qualifiers

            • research-article

            Acceptance Rates

            Overall Acceptance Rate333of1,064submissions,31%

            Upcoming Conference

            ICFP '23

          PDF Format

          View or Download as a PDF file.

          PDF

          eReader

          View online with eReader.

          eReader
          About Cookies On This Site

          We use cookies to ensure that we give you the best experience on our website.

          Learn more

          Got it!