Metamodel Concepts
A metamodel is described as a set of ontologies, which can contain ElementClasses and References.
An Ontology groups the concepts of your metamodel and can be referenced by other metamodel. elements is the classic metamodel which contains ElementClasses such as Component, DataElement, TaskElement etc.
ElementClass
An ElementClass is used to design what the elements you will be modelling will look like. The ElementClass can declare Attributes, properties with simple data types. Between ElementClasses you can have References, which always have an owner and a target.
To make it more concrete, let's start with an example Ontology to model data charts. To model this we need an ElementClass with an Attribute. We also need to define a DataType to be able to represent Text values.
Example of a DataChart ElementClass
Each ElementClass is also assigned a role. This role will define the behaviour of the element in the model.
Role | Description | Expandable | Example |
---|---|---|---|
element | Basic Element that can be expanded. | x | DataElement |
node | Part of another Element. | Field | |
data | Data that will provided as a DataResource. Usually static Data, such as types. | LinkFieldType | |
module | An Element that groups other Elements into a reusable Module. | x | Component |
program | An Element that acts as the root of the expansion. | x | Application |
These roles are used to create a separate Metamodel.
References
A Reference is used to define a relationship between 2 ElementClasses.
In our example we could introduce a link from DataChart
to a new ElementClass DataChartType
.
Example of a Reference
A Reference has an associationType, which describes some properties of the relationship:
AssociationType | Description | Opposite | Example |
---|---|---|---|
association | Regular one-directional reference | not supported | TaskElement::targetElement (references DataElement) |
composition | Defines the target as part of a whole (the owner ) | optional | Component::dataElements |
aggregation | The target exists on its own, but can be aggregated into the owner | not supported | Application::components |
extension | Defines the owner as an extension of the target . Used to extend another Ontology | not possible | Any extension to elements, such as MessageProcessor::component to attach it to Component |
Composition
A composition Reference allows you to define a hierarchy of elements. We can also add an OppositeReference to name the reverse link.
Example of a Composition
<dataChart>
<title>Starship Data Chart</title>
<filters>
<dataChartFilter name="filterByType"/>
<dataChartFilter name="filterByLocation"/>
</filters>
</dataChart>
Extension
To extend another Ontology, we need to link our new ElementClasses to one of the ElementClasses of the other Ontology. This can be done by defining a Reference with associationType extension.