<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Multilevel Modelling with MultEcore A Contribution to the MULTI 2017 Challenge</article-title>
      </title-group>
      <contrib-group>
        <aff id="aff0">
          <label>0</label>
          <institution>Deparment of Computing, Mathematics and Physics Western Norway University of Applied Sciences P.</institution>
          <addr-line>O. Box 7030, 5020 Bergen</addr-line>
          ,
          <country country="NO">Norway</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Department of Informatics University of Oslo P.</institution>
          <addr-line>O. Box 1072 Blindern, 0316 Oslo</addr-line>
          ,
          <country country="NO">Norway</country>
        </aff>
        <aff id="aff2">
          <label>2</label>
          <institution>Fernando Macías</institution>
        </aff>
      </contrib-group>
      <abstract>
        <p>-In the context of MULTI 2017, and as a means of fostering discussion and test the limits of the paradigm, the Bicycle Challenge [1] was proposed to tackle the issue that multilevel modelling still lacks a strong conceptual basis, consensus and focus. This paper presents one solution to that challenge, i.e. creating a multilevel hierarchy that represents the domain of bicycles as products composed of different parts and with different features, starting from very abstract concepts (components with weight and basic parts) and ending with one particular model of bicycle with brand-specific parts, which in turn is instantiated by a specific bicycle. We analyse and “fix” the requirements, discuss them, and present our solution using the MultEcore tool.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>I. INTRODUCTION</title>
      <p>SM 1
supplementary</p>
      <p>typed
SM 2</p>
      <p>M1</p>
      <p>Mn-1</p>
      <p>M0
(fixed)
ontologically typed
ontologically typed
ontologically typed
ontologically typed</p>
      <p>Mn
(instance)</p>
      <p>
        The approach to deep metamodeling which we have used to
solve this challenge is implemented in the MultEcore tool [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ].
      </p>
      <p>
        This tool combines the best from the two worlds: fixed-level • A multilevel modelling stack that does not require
linmetamodelling with its mature tool ecosystem, and multilevel guistic metamodels, synthetic typing relations or
“flattenmodelling with an unlimited number of abstraction levels, ing” of the ontological stack.
potencies and multiple typing. Using our approach, model • A realization of linguistic extension that differs from
designers can seamlessly create a multilevel version of their other approaches and allows for several, independent
hierarchies while still keeping all the advantages they get from linguistic hierarchies (called supplementary hierarchies in
fixed-level ones. MultEcore facilitates multilevel modelling our approach), orthogonal to the ontological stack.
without leaving the EMF (Eclipse Modeling Framework [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ]) • Looser linguistic typing: while every element in every
world, and hence allowing reuse of existing EMF tools and model has an ontological type, it does not require a
plugins. The tool (and the solution to this challenge) is available linguistic type for each plugged linguistic metamodel.
for download from http://prosjekt.hib.no/ict/multecore/. • An extension of the two-level cascading approach that
      </p>
      <p>
        A multilevel model hierarchy in MultEcore is defined as aides the implementation of the framework as an extension
an ontological hierarchy of models with a fixed, common and of EMF which preserves full compatibility with its model
generic topmost metamodel. In other words, the ontological representations and tools, i.e. we make use of EMF native
hierarchy does not require a linguistic metamodel in order to APIs and formats, and keep the overload of the models
be consistent, as opposed to the clabject-based proposals such as transparent as possible.
as [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ], [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ]. Therefore, this hierarchy is similar to MOF, but does In the following sections we will show how we have designed
not restrict the number of new levels that the user can create. the bicycle model in the MultEcore tool, and argue for our
An overview of the conceptual framework behind MultEcore design decisions.
is displayed in Fig. 1. Note that since the ontological stack
can grow downwards an arbitrary number of levels, these are II. CASE ANALYSIS
indexed increasingly from the top. A detailed evaluation of our The considerations we took to complete the case description
design choices and formalisations can be found in [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ], [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ]. are:
      </p>
      <p>The differentiating aspects of our conceptual framework are • Not specifying a value for attributes is interpreted as that
summarised as follows: attribute being optional.
EReference</p>
      <p>EClass
1-1</p>
      <p>EClass</p>
      <p>1-1
• All the bicycles are “well-formed”. That is, the hierarchy</p>
      <p>does not allow bicycles with missing parts like a wheel.
• Unclear requirements that do not look suitable to be</p>
      <p>modelled are excluded.</p>
      <p>The fact that the frame number for bicycles is unique can
be specified higher up in the hierarchy but instantiated at the
level of one particular bicycle. Moreover, the classifications
defined in the description might be extended, adding even
more intermediate levels of abstraction before reaching the
actual, “final” instances, which represent individual bicycles.</p>
      <p>We have focused on the requirements and aspects which we
have extracted from the challenge description (see next section).</p>
    </sec>
    <sec id="sec-2">
      <title>III. MODEL DESIGN</title>
      <p>
        In this section, we present the multilevel hierarchy that
addresses the challenge. We have one subsection per level,
for the sake of clarity, starting from the top-most level 1. In
level 0 we locate Ecore, which is not displayed. However,
note that we will discuss the requirements sequentially as they
appear in the challenge description [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ], which causes changes
in previously defined levels. These cases will be pointed out
to avoid confusion.
      </p>
      <p>About the visual representations, it is important to mention
that the cardinality of the references is only displayed in case
it is different from 0..*, which is the default one, and the most
common and generic.</p>
      <sec id="sec-2-1">
        <title>A. Level 1 - Configuration</title>
        <p>
          The first configuration level resembles the traditional
objectoriented Composite pattern [
          <xref ref-type="bibr" rid="ref7">7</xref>
          ]. Hence, this model exploits
inheritance to achieve the pattern, as displayed in Fig. 2.
        </p>
        <p>Apart from the classes themselves, the description mentions
that components may have a weight and a minimum weight,
included as attributes. The minimum weight attribute has
potency 1–3, indicating that it can be instantiated directly in the
level immediately below, two levels below or three levels below
(levels L2, L3 and L4, respectively). This attempts to fulfil
the requirement that the knowledge about the domain must
be located as high as possible. In case we want to add more
levels to our hierarchy, we may need to update this potency
to a higher number. Also, the sentence “There is a difference
between the type of a component and its instances” seems to
clearly point out a separation between this level and the next
one.</p>
        <p>
          A hierarchy in MultEcore is tree-shaped and composed of
models with upwards typing relations among them (see [
          <xref ref-type="bibr" rid="ref6">6</xref>
          ]).
We have chosen the following concrete syntax in our tool. The
type of a node is indicated as a blue ellipse, e.g. EClass is
the type of Composite. The type of an arrow is written near
the arrow in italic font type, e.g. EReference. The names of
the nodes are used as labels in the class-like rectangles; italics
font means the node is abstract. The potency of each node is
written in a red rectangle on its top right corner. For arrows, it
is written after the arrow name separated by the @ character.
For attributes, the potency is written just before the attribute
name. The potencies in MultEcore have a range, having the
default “1–1”, which means that they only can be instantiated
directly at the next level below. This means that the tool does
not restrict whether an instance of a node with potency 1–1
is reinstantiated or not. With the same reasoning, a node with
potency 2–4 would mean that we can instantiate it directly at
2, 3 and 4 levels below, or a combination of those, or we may
not do so since instantiation is optional. This realisation also
keeps the potency of the instances independent of the potency
of their types, and it could be seamlessly combined with the
more traditional understanding of potency as depth (just by
adding a third value), i.e. how many times instances, instances
of instances, etc. can be created.
        </p>
        <p>The tool also provides a hierarchy view in which all the
models in a branch could be visualised as a modeling stack,
with typing relations between model elements at different levels
being visualised as dashed arrows.</p>
      </sec>
      <sec id="sec-2-2">
        <title>B. Level 2 - Bicycle</title>
        <p>The next level on the hierarchy contains the abstract
description of a bicycle and its parts (see Fig. 3). Most of the
requirements from the description are quite straightforward to
model. The most relevant design decision is giving cardinality
0..1 to purchasePrice , since some instances of it do not specify
it. It has a potency of 2–2 since there are still two levels to
instantiate it below. Also, the fact that both wheels must have
the same size has been solved by the attribute wheelSize in the
class Bicycle hence forcing all wheels to be of the same size.
This design decision can be replaced by the more complex (but
arguably more semantically adequate) solution of duplicating
the attribute in both wheels and creating a constraint that
ensures that they have the same value. See subsection III-G
for an example of a constraint.</p>
        <p>One remarkable usage of potency in this level is that all the
