## Some Properties of Query Languages for Bags (1993)

### Cached

### Download Links

- [ftp.cis.upenn.edu]
- [homepages.inf.ed.ac.uk]
- [ftp.cis.upenn.edu]
- DBLP

### Other Repositories/Bibliography

Venue: | IN PROCEEDINGS OF 4TH INTERNATIONAL WORKSHOP ON DATABASE PROGRAMMING LANGUAGES |

Citations: | 39 - 26 self |

### BibTeX

@INPROCEEDINGS{Libkin93someproperties,

author = {Leonid Libkin and Limsoon Wong},

title = {Some Properties of Query Languages for Bags},

booktitle = {IN PROCEEDINGS OF 4TH INTERNATIONAL WORKSHOP ON DATABASE PROGRAMMING LANGUAGES},

year = {1993},

pages = {97--114},

publisher = {Springer Verlag}

}

### Years of Citing Articles

### OpenURL

### 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...

### Citations

766 | Notions of computation and monads
- Moggi
- 1991
(Show Context)
Citation Context ...d the \select average of column" construct of SQL can be better explained if bags instead of sets are used. In an earlier paper [5], Breazu-Tannen, Buneman, and Wong dened a language based on monads =-=[20, 29]-=- and structural recursion [3] for querying sets. In section 2 of this report, the same syntax is given a bag-theoretic semantics. We use this language as our ambient bag language Supported in part b... |

467 | Comprehending monads
- Wadler
- 1990
(Show Context)
Citation Context ...d the \select average of column" construct of SQL can be better explained if bags instead of sets are used. In an earlier paper [5], Breazu-Tannen, Buneman, and Wong dened a language based on monads =-=[20, 29]-=- and structural recursion [3] for querying sets. In section 2 of this report, the same syntax is given a bag-theoretic semantics. We use this language as our ambient bag language Supported in part b... |

355 |
Incomplete information in relational databases
- Imielinski, Jr
- 1984
(Show Context)
Citation Context ...section we use techniques of [17] to dene an ordering for bags. Even though the ordering appears somewhat awkward, we demonstrate an eective algorithm to test whether two bags are comparable. As in =-=[11, 6, 16]-=-, we assume that partiality can be expressed by means of a partial order on database objects. That is, a b expresses the fact that a is more partial than b or b is more informative than a. It was me... |

324 | Classical recursion theory
- Odifreddi
- 1989
(Show Context)
Citation Context ...heorem 6.4 also sheds some light on theorem 6.3 a). It is known that functions computable by a language that has an assignment statement and for n do S are precisely the primitive recursive functions =-=[22]-=-. It was also proved by Robinson and Gladstone that the primitive recursive functions are built from the initial functions by composition and iteration: f(n; ~x) = g (n) (~x), see [22]. Now we proved ... |

275 |
Semantics programming languages: Structures and techniques. Foundation of computing
- Gunter
- 1993
(Show Context)
Citation Context ...are given. For example, if base type is N ? whose values are natural numbers or null (?), the usual ordering is ? n for any n 2 N and any two distinct natural numbers are not comparable, see Gunter =-=[10]-=-. The ordering is then extended to pairs in the usual way. That is, (x; y) (x 0 ; y 0 ) i x 1 x 0 and y 2 y 0 . However, if one wants to extend the ordering to subsets of an ordered set, many p... |

250 | Structure and complexity of relational queries
- Chandra, Harel
- 1982
(Show Context)
Citation Context ...olynomials almost everywhere and hence can not have innitely many roots, without being zero almost everywhere. 2 It is well known that the traditional relational languages cannot express parity test =-=[7]-=-. By the result of [30], it cannot be expressed in NRL(eq). It follows from the theorem we just proved that it remains inexpressible even in the greatly enhanced NRL(N;; ;+; : ; q) and hence not exp... |

146 |
Equivalence of relational algebra and relational calculus query languages having aggregate functions
- KLUG
- 1982
(Show Context)
Citation Context ...ation of the relative strength between the basic bag language and the relational language of BreazuTannen, Buneman, and Wong: NRL(N; P ; ; : ; q) ' BQL and NRL(eq) = SET (unique; eq b ; empty). Klug =-=[15]-=- and Ozsoyoglu, Ozsoyoglu, and Matos [24] had to introduce aggregate functions by repeating them for every column position of a relation. That is, aggregate 1 is for column one, aggregate 2 is for col... |

131 | Naturally embedded query languages
- BREAZU-TANNEN, BUNEMAN, et al.
- 1992
(Show Context)
Citation Context ...e underlying data model. For example, the \select distinct" construct and the \select average of column" construct of SQL can be better explained if bags instead of sets are used. In an earlier paper =-=[5]-=-, Breazu-Tannen, Buneman, and Wong dened a language based on monads [20, 29] and structural recursion [3] for querying sets. In section 2 of this report, the same syntax is given a bag-theoretic sema... |

123 | On the Power of Languages for the Manipulation of Complex Objects
- Abiteboul, Beeri
- 1988
(Show Context)
Citation Context ...striction on structural recursion [5]. The language so restricted has several equivalent formulations, one of them being NRC [5, 30]. This language is equivalent to the algebra of Abiteboul and Beeri =-=[1]-=- without the powerset operator. Then Wong [30] proved that the language has the conservative extension property at all input/output heights. That is, the expressive power of the language is independen... |

108 | Structural recursion as a query language
- BREAZU-TANNEN, BUNEMAN, et al.
- 1991
(Show Context)
Citation Context ...onstruct of SQL can be better explained if bags instead of sets are used. In an earlier paper [5], Breazu-Tannen, Buneman, and Wong dened a language based on monads [20, 29] and structural recursion =-=[3]-=- for querying sets. In section 2 of this report, the same syntax is given a bag-theoretic semantics. We use this language as our ambient bag language Supported in part by NSF Grant IRI-90-04137 and ... |

90 | Database Programming in Machiavelli – a Polymorphic Language with Static Type Inference
- Ohori, Buneman, et al.
- 1989
(Show Context)
Citation Context ... in it while a set is not. Finally, b are base types to be specied. Expressions. The expressions of NBA and NBC are given insgure 1. The type superscripts are usually omitted as they can be inferred =-=[13, 23]-=-. The semantics of these constructs is similar to the semantics of NRL except duplicates are not eliminated. Semantics of NBA constructs is as follows. Kc is the constant function that produces the co... |

73 |
Extending relational algebra and relational calculus with set-valued attributes and aggregate functions
- Ozsoyoglu, Ozsoyoglu, et al.
- 1987
(Show Context)
Citation Context ...e basic bag language and the relational language of BreazuTannen, Buneman, and Wong: NRL(N; P ; ; : ; q) ' BQL and NRL(eq) = SET (unique; eq b ; empty). Klug [15] and Ozsoyoglu, Ozsoyoglu, and Matos =-=[24]-=- had to introduce aggregate functions by repeating them for every column position of a relation. That is, aggregate 1 is for column one, aggregate 2 is for column two, etc. Klausner and Goodman used a... |

67 | Logical and computational aspects of programming with sets/bags/lists
- Breazu-Tannen, Subrahmanyam
- 1991
(Show Context)
Citation Context ... dened using the construct e : t i : s t! t b sri(i; e) : fjsjg ! t It is required that i satisfy the commutativity precondition: i(a; i(b;X)) = i(b; i(a;X)), which can not be automatically veried =-=[4]-=-. Its semantics is similar to the semantics of s sri . We want to show that it is strictly stronger than powerbag . Theorem 6.2 BQL(powerbag) $ BQL(b sri). Proof sketch. First, powerbag can be express... |

66 | Using powerdomains to generalize relational databases
- Buneman, Jung, et al.
- 1991
(Show Context)
Citation Context ... and bag languages. In this section we study another important problem where sets and bags dier considerably, that is, semantics of partial information. We follow the idea of Buneman, Jung and Ohori =-=[6]-=- and Libkin [16], where databases were considered as subsets of certain partially ordered sets in order to provide rigorous mathematical treatment of partial information. The intuitive meaning of the ... |

62 |
Subrecursion: functions and hierarchies
- Rose
- 1984
(Show Context)
Citation Context ...over, we prove that structural recursion gives us all primitive recursive functions. There are several conjectures we have not yet proved. Does adding gen give us precisely lower elementary functions =-=[26]-=-? Are functions such as testing whether a graph is a tree or testing connectivity or transitive closure expressible in the set language equivalent to BQL? What is the expressive power of this set lang... |

58 | Towards tractable algebras for bags
- Grumbach, Milo
(Show Context)
Citation Context ...ed relational language of [5]. Furthermore, if equality at all types is available, then the former strictly includes the latter. Grumbach and Milo also examined the relationship between sets and bags =-=[9]-=-. However they considered set functions on relations whose height of set nesting is at most 2. No such limit is imposed in this report. The relationship between sets and bags can be examined from a di... |

57 | Normal forms and conservative properties for query languages over collection types
- Wong
- 1993
(Show Context)
Citation Context ...avoided the need of checking preconditions by placing a simple syntactic restriction on structural recursion [5]. The language so restricted has several equivalent formulations, one of them being NRC =-=[5, 30]-=-. This language is equivalent to the algebra of Abiteboul and Beeri [1] without the powerset operator. Then Wong [30] proved that the language has the conservative extension property at all input/outp... |

49 | ML with extended pattern matching and subtypes
- Jategaonkar, Mitchell
- 1988
(Show Context)
Citation Context ... in it while a set is not. Finally, b are base types to be specied. Expressions. The expressions of NBA and NBC are given insgure 1. The type superscripts are usually omitted as they can be inferred =-=[13, 23]-=-. The semantics of these constructs is similar to the semantics of NRL except duplicates are not eliminated. Semantics of NBA constructs is as follows. Kc is the constant function that produces the co... |

