Advanced associations
We use the term
advanced association for
n-ary associations, association-classes, and n-ary association-classes.
All such associations are created via RAAPI function
createAdvancedAssociation(String name, boolean nAry, boolean associationClass)
An advanced association behaves likes a class (although it might not be a class internally)
with n bidirectional associations attached to it. To specify all n association ends,
call
createAssociation
n times,
where a reference to the n-ary association has to be passed instead of one of the class references.
N-ary association links can be created by means of
createObject
,
and n-ary link ends can be created by calling
createLink
n times and passing a reference to the n-ary link instead of one of the object references.
LyX Document
On Meta-Levels
You may wish to read more on models at
http://webappos.org/theory/models.
Linguistic vs. Ontological Metamodelling
Atkinson and Kühne [
2,
6,
5] noticed that actually there are two variants of the ``instance of'' relation: ``linguistic instance of'' and ``ontological instance of''. Thus, meta-levels can also be linguistic and ontological. To see the difference between these two types of meta-levels, refer to Figure
#. Figure
#(a) is an example of UML Four-level Metamodel Hierarchy [
#bib_uml_infrastructure]. Although Level M0 (a level of real world objects) lies outside MOF TS, it is depicted for informative purposes. ECore is a possible meta-metamodel for Level M3 (only a small part of it is depicted in Figure
#(a)). Level M2 contains a UML-like metamodel described in ECore. For this example it is essential that the M2 Level metamodel is able to describe both classes and objects, see classes
Class and
Object. Level M1 contains a sample model, which conforms to the UML-like metamodel from Level M2.
All the three levels (M1-M3) are
linguistic meta-levels, since the meta-metamodel from Level M3 can be considered a language for specifying metamodels at Level M2, and each metamodel from M2 can be considered a language for specifying models at M1. However, if we look at Level M1 more narrowly, we can see that it can be split into two levels, where UML-style objects occupy one level, and UML-style classes occupy another level (Figure
#(b)). The borderline is defined by the ``type'' relation from Level M2. These new levels are called
ontological meta-levels. They are denoted
and
in Figure
#(b), while linguistic meta-levels (M1-M3) have been renamed to
and
The pivot indices
and
have been introduced here to be independent on any particular absolute numbering. For the purposes of this thesis, only relative arrangement of (both linguistic and ontological) meta-levels will matter.
Figure
#(c) adds one more ontological meta-level
by introducing the
MetaClass concept at
. However, in order to express the six-meta-level example by D. Hofstadter, we must add at least three more meta-classes at
(in order the total number of ontological meta-levels become six). Figure
#(d) shows that instead of introducing meta-class(es), multiple ontological levels can be described by means of the ``type'' relation from
Class to
Class at
. This relation can be used as many times as needed, thus, creating a chain of ontological meta-levels as in the example by D. Hofstadter (the ``lowest'' meta-level can be linked to the chain by the ``type'' relation between
Object and
Class).
In Figure
#(d),
Class can also be made a subclass of
Object at
(Atkinson and [
1] introduce the term ``clabjects'' [from class+object] for such classes). In this case, the ``type'' relation between
Object and
Class is not needed any more, since its role is played by the ``type'' relation from
Class to
Class.
In some cases ontological meta-levels can be mixed. In Figure
#, a class
Person has been added. A person can be linked to a dog by means of the ``owner'' relation defined at Level
. A person can also be linked to a breed by means of the ``favourite breed'' relation, which crosses levels
and
. Having a particular person
Peter at
, we can see that the ``owner'' link lies in the same
level, while the ``favourite breed'' link crosses two levels
and
.
The theory behind the ``instance of'' relation goes even further. , Kaviani, and Hatala show that the (ontological) ``instance of'' relation can be inferred from the two other relations. They suggest to treat each class as consisting of two parts: intentional and extensional [
3]. Intentional part specifies common features of objects (e.g., ``has long hair'') and is used for building abstractions; the relation between elements and the intentional part is called ``conformant to''. Extensional part represents a class as a set, to which certain elements (objects) belong; the relation between elements and the extensional part is called ``element of''. For the purposes of this thesis I do not need the ``conformant to'' and ``element of'' relations. Still, I will need both variants (linguistic and ontological) of the ``instance of'' relation.
On the one hand, multiple ontological meta-levels and (usually) the three linguistic meta-levels give power to describe and organize models. On the other hand, it appears that it is difficult for a human to concentrate at more than two meta-levels at a time. While working on a generator for higher order model transformations, where multiple meta-levels are involved, A. Šostaks came to the following conclusion (I call it
Šostaks' conjecture):
It is difficult for a human to think at more than two meta-levels at a time. Still, it is fairly easy for a human to focus on any two adjacent meta-levels.
One of the arguments in favour of this conjecture is as follows. Students learning Java can work with classes and objects easily (two meta-levels are used). Java is an object-oriented language, and it has the
Object class, which is a common superclass for all other classes — an easy-to-understand OOP construction. At the same time, Java has the reflection mechanism, which permits considering Java classes as objects. The class named
Class has been introduced for that. Actually, it is a meta-class (i.e., it brings an additional meta-level to Java), but represented as an ordinary Java class. At this point students encounter difficulties, since three meta-levels are involved.
Certain RDF/OWL meta-levels can be considered either linguistic, or ontological. In Table
table:technical_spaces, RDF can be considered as spanning three linguistic meta-levels: the RDFS level (M3), the RDF vocabulary level (M2), and the RDF individuals level (M1). Still, RDFS permits breaking this level hierarchy, since classes may be individuals at the same time. RDFS also allows meta-levels to be mixed (as in Figure
#). The same refers to OWL Full and OWL 2 with RDFS semantics. Thus, we can think of RDF/OWL TS as occupying only two linguistic meta-levels:
containing RDFS/OWL Full definition, and
containing the pool of ontological classes and instances (
conforms to
). In this case,
consists of two or more ontological meta-levels, which can be mixed. To deal with different interpretations of meta-levels (whether the given level is linguistic or ontological), I introduce quasi-meta-levels in Section
# of this thesis.
Organizing Meta-Levels into Quasi-Meta-Levels
Models are usually organized in multiple meta-levels. To deal with numerous meta-levels in a common way, we organize meta-levels into two groups. The first group will contain the fixed (and, thus, read-only) linguistic meta-metamodel (at Level M3) of some technical space. The second group will contain all other meta-levels that are possible in that technical space. The meta-levels from the second group are not fixed.
I call these two groups
the quasi-linguistic meta-level M3 and
the quasi-linguistic meta-level M, respectively. The quasi-linguistic level M3 is fixed. In most cases, it will contain the linguistic meta-metamodel of some technical space (hence, the name ``M3''). The level M will contain all other meta-levels that are variable w.r.t. to M3 (either directly, or via other meta-levels). I call these variable levels
quasi-ontological meta-levels (in reality, they may be either linguistic, or ontological meta-levels; see below). Figure
# illustrates the organization of quasi-meta-levels. Figure
# is similar to meta-levels depicted in Figures
#(c) and (d) on page
elsewhere. The difference is that now we have exactly two quasi-linguistic meta-levels.
Such an organization of quasi-meta-levels has the following benefits:
- It separates the fixed part (M3) from the variable part. The fixed part does not need to be stored in a model repository. Model repositories from Table table:technical_spaces usually provide a means to store only the variable part, i.e., models lying at M.
- The three linguistic meta-levels (from the three-level conjecture) used by technical spaces can be easily re-organized as quasi-meta-levels as depicted in Figure #.
- Depending on a particular technical space, the meta-model at M3 can describe either M2 only (M2 then describes M1), or both M2 and M1 at the same time. Examples for the first case, where M2 and M1 are strictly separated, are EMOF, ECore, EBNF, and XML. Examples for the second case, where M2 and M1 co-operate, are the JR repository (which contains the meta-classes Class and Object directly at M3) and the OWL language, which can be used to describe ontologies containing classes and individuals at the same time (individuals may be required to specify certain OWL restrictions). Quasi-meta-levels are suitable for both cases.
- When a particular repository or technical space supports infinitely many meta-levels (e.g., JR or OWL Full), all these variable meta-levels can be considered quasi-ontological meta-levels. This ensures the same organization of meta-levels for OWL Full (that supports multiple ontological meta-levels) as well as for strict OWL variants, where classes (at M2) and individuals (at M1) are disjoint (Figure #).
RAAPI and Meta-Levels
The points below summarize the main characteristics of RAAPI regarding meta-levels.
- Every repository adapter (which implements RAAPI) has to support at least two quasi-ontological meta-levels: usually they are the levels M1 and M2 of the corresponding technical space. Additional supported meta-levels (not counting M3) become additional quasi-ontological meta-levels (as in the case of RDF and OWL Full).
- Switching between meta-levels can be performed by passing a reference to an element at one meta-level to an RAAPI function, which expects a reference to an element at another meta-level. For instance, a reference to a class may be passed to an RAAPI operation, which expects a reference to an object. This trick can also be used to mix multiple meta-levels (where the underlying repository supports that).
- Repository adapters are not required to provide access to M3, when implementing RAAPI operations. However, M3 may be useful, if there is a need to access technical-space-specific features that are defined at M3, but are not directly supported by RAAPI.
- If a repository adapter provides access to M3, it has to implement RAAPI functions in such a way that M3 behaves like a quasi-ontological instance of itself (see M3 in Figure #). This can be used to access M3 features that would not be accessible otherwise. For instance, RAAPI does not support EMOF-like operations in classes directly. Still, RAAPI can be used to access the meta-class EMOF::Operation at M3. By traversing quasi-ontological instances of this meta-class, operations found in EMOF itself can be discovered. To create/obtain operations for classes at M, linguistic instances of EMOF::Operation can be created/traversed.
The same approach can be used to support generics found in ECore since EMF 2.4.
- If a repository adapter provides access to M3, it is assumed that each element from M may have only one linguistic type at M3. This type cannot be dynamically changed.
References
1Colin Atkinson and Thomas Kühne, "Meta-level Independent Modelling", in International Workshop on Model Engineering at 14th European Conference on Object-Oriented Programming (, 2000).
2Atkinson, Colin and Kühne, Thomas, "Model-Driven Development: A Metamodeling Foundation", IEEE Software 20, 5 (2003), pp. 36--41.
3Gašević, Dragan and Kaviani, Nima and Hatala, Marek, "On Metamodeling in Megamodels", in Engels, Gregor and Opdyke, Bill and Schmidt, Douglas and Weil, Frank, ed., Model Driven Engineering Languages and Systems vol. 4735, (Springer Berlin / Heidelberg, 2007), pp. 91-105.
4Kozlovics, Sergejs, "The Orchestra of Multiple Model Repositories", in SOFSEM 2013: Theory and Practice of Computer Science vol. 7741, (Springer Berlin Heidelberg, 2013), pp. 503-514.
5Kühne, Thomas, "Clarifying matters of (meta-) modeling: an author's reply", Software and Systems Modeling 5 (2006), pp. 395-401.
6Kühne, Thomas, "Matters of (Meta-) Modeling", Software and Systems Modeling 5 (2006), pp. 369-385.