Skip to main content

Some Properties of Query Languages for Bags

  • Conference paper
Database Programming Languages (DBPL-4)

Part of the book series: Workshops in Computing ((WORKSHOPS COMP.))

Abstract

In this paper we study the expressive power of query languages for nested bags. We define the ambient bag language by generalizing the constructs of the relational language of Breazu-Tannen, Buneman and Wong, which is known to have precisely the power of the nested relational algebra. Relative strength of additional polynomial constructs is studied, and the ambient language endowed with the strongest combination of those constructs is chosen as a candidate for the basic bag language, which is called BQL (Bag Query Language). We prove that achieveing the power of BQL in the relational language amounts to adding simple arithmetic to the latter. We show that BQL has shortcomings of the relational algebra: it can not express recursive queries. In particular, parity test is not definable in BQL. We consider augmenting BQL with powerbag and structural recursion to overcome this deficiency. In contrast to the relational case, where powerset and structural recursion are equivalent, the latter is stronger than the former for bags. We discuss problems with using structural recursion and suggest a new bounded loop construct which works uniformly for bags, sets and lists. It has the power of structural recursion and does not require any preconditions to be verified. We find relational languages equivalent to BQL with powerbag and structural recursion/bounded loop. Finally, we discuss orderings on bags for rigorous treatment of partial information.

Supported in part by NSF Grant IRI-90-04137 and AT&T Doctoral Fellowship.

Supported in part by NSF Grant IRI-90-04137 and ARO Grant DAALO3-89-C-0031PRIME.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. S. Abiteboul and C. Beeri. On the power of languages for the manipulation of complex objects. In Proc. Int. Workshop on Theory and Applications of Nested Relations and Complex Objects, Darmstadt, 1988.

    Google Scholar 

  2. J. Albert. Algebraic properties of bag data types. In VLDB 91,pages 211–219.

    Google Scholar 

  3. V. Breazu-Tannen, P. Buneman, and S. Naqvi. Structural recursion as a query language. In DBPL 91,pages 9–19.

    Google Scholar 

  4. V. Breazu-Tannen and R. Subrahmanyam. Logical and computational aspects of programming with sets/bags/lists. In LNCS 510: ICALP 91,pages 60–75.

    Google Scholar 

  5. V. Breazu-Tannen, P. Buneman, and L. Wong. Naturally embedded query languages. In ICDT 92,pages 140–154.

    Google Scholar 

  6. P. Buneman, A. Ohori, and A. Jung. Using powerdomains to generalize relational databases. Theoretical Computer Science, 91: 23–55, 1991.

    Article  MathSciNet  MATH  Google Scholar 

  7. A. Chandra and D. Harel. Structure and complexity of relational queries. JCSS, 25: 99–128, 1982.

    MATH  Google Scholar 

  8. J. Van den Bussche and J. Paredaens. The expressive power of structured values in pure OODB. Technical Report 90–23, University of Antwerp, 1990. Extended abstract in PODS 91.

    Google Scholar 

  9. S. Grumbach and T. Milo. Towards tractable algebras for bags. In PODS 93,pages 49–60.

    Google Scholar 

  10. C. A. Gunter. Semantics of Programming Languages: Structures and Techniques. The MIT Press, 1992.

    Google Scholar 

  11. T. Imielinski and W. Lipski. Incomplete information in relational databases. Journal of the ACM, 31: 761–791, 1984.

    Article  MathSciNet  MATH  Google Scholar 

  12. N. Immerman, S. Patnaik and D. Stemple, The expressiveness of a family of finite set languages, in Proceedings of the 10th Symposium on Principles of Database Systems, 1991, pages 37–52.

    Google Scholar 

  13. L. A. Jategaonkar and J. C. Mitchell. ML with extended pattern matching and subtypes. In Proceedings of ACM Conference on LISP and Functional Programming, pages 198–211, Snowbird, Utah, July 1988.

    Google Scholar 

  14. A. Klausner and N. Goodman. Multirelations: semantics and languages. In VLDB 85,pages 251–258.

    Google Scholar 

  15. A. Klug. Equivalence of relational algebra and relational calculus query languages having aggregate functions. J. ACM, 29 (3): 699–717, 1982.

    Article  MathSciNet  MATH  Google Scholar 

  16. L. Libkin. A relational algebra for complex objects based on partial information. In J. Demetrovics and B. Thalheim editors, LNCS.495: Proceedings of Symposium on Mathematical Fundamentals of Database Systems, Rostock, May 1991, pages 36–41. Springer-Verlag, 1991.

    Google Scholar 

  17. L. Libkin and L. Wong. Semantic representations and query languages for or-sets. In PODS 93,Washington, D. C., May 1993, pages 37–48. Full paper available as UPenn Technical Report MS-CIS-92–88.

    Google Scholar 

  18. L. Libkin and L. Wong. Query languages for bags, Technical Report MSCIS-93–36, University of Pennsylvania, 1993.

    Google Scholar 

  19. L. Libkin and L. Wong. Aggregate functions, conservative extension, and linear orders. This volume.

    Google Scholar 

  20. E. Moggi. Notions of computation and monads. Information and Computation, 93: 55–92, 1991.

    Article  MathSciNet  MATH  Google Scholar 

  21. I. S. Mumick and O. Shmueli, How expressive is stratified aggregation, submitted.

    Google Scholar 

  22. P. Odifreddi. Classical Recursion Theory. North Holland, 1989.

    Google Scholar 

  23. A. Ohori, P. Buneman, and V. Breazu-Tannen. Database programming in Machiavelli: a polymorphic language with static type inference. In SIGMOD 89,pages 46–57.

    Google Scholar 

  24. G. Ozsoyoglu, Z. M. Ozsoyoglu, and V. Matos. Extending relational algebra and relational calculus with set-valued attributes and aggregate functions. ACM TODS, 12 (4): 566–592, 1987.

    Article  MathSciNet  Google Scholar 

  25. J. Paredaens and D. Van Gucht. Converting nested relational algebra expressions into flat algebra expressions. ACM Transaction on Database Systems, 17 (1): 65–93, 1992.

    Article  Google Scholar 

  26. H. E. Rose. Subrecursion: Functions and Hierarchies. Clarendon Press, Oxford, 1984.

    MATH  Google Scholar 

  27. Y. Saraiya, Fixpoints and optimizations in a language based on structural recursion on sets, Manuscript, December 1992.

    Google Scholar 

  28. S. Vickers. Geometric theories and databases. In P. Johnstone and A. Pitts, editors, Applications of Categories in Computer Science, volume 177 of London Mathematical Society Lecture Notes, pages 288–314. Cambridge University Press, 1992.

    Google Scholar 

  29. P. Wadler. Comprehending monads. In Proceedings of ACM Conference on Lisp and Functional Programming, Nice, June 1990.

    Google Scholar 

  30. L. Wong. Normal forms and conservative properties for query languages over collection types. In PODS 93,pages 26–36, Washington, D. C., May 1993. Full paper available as UPenn Technical Report MS-CIS-92–59.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 1994 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Libkin, L., Wong, L. (1994). Some Properties of Query Languages for Bags. In: Beeri, C., Ohori, A., Shasha, D.E. (eds) Database Programming Languages (DBPL-4). Workshops in Computing. Springer, London. https://doi.org/10.1007/978-1-4471-3564-7_7

Download citation

  • DOI: https://doi.org/10.1007/978-1-4471-3564-7_7

  • Publisher Name: Springer, London

  • Print ISBN: 978-3-540-19853-6

  • Online ISBN: 978-1-4471-3564-7

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics