<!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>Extracting Correspondences from Metamodels Using Metamodel Matching</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Meta-</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Department of Informatics, King's College London</institution>
          ,
          <addr-line>London</addr-line>
          ,
          <country country="UK">UK</country>
        </aff>
      </contrib-group>
      <fpage>3</fpage>
      <lpage>8</lpage>
      <abstract>
        <p>In Model-Driven Engineering (MDE), metamodels de ne the structure of software models such as Petri Nets. This paper proposes a new approach to extract correspondences from metamodels, in order to automatically derive transformations on models. We present the approach on an example of two versions of metamodels for Petri Nets, and evaluate it on benchmark examples of metamodel matching.</p>
      </abstract>
      <kwd-group>
        <kwd>Model-Driven Engineering Model Transformation model Matching</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction</title>
      <p>
        A few tools have been created for the synthesis of model transformations from
metamodels. AML [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] requires a user to specify metamodelling matching
strategies, but this needs high knowledge of metamodelling. Only ATL transformations
(a) version 0
(b) version 3
are produced. COPE [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ] supports metamodel-speci c migrations. However, for
complex metamodel matching, they still need developers to manually match
metamodels.
      </p>
      <p>
        For similarity measures we considered several di erent alternatives: Graph
structural similarity (GSS) tests if two classes have similar graph structure
metrics [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ] in the di erent metamodels. Graph edit similarity (GES) evaluates the
graph edit distance of the reachability graphs of 2 classes in the 2
metamodels [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ]. Name syntactic similarity (NSS) measures the string edit distances [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ]
of the names of two classes. Name semantic similarity (NMS) identi es if class
names are synonymous terms or in the same/linked term families according to a
thesaurus [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ]. Semantic context similarity (SCS) applies measures of ontological
similarity between the 2 metamodels [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ].
      </p>
      <p>Graph similarity measures treat a metamodel as a graph of nodes (classes)
and edges (associations, aggregations and inheritances).</p>
      <p>
        We evaluated the di erent measures on a large collection of di erent
metamodel pairs. We found that data-structure similarity (DSS) was the consistently
best approach. GSS overall has a poor average. GES is quite accurate, however it
has exponential time complexity [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ]. NSS can be misleading { eg., in the WebML
and EER case of [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ] Relationship in WebML corresponds to RelationshipEnd in
EER, not to its namesake. Likewise, NMS is more useful for cases where there
is a common vocabulary.
      </p>
      <p>
        The state of the art in metamodel matching is represented by [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ], who use
evolutionary algorithms with NSS/NMS to search for possible class and
feature matchings. However they do not consider DSS or composed features in
their matchings, but only non-composed (directly owned) and inherited features.
Transformation synthesis is not addressed in [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ]. We consider DSS is a better
basis for producing transformations. Using a deterministic procedure is preferable,
since the results of evolutionary algorithms can vary from run to run. It was
feasible to apply deterministic search to some examples of [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ] with comparable
results (Table 3).
      </p>
    </sec>
    <sec id="sec-2">
      <title>Flattening Classes</title>
      <p>
        Flattening a class is the process of representing the class in a form which
represents all of its recursively inherited and composed features [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. For a class, in
addition to its owned properties, its other properties are derived from
inheritance and navigation. The process of attening inheritance is: for each class C,
if C has a superclass D, copy properties of D to C if they are not already in
C. To atten navigation, the process is: for each class C, if it has an association
r to another class D, add properties r.a (for each property a : T of D ) to C.
Speci cally, Table 1 summarizes the types of r.a under di erent conditions.
These two steps are repeated until there is no change in the metamodel. The
associations are also represented as properties in the attened representation,
which ensures that the structure of the metamodel is fully expressed in the at
version. The attening process terminates when reaching loops in the graph.
Fig. 2 shows the attening results on the Petri Net metamodels. The attened
class of a class C is named C$.
      </p>
      <p>(a) source metamodel</p>
      <p>(b) target metamodel
In assessing similarity, it is only necessary to look at the types of the properties,
not at their names. This kind of similarity is called data structure similarity
(DSS). Although sometimes property names are very similar, names may be
too much in uenced by human factors. For example, two completely di erent
properties in di erent metamodels can have the same name if the developer
chooses. In contrast, the types of properties are much more objective.</p>
      <p>
        To make the similarity result more accurate, we need to consider all possible
matches of classes. Eg., if we assume that class E1 matches class E2, then type
E1 is considered fully similar (value 1 equivalent) to type E2. However, equality
of types can be fuzzy, for example, a type E property with 0..1 multiplicity could
be considered 0.75 similar to a type E property with 1 multiplicity. This allows
more exible matches than strict equality of the types. In this paper we use xed
similarity values for types (see Table 2).
We sum the individual class DSS similarities to obtain a mapping score.
However, sometimes there are multiple mappings with the same highest map score.
In this case, calculating name similarity is used to choose one map. To calculate
the name similarity, we use string edit distance [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ]. This measures the
minimum number of operations (insertions, deletions, substitutions) which change
one string into another one. For two strings A and B, the name syntactic
similarity (NSS) is:
      </p>
      <p>N SS =</p>
      <p>A:size + B:size ed(A; B)</p>
      <p>A:size + B:size</p>
      <p>The correspondences are expressed as mappings of classes and their features.
Eg.: T ransition$ 7 ! T ransition1$ with</p>
      <p>name 7 ! name src 7 ! in:src dst 7 ! out:dst
where P lace$ 7 ! P lace1$. From these mappings, transformations in di erent
MT languages can be synthesised. So far, we generate QVT-R, QVT-O and
UML-RSDS. Eg., in QVT-R the T ransition mapping is:
top relation MapTransition2Transition1
{ enforce domain sourc t : Transition
{ name = n, src = t_src : Place {}, dst = t_dst : Place {} };
enforce domain targ t1 : Transition1
{ name = n, in = t1_in : PTArc { src = t1_in_src : Place1 {} },
out = t1_out : TPArc { dst = t1_out_dst : Place1 {} } };
when
{ Transition2Transition1(t,t1) and</p>
      <p>Place2Place1(t_src,t1_in_src) and</p>
      <p>Place2Place1(t_dst,t1_out_dst) }
}
6</p>
    </sec>
    <sec id="sec-3">
      <title>Evaluation</title>
      <p>In the Petri Net example, the source metamodel contains 3 classes, and the target
metamodel contains 5 classes, meaning there are 60 potential class mappings.
After calculating these 60 mappings, we found 2 mappings with the highest
map score, 1.6825396825396826. The rst mapping is: Transition$ 7!
Transition1$, Net$ 7! Net1$, Place$ 7! Place1$. The second mapping is: Transition$
7! Place1$, Net$ 7! Net1$, Place$ 7! Transition1$. This arises because of the
structural symmetry of the P lace and T ransition classes { they can be validly
interchanged according to DSS.</p>
      <p>By calculating name similarity, the rst result is selected as the best mapping,
and its detailed correspondences are as follows:
{ Matching for Transition$ and Transition1$: [name, src, dst, src.name,
dst.name] 7 ! [name, in.src, out.dst, in.src.name, out.dst.name]. Similarity of
Transition$ and Transition1$ is: 0.5555555555555556.
{ Matching for Net$ and Net1$: [places, transitions, places.name, places.dst,
places.src, places.dst.name, places.src.name, transitions.name,
transitions.src, transitions.dst, transitions.src.name, transitions.dst.name] 7 ! [places,
transitions, places.name, places.out.dst, places.in.src, places.out.dst.name,
places.in.src.name, transitions.name, transitions.in.src, transitions.out.dst,
transitions.in.src.name, transitions.out.dst.name]. Similarity of Net$ and Net1$
is: 0.5714285714285714.
{ Matching for Place$ and Place1$: [name, dst, src, dst.name, src.name] 7 !
[name, out.dst, in.src, out.dst.name, in.src.name]. Similarity of Place$ and
Place1$ is: 0.5555555555555556.</p>
      <p>Data of these and other cases may be found at nms.kcl.ac.uk/kevin.lano/mtsy
nthesis. The prototype tools used are at: nms.kcl.ac.uk/kevin.lano/uml2web.</p>
    </sec>
    <sec id="sec-4">
      <title>Conclusion</title>
      <p>In this paper, we have presented an approach for extracting correspondences by
using metamodel matching. The core step has been calculating the similarities of
all possible class matches, and using name similarity or human choice to select
the best matching. Evaluation has shown the feasibility and relevance of the
approach.</p>
      <p>Our future research plan involves (i) compare di erent similarity measures for
metamodel matching based on graph or data structures, naming, or semantics
using several cases; (ii) compare di erent evolutionary approaches and other
techniques for handling larger metamodels; (iii) develop a general approach for
automatically transforming correspondences to transformations in QVT-R and
other MT languages, and evaluate it with several examples to verify e ciency
and quality. (iv) Finally, a tool will be developed based on our approach for
automated model transformation.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Beyer</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lewerentz</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Simon</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          :
          <article-title>Impact of inheritance on metrics for size, coupling, and cohesion in object-oriented systems</article-title>
          .
          <source>In: International Workshop on Software Measurement</source>
          . pp.
          <volume>1</volume>
          {
          <fpage>17</fpage>
          . Springer (
          <year>2000</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Bunke</surname>
            ,
            <given-names>H.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Riesen</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          :
          <article-title>Recent advances in graph-based pattern recognition with applications in document analysis</article-title>
          .
          <source>Pattern Recognition</source>
          <volume>44</volume>
          (
          <issue>5</issue>
          ),
          <volume>1057</volume>
          {
          <fpage>1067</fpage>
          (
          <year>2011</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Garces</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Jouault</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Cointe</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Bezivin</surname>
          </string-name>
          , J.:
          <article-title>Managing model adaptation by precise detection of metamodel changes</article-title>
          .
          <source>In: European Conference on Model Driven Architecture-Foundations and Applications</source>
          . pp.
          <volume>34</volume>
          {
          <fpage>49</fpage>
          . Springer (
          <year>2009</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Herrmannsdoerfer</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Benz</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Juergens</surname>
          </string-name>
          , E.:
          <article-title>Cope-automating coupled evolution of metamodels and models</article-title>
          .
          <source>In: European Conference on Object-Oriented Programming</source>
          . pp.
          <volume>52</volume>
          {
          <fpage>76</fpage>
          . Springer (
          <year>2009</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Kessentini</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ouni</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Langer</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Wimmer</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Bechikh</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          :
          <article-title>Search-based metamodel matching with structural and syntactic measures</article-title>
          .
          <source>Journal of Systems and Software 97</source>
          ,
          <issue>1</issue>
          {
          <fpage>14</fpage>
          (
          <year>2014</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>Kless</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Milton</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          :
          <article-title>Comparison of thesauri and ontologies from a semiotic perspective</article-title>
          .
          <source>In: Proc. of the 6th Australian Ontology Workshop (AOW</source>
          <year>2010</year>
          ), T. Meyer, MA Orgun and K. Taylor (eds.) Adelaide, AU: Australian Computer Society. pp.
          <volume>35</volume>
          {
          <fpage>44</fpage>
          .
          <string-name>
            <surname>Citeseer</surname>
          </string-name>
          (
          <year>2010</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>Levenshtein</surname>
            ,
            <given-names>V.I.</given-names>
          </string-name>
          :
          <article-title>Binary codes capable of correcting deletions, insertions, and reversals</article-title>
          .
          <source>In: Soviet physics doklady</source>
          . vol.
          <volume>10</volume>
          , pp.
          <volume>707</volume>
          {
          <issue>710</issue>
          (
          <year>1966</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <surname>Macindoe</surname>
            ,
            <given-names>O.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Richards</surname>
            ,
            <given-names>W.</given-names>
          </string-name>
          :
          <article-title>Graph comparison using ne structure analysis</article-title>
          .
          <source>In: 2010 IEEE Second International Conference on Social Computing</source>
          . pp.
          <volume>193</volume>
          {
          <fpage>200</fpage>
          .
          <string-name>
            <surname>IEEE</surname>
          </string-name>
          (
          <year>2010</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <surname>Maedche</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Staab</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          :
          <article-title>Comparing ontologies-similarity measures and a comparison study</article-title>
          .
          <source>AIFB</source>
          (
          <year>2001</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10. OMG:
          <article-title>Meta Object Facility (MOF) 2</article-title>
          .0 Query/View/ Transformation Speci cation. http://www.omg.org/spec/QVT/1.1, last accessed
          <issue>17 Feb 2019</issue>
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11.
          <string-name>
            <surname>Wachsmuth</surname>
          </string-name>
          , G.:
          <article-title>Metamodel adaptation and model co-adaptation</article-title>
          .
          <source>In: European Conference on Object-Oriented Programming</source>
          . pp.
          <volume>600</volume>
          {
          <fpage>624</fpage>
          . Springer (
          <year>2007</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          12.
          <string-name>
            <surname>Wimmer</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Langer</surname>
            ,
            <given-names>P.:</given-names>
          </string-name>
          <article-title>A benchmark for model matching systems: The heterogeneous metamodel case</article-title>
          .
          <source>Softwaretechnik-Trends:</source>
          Vol.
          <volume>33</volume>
          , No.
          <volume>2</volume>
          (
          <year>2013</year>
          )
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>