relations (except for wheels) are defined with potency 1–3 so
that they do not need to be redefined in the intermediate levels
while they can be directly instantiated in the lower levels. The
other interesting use of our range-like potency is for both color
attributes. We chose 1–4 for it since we believe it is a nice
example of flexibility, so that a colour can be specified at the
upper levels if that component is made with that colour, but we
allow for the lower instances to redefine it, so that a particular
bike can differ from its original colours.</p>
        <p>The fact that frames have a unique serial number can be
easily provided by exploiting Ecore’s ID feature.</p>
        <p>subc
Component</p>
        <p>1-1
subc fork@1-3
BasicPart 1-1
BasicPart
1-1</p>
        <p>RacingFrame
1-1</p>
        <p>RacingHandle</p>
        <p>1-1
RacingBike</p>
        <p>1-1
RacingFork
1-1</p>
        <p>FrontWheel
RearWheel
1-1
1-1</p>
        <p>wheels</p>
        <p>wheels
Wheel
1-1
1-1
1-1
Material</p>
        <p>Material</p>
      </sec>
      <sec id="sec-2-3">
        <title>C. Level 3 - Racing Bicycle</title>
        <p>This level simply instantiates some attributes previously
defined, and specifies new ones like the lengths of the different
tubes for the frame (see Fig. 4). The fact that some bicycles
are suitable to certain environments did not look suitable
for explicitly modelling, since maintaining a list of them is
cumbersome. At most, we consider that a simple string attribute
with the description could be added.</p>
      </sec>
      <sec id="sec-2-4">
        <title>D. Level 4 - Pro Racing Bicycle</title>
        <p>This level is quite simple, and just instantiates the attributes
previously defined (see Fig. 5). The most relevant feature is
the restriction on the material of the wheels: “A carbon frame
type allows for carbon or aluminium wheel types only”. This
requirement is addressed in section III-G.</p>
      </sec>
      <sec id="sec-2-5">
        <title>E. Level 5 - Challenger A2-XL</title>
        <p>The last level required by the description is a specific bicycle
model, where we can see the instantiation of three attributes,
weight (for both frame and bicycle) and salesPrice, defined
at higher levels (see Fig. 6). Since weight is defined at level
ProRacingFra...</p>
        <p>1-1</p>
        <p>ProRacingHa...</p>
        <p>1-1
frame@3</p>
        <p>ProRacingBike
prhandle@1-1
1-1
ProRacingFork
1-1
prfrontwheel@1-1</p>
        <p>PRFrontWheel
PRRearWheel
frontWheel@2
1-1
1-1
prrearwheel@1-1</p>
        <p>rearWheel@2
L1 together with minWeight, it is possible to also define a
cross-level constraint where we forbid an actual weight to be
less than the minimum weight. Specific instances of this model
will instantiate the frame serial ID which will differentiate
specific bicycles from each other.</p>
      </sec>
      <sec id="sec-2-6">
        <title>F. Level 6 - My Challenger</title>
        <p>The previous level defines a particular model of a bike, but
probably more than one bike of that model is available. If
the modeller wishes to represent this information, along with
some specific differences between this bike an the rest of the
Challenger A2-XL bikes, an instance of the previous model
can be specified, like the one we depict in Fig. 7.</p>
        <p>Here, the particular colours to which the bike was painted (or
re-painted) can be specified, as displayed in MyRocketFrame
and MyFork.</p>
      </sec>
      <sec id="sec-2-7">
        <title>G. Constraints</title>
        <p>Some of the features represented in the previous subsections
could have been addressed by means of (multilevel) constraints,
Rocket-A1-XL
1-1</p>
        <p>ChallengerHa...</p>
        <p>1-1
1-1
prhandle
ChallengerFork
prfork
1-1
prfrontwheel@1-1</p>
        <p>ChallengerFro...</p>
        <p>prfrontwheel
1-1
prrearwheel@1-1
prrearwheel</p>
        <p>ChallengerRe...</p>
        <p>1-1</p>
        <p>Implication</p>
        <p>1-1
i
Atomic</p>
        <p>1-1</p>
        <sec id="sec-2-7-1">
          <title>CarbonFrame has@1-1 has</title>
          <p>Element</p>
          <p>1-1</p>
          <p>F
material=carbon *Frame
right</p>
          <p>Not</p>
          <p>1-1
n
Atomic</p>
        </sec>
        <sec id="sec-2-7-2">
          <title>SteelWheel has@1-1</title>
          <p>Element</p>
          <p>W
material=steel
1-1
has
1-1
*Wheel</p>
          <p>
            multilevel constraint using a supplementary
using a language like the one we describe in [
            <xref ref-type="bibr" rid="ref6">6</xref>
            ]. We chose,
however, to create a hierarchy as simple and self-contained
as possible. Hence, the only constraint we create is specified
as an implication, in the following manner: A frame with
the attribute material=carbon implies that either the front
and rear wheels have also material=carbon or that they have
material=aluminium. This constraint uses a supplementary
hierarchy, as depicted in Fig. 1, in order to define double-typed
elements that relate the atomic propositions of the language of
boolean logic to actual elements in the ontological hierarchy
(called application hierarchy in our approach). Fig. 8 displays
the constraint, using the same notation as the previous diagrams,
but with two different colours to distinguish between the
application type (blue) and the supplementary type (green).
          </p>
        </sec>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>IV. EVALUATION</title>
      <p>The proposed multilevel modeling hierarchy ended up having
up to 7 abstraction levels L0, . . . , L6, where the L0 level is
the Ecore metamodel. The knowledge domain is at level L2,
just below the generic component model at level L1.</p>
      <p>The model at L2 can be used as a DSL, or as a starting
point for a software system which could be used by bicycle
retailers. This would imply that some of the potencies in L2,
e.g. the ones on purchasePrice, serial, etc., would be updated
so that these attributes could be instantiated at L3. Similarly,
the model at level L3 can be used as a DSL, or as a starting
point for a software system which could be used by racing
bicycle retailers. An ordinary bicycle model, which is specified
at level L3 as an instance of L2, would be in a sibling branch
of the metamodel Racing Bicycle in the model hierarchy.</p>
      <p>The Racing Bicycle specialised DSL or software could
further be refined and specialised to define a Pro Racing Bicycle
metamodel. This specialised DSL would disallow racing bicycle
and pro racing bicycle retailers from defining ordinary bicycles.
However, by changing the potency of the nodes at level L2 so
that the upper bound is *, we could relax on this restriction,
if this was desirable. Hence, although the refinement process
has given rise to more specialised DSLs for special kinds of
bicycle, e.g. pro racing bicycles, we could still choose to create
a DSL which enables usage of types from upper levels than
the Pro Racing Bicycle. That is, in our alternative solution
with relaxed potencies, a specific ordinary bicycle could be
specified at level L3, L4, L5 or L6 depending on which created
DSL one would like to use.</p>
      <p>
        In http://prosjekt.hib.no/ict/multecore/ we show how
Sirius [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ] could be used to create editors for a bicycle DSL
given by the metamodel at level L2. Indeed, editors could
be created for any of the models in the hierarchy. This also
demonstrates the strength of our approach in not leaving the
EMF world which makes it easy to create editors and other
artefacts. Moreover, from the .ecore version of the models
it is possible to use EMF’s native code generation facilities
and generate Java code, or write other templates to generate
custom code.
      </p>
      <p>
        In a few cases in this solution, we could have used
generalisation (i.e. inheritance) instead of specialisation (i.e.
typing). For example, the specialisation of the Racing Bicycle
into Pro Racing Bicycle could be replaced with inheritance
among the elements of both. However, we believe that the
usage of typing in this scenario allows for a more flexible
specification and separation of abstraction levels. As we argue
in [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ], our framework leaves this possibility open to the user.
      </p>
      <p>In our solution, it is not required to have associations between
different levels. In the case of cross-level constraints, we have
used multilevel constraints as shown in Fig. 8. These constraints
would be parsed and transformed to validators by customized
code-generators so that the created DSLs can enforce the
restrictions given by them.</p>
      <p>
        We have identified three of the requirements given by the
challenge description [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ], namely the domain knowledge is
specified at the highest possible level, the models could be
used as a foundation for a software system, and possibility to
define cross-level constraints.
      </p>
      <p>The main limitation of the approach lies in the fact that we
cannot automatically propagate changes done to higher level
models to lower level models. That is, if we change potencies
or add/delete model elements, the lower level models which
are depending on the potency or these elements might become
invalid models. Addressing this challenge is part of a bigger
development step in MultEcore which focuses on co-evolution
and model repair.</p>
    </sec>
    <sec id="sec-4">
      <title>V. CONCLUSIONS</title>
      <p>In this paper, we have presented a solution to the Bicycle
Challenge proposed at MULTI 2017 workshop. Our multilevel
modeling hierarchy ended up having up to 7 abstraction levels
where specific ordinary bicycles could be defined at the level
L3, and with some potency relaxation also on L4, L5 and L6.
However, specific pro racing bicycles could only be defined at
level L5 since these are instances of a more specific or refined
metamodel at L4. Our solution is based on the MultEcore tool
and follows a conceptual framework which enables EMF with
the potential of becoming a multilevel modelling framework.
This facilitates usage of the rich ecosystem of EMF such as
code generation and DSL editor creation.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <fpage>MULTI2017</fpage>
          .
          <article-title>(2017, Jul</article-title>
          .)
          <article-title>Bicycle Challenge description</article-title>
          . [Online]. Available: https://www.wi
          <article-title>-inf.uni-duisburg-essen</article-title>
          .de/MULTI2017/#challenge
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>F.</given-names>
            <surname>Macías</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Rutle</surname>
          </string-name>
          , and
          <string-name>
            <given-names>V.</given-names>
            <surname>Stolz</surname>
          </string-name>
          , “
          <article-title>MultEcore: Combining the best of fixedlevel and multilevel metamodelling,” in MULTI, ser</article-title>
          .
          <source>CEUR Workshop Proceedings</source>
          , vol.
          <volume>1722</volume>
          ,
          <year>2016</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>Eclipse</given-names>
            <surname>Modeling</surname>
          </string-name>
          <string-name>
            <surname>Framework</surname>
          </string-name>
          ,
          <article-title>Web site</article-title>
          . [Online]. Available: http: //www.eclipse.org/modeling/emf
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>C.</given-names>
            <surname>Atkinson</surname>
          </string-name>
          and
          <string-name>
            <given-names>R.</given-names>
            <surname>Gerbig</surname>
          </string-name>
          , “
          <article-title>Flexible deep modeling with Melanee,” in Modellierung 2016, ser</article-title>
          . LNI,
          <string-name>
            <given-names>S.</given-names>
            <surname>Betz</surname>
          </string-name>
          and U. Reimer, Eds., vol.
          <volume>255</volume>
          . Bonn: Gesellschaft für Informatik,
          <year>2016</year>
          , pp.
          <fpage>117</fpage>
          -
          <lpage>122</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <surname>J. de Lara</surname>
          </string-name>
          and E. Guerra, “
          <article-title>Deep meta-modelling with Metadepth,” in Objects, Models, Components, Patterns, ser</article-title>
          .
          <source>LNCS</source>
          , vol.
          <volume>6141</volume>
          . Springer, Jul.
          <year>2010</year>
          , pp.
          <fpage>1</fpage>
          -
          <lpage>20</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>F.</given-names>
            <surname>Macías</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Rutle</surname>
          </string-name>
          ,
          <string-name>
            <given-names>V.</given-names>
            <surname>Stolz</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Rodriguez-Echeverria</surname>
          </string-name>
          , and U. Wolter, “
          <article-title>Formalisation of flexible multilevel modelling</article-title>
          ,” Submitted, available at http:// prosjekt.hib.no/ ict/ multecore/ ,
          <year>2016</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>E.</given-names>
            <surname>Gamma</surname>
          </string-name>
          et al.,
          <article-title>Design Patterns: elements of reusable object-oriented software</article-title>
          .
          <source>Addison-Wesley</source>
          ,
          <year>1994</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>The</given-names>
            <surname>Eclipse</surname>
          </string-name>
          <string-name>
            <surname>Project</surname>
          </string-name>
          , “Eclipse Sirius,” Dec.
          <year>2016</year>
          . [Online]. Available: http://www.eclipse.org/sirius/
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>