TERMINOLOGY
Identity of objects is established by the Objectivity ID-tuple,
as opposed to any part of the object's value. That is to say,
two distinct objects may have the same catalog id, or even
identical values (in principle, at least).
predicate:
- A single character string containing a C-style expression that
can be parsed without error by the Objectivity Query
Processor. A predicate always refers to the object model from
the perspective of a particular class or type of object.
Therefore a predicate must always be explicitly paired with a
type name.
set of objects:
- An unordered list of objects of the same type in which each
object is distinct from all the others. The type is an
implicit attribute of the set.
bag of objects:
- An unordered list of objects of the same type in which each
object is not necessarily distinct from all the others. The
type is an implicit attribute of the bag.
Scoped Query (SQ):
- A predicate applied to each object of the given type, within
the scope of some list of containers or databases, or the
entire federation. The result of a scoped query is a set of
objects.
- functionally: set = SQ(predicate,typename,nodelist)
Bag Query (BQ):
- A predicate applied to each object in the given bag of
objects. The result of a bag query is a new bag of the same
type, containing a subset of the input bag. When distinct
is specified duplicates are eliminated efficiently.
- functionally: bag = BQ(predicate,bag,[distinct])
Association Query (AQ):
- A predicate applied to each object in the bag implied by the
given association name and the given bag of objects having
that association. The result of an association query is a new
bag with the type of the associated objects. When distinct
is specified the result is a set.
- functionally: bag = AQ(predicate,association,bag,[distinct])
EXECUTION TREE
An execution tree is a tree of queries and set operators, with
each node having no more than two children. The leaf nodes of
the tree are always Scoped Queries. Bags generated at the leaf
nodes propagate upwards through a succession of Bag Queries,
Association Queries, and set operations, until one bag remains
at the top of the tree.
The following set operators are supported. It is an error to
attempt to combine bags of different type using the set operators.
OQL_union:
- The output bag contains all of the objects from both input
bags. Duplicates are not removed.
- example: {a,c,b,c} = {a,c} OQL_union {b,c}
OQL_intersect:
- The output bag contains only the objects that are identical
between the two input bags. The minimum number of duplicates
is preserved.
- example: {c,c} = {a,c,c} OQL_intersect {b,c,c,c}
OQL_except:
- The output bag contains what remains of the first input bag
when the contents of the second input bag are removed from it.
One duplicate from the first bag is removed for each duplicate
found in the second bag.
- example: {a,c} = {a,c,c} OQL_except {b,c}
union:
- The output bag contains all of the distinct objects from both
input bags.
- example: {a,b,c} = {a,c} union {b,c}
intersect:
- The output bag contains only the distinct objects that are
identical between the two input bags.
- example: {c} = {a,c,c} intersect {b,c,c,c}
except:
- The output bag contains what distinct objects remain in the
first input bag when the contents of the second input bag are
removed from it.
- example: {a} = {a,c,c} except {b,c}
distinct:
- The output set contains the distinct objects from the input
bag.
- example: {a,b,c} = distinct {a,b,b,c,c,c}