We will attempt to make the semantics of the query language more precise by describing how it would be interpreted in an underlying representation of an OPM database in the relational model.
Suppose that C is an object class with single valued attributes
and set or list valued attributes
. For simplicity we will
assume that C is represented by m+1 relations: a relation C with
attributes _oid and
, and for each set-valued
attribute,
, a relation
with attributes _oid and
.
Note that, in practice, the representation of classes will be more complicated than this because of inheritance, and because of the presense of tuple attributes. However the relationships mentioned above could be formed as joins and projections on the actual relationships used to represent a class.
We assume a distinguished value Null which will be used to represent unbound variables.
A valid instantiation for a FROM statement is then an assignment of a value to each variable declared in the FROM statement such that:
or
;
[ C], where
is a single-valued
attribute, then
;
[ C], where
is a set-valued
attribute, then either
or
; and
then either the FROM statement contains a
declaration of the form Y IN X.
[ C] where
or
,
or the FROM statement
contains a declaration Y IN X.
[ C] where
or
.
Example. Suppose we had an object class
OBJECT CLASS Person
ATTRIBUTE name: [0,1] String
ATTRIBUTE children: set-of [0,] String
and in an instance the class was represented by the table
Person:

and the table Person
:

and that a query has the FROM statement
FROM X IN Person, Y IN X.name, Z IN X.childrenThen the valid instantiations of X, Y and Z are given by:
