Parent Package: archetype
Package am::archetype::constraint_model
The following statements summarise the main features of this package.
Any archetype definition is an instance of a C_COMPLEX_OBJECT, which can be thought of as expressing constraints on a object that is of some particular type (recorded in the attribute rm_type_name ) in a reference model, and which is larger than a simple instance of a primitive type such as String or Integer.
A C_COMPLEX_OBJECT consists of attributes of type C_ATTRIBUTE, which are constraints on the attributes (i.e. any property, including relationships) of the reference model type. Accordingly, each C_ATTRIBUTE records the name of the constrained attribute (in rm_attr_name), the existence and cardinality expressed by the constraint (depending on whether the attribute it constrains is a multiple or single relationship), and the constraint on the object to which this C_ATTRIBUTE refers via its children attribute (according to its reference model) in the form of further C_OBJECTs.
The key subtypes of C_OBJECT, are C_COMPLEX_OBJECT (described above) C_PRIMITIVE_OBJECT (constraints on instances of primitive types such as String, Integer, Boolean and Date).
The other subtypes of C_OBJECT, namely, ARCHETYPE_SLOT, ARCHETYPE_INTERNAL_REF and CONSTRAINT_REF are used to express, respectively, a `slot' where further archetypes can be used to continue describing constraints; a reference to a part of the current archetype that expresses exactly the same constraints needed at another point; and a reference to a constraint on a constraint defined in the archetype ontology, which in turn points to an external knowledge resource, such as a terminology.
All nodes in an archetype constraint structure are instances of the supertype ARCHETYPE_CONSTRAINT, which provides a number of important common features to all nodes.