44 |
Algebraic properties of bag data types
- Albert
(Show Context)
Citation Context ...bject oriented databases [8]. The primitive monus which subtracts one bag from another is proved to be the strongest amongst the remaining primitives. This result was independently obtained by Albert =-=[2]-=-. However, his investigation on relative strength is not as complete as this report. As a consequence, we regard the ambient language augmented with monus and unique as our basic bag language. This la... |

33 | Semantic representations and query languages for or-sets
- Libkin, Wong
- 1993
(Show Context)
Citation Context ...ithmetic operators conservativity can be extended uniformly to all input/output heights for languages augmented with boundedsxpoint operator, transitive closure, powerset and many other operators. In =-=[17]-=- Libkin and Wong extended the use of the language NRC for querying or-sets. Grumbach and Milo [9] applied the algebra of Abiteboul and Beeri to bags. In particular, they investigated the relationship ... |

30 | Converting nested relational algebra expressions into algebra expressions - Paredaens, Gucht - 1992 |

29 | Aggregate functions, conservative extension, and linear orders. This volume
- Libkin, Wong
(Show Context)
Citation Context ...e conservative extension property at all input/output heights. That is, the expressive power of the language is independent of the height of set nesting in the intermediate data. Then Libkin and Wong =-=[19]-=- showed that in the presence of very simple arithmetic operators conservativity can be extended uniformly to all input/output heights for languages augmented with boundedsxpoint operator, transitive c... |

28 | The Expressiveness of a Family of Finite Set Languages - Immerman, Patnaik, et al. - 1991 |

19 | A relational algebra for complex objects based on partial information
- Libkin
- 1991
(Show Context)
Citation Context ... on bags are more powerful than their set analogs, andsnd the primitive that preciselyslls the gap. Finally, in section 7, we show how to extend the approach of Buneman, Jung and Ohori [6] and Libkin =-=[16]-=- that uses certain partial orders to give semantics of databases with partial information to bags. We extend the idea of Libkin and Wong [18] of dening an ordering whose meaning is \being more partia... |

19 | Geometric theories and databases
- Vickers
- 1992
(Show Context)
Citation Context ...r of bag languages with respect to the level of bag nesting. The basic bag language proposed in this report (BQL) is precisely the language of Grumbach and Milo without the powerbag operator. Vickers =-=[28]-=- studied renements of bags which are a more general concept than the ordering we introduce in this paper. In particular, our ordering can be expressed as a renement, but there exist certain renemen... |

17 |
The expressive power of structured values in pure OODB's
- Bussche, Paredaens
(Show Context)
Citation Context ...ch eliminates duplicates from a bag is shown to be independent of the other primitives. A similar result was obtained by Van den Bussche and Paredaens in the setting of pure object oriented databases =-=[8]-=-. The primitive monus which subtracts one bag from another is proved to be the strongest amongst the remaining primitives. This result was independently obtained by Albert [2]. However, his investigat... |

14 | Multirelations: semantics and languages
- Klausner, Goodman
(Show Context)
Citation Context ...on. That is, aggregate 1 is for column one, aggregate 2 is for column two, etc. Klausner and Goodman used a notion of hiding to explain the nature of aggregate functions in relational query languages =-=[14]-=-. In addition to projections, they introduced hiding operators that \hide" columns of a relation. Aggregate functions are then applied to the column that is left exposed. Hiding is dierent from proje... |

7 | Query languages for bags - Libkin, Wong - 1993 |

4 |
Fixpoints and optimizations in a language based on structural recursion on sets
- Saraiya
- 1992
(Show Context)
Citation Context ...ve power of Datalog under set and bag semantics was compared in [21]. In particular, an example of query was given that can not be expressed under the former but can be expressed under the latter. In =-=[27]-=- Saraiya shows that Datalog can be simulated with structural recursion on sets, preserving the PTIME complexity, by using as an intermediate step the loop operator described in section 6.2, and provin... |

2 |
The expressiveness of a family of set languages
- Immerman, Patnaik, et al.
- 1991
(Show Context)
Citation Context ... : : : N ! N denable in BQL(powerbag) coincides with the class of Kalmar-elementary functions. 2 Similar results for other languages for bags or sets with built-in natural numbers were proved in =-=[9, 12]-=-. 6.2 Bounded loop and structural recursion As mentioned earlier, powerbag is not a good primitive for increasing the power of the language. It is not polynomial time and compels a programmer to use c... |

1 | How expressive is stratified aggregation, submitted - Mumick, Shmueli |

1 |
How expressive if strati aggregation, submitted
- Mumick, Shmueli
(Show Context)
Citation Context ...e exist certain renements of bags which lead to counterintuitive results when applied in the study of partial information. The expressive power of Datalog under set and bag semantics was compared in =-=[21]-=-. In particular, an example of query was given that can not be expressed under the former but can be expressed under the latter. In [27] Saraiya shows that Datalog can be simulated with structural rec... |