|
Hosting Iterative Lang.
|
|
|
Hosting Iterative Language The syntax of CCUBE iterative queries, such as the one in the example, reminds ODMG OQL. However, a query may contain any number of interleaved FROM, WHERE, DEFINE and PERFORM clauses, in any order, provided that every query variable is bound in a FROM clause before it is used. Intuitively, a query may be viewed as a nested loop program, in which each FROM clause corresponds to iteration over a corresponding "collection" object, and each WHERE clause corresponds to checking a Boolean condition. The PERFORM statement allows for execution of any enclosed C++ statements, including for performing actions, such as printing, which is useful for debugging. In the WHERE clause, any C++ expression, possibly using bound query variables, may be used, provided it returns TRUE or FALSE. Similarly, the SELECT clause may contain an arbitrary C++ expression whose type corresponds to the type of the result (indicated after the word INTO). Finally, a PERFORM clause may also be used instead of the SELECT clause, which is useful, in particular, when more then one resulting collection or aggregation is being computed in the query. Manipulation of and Boolean conditions on CST objects, being implemented as a library of interrelated C++ classes, can be used in hosting iterative queries. The data model for iterative queries is based on the notion of the so called collection and primitive monoids. Collection monoid is a conceptual data type capturing uniformly collections and other types over which one can ``iterate''.
|
|
presentation created by Victor E. Segal |