Folk,
Thanks to NORMA, I present a metamodel for ORM2 diagrams as an extension of the ActiveFacts metamodel. This diagram is also available in the Files section under "Open Source Models".
Note some items relevant to this model being used with AdtiveFacts, rather than ORM2 in general:
- Where NORMA uses the word "model" or "schema", ActiveFacts uses "Vocabulary".
- This metamodel has been added to the "next" or upcomingversion of the metamodel, where object type is called ObjectType, not the current version, where they're called "Concept".
- The constraint shape subtypes that are shown are shown because their position is relative to something they're attached to, not to the diagram origin.
- The closest thing that ActiveFacts has to a Model Note is its Context Notes, hence the naming mismatch.
The CQL text for this model fragment follows:
DisplayRoleNamesSetting is written as String restricted to {'false', 'true'};
RotationSetting is written as String restricted to {'left', 'right'};
X is written as Integer(32);
Y is written as Integer(32);
Position is identified by X and Y where
Position is at one X,
Position is at one Y;
Diagram is identified by Vocabulary and Name where
Diagram is for one Vocabulary,
Vocabulary contains Diagram,
Diagram is called one Name,
Name is of Diagram;
Shape is identified by Diagram and Position where
Shape is in one Diagram,
Diagram includes Shape,
Shape is at at most one Position;
Shape is expanded;
ConstraintShape is a kind of Shape;
ConstraintShape is for one Constraint;
FactTypeShape is a kind of Shape;
FactTypeShape has at most one DisplayRoleNamesSetting;
FactTypeShape is for one FactType,
FactType has FactTypeShape;
FactTypeShape has at most one RotationSetting;
FrequencyConstraintShape is a kind of ConstraintShape;
ModelNoteShape is a kind of Shape;
ModelNoteShape is for one ContextNote;
ObjectTypeShape is a kind of Shape;
ObjectTypeShape is for one ObjectType,
ObjectType has ObjectTypeShape;
ObjectTypeShape has expanded reference mode;
ObjectifiedFactTypeNameShape is a kind of Shape identified by FactTypeShape where
ObjectifiedFactTypeNameShape is for one FactTypeShape,
FactTypeShape has at most one ObjectifiedFactTypeNameShape;
ReadingShape is a kind of Shape identified by FactTypeShape where
FactTypeShape has at most one ReadingShape,
ReadingShape is for one FactTypeShape;
ReadingShape is for one Reading,
Reading has ReadingShape;
RingConstraintShape is a kind of ConstraintShape;
RingConstraintShape is attached to one FactType;
RoleDisplay is where
FactTypeShape displays Role in Ordinal position;
RoleDisplay has FrequencyConstraintShape,
FrequencyConstraintShape is for one RoleDisplay;
RoleNameShape is a kind of Shape;
RoleNameShape is for one Role;
ValueConstraintShape is a kind of ConstraintShape;
RoleDisplay has at most one ValueConstraintShape,
ValueConstraintShape is for at most one RoleDisplay;
ValueConstraintShape is for at most one ObjectTypeShape,
ObjectTypeShape has ValueConstraintShape;
ValueType has at most one ValueConstraint,
ValueConstraint constrains ValueType;
either ValueConstraintShape is for ObjectTypeShape or ValueConstraintShape is for RoleDisplay but not both;
each combination FactTypeShape, Ordinal occurs at most one time in
FactTypeShape displays Role in Ordinal position;