When a Concept or Attribute is added to the
Meta-model it can already exist, since it could have
been found previously. In this situation, new infor-
mation is added to the current Concept or Attribute,
according to some predefined rules.
When merging a Concept: new attributes are
added to the existing Concept and existing attributes
are merged.
When merging an Attribute, if the new At-
tribute is a Reference and the previous is a Sim-
pleAttribute, it upgrades it to a Reference. This fea-
ture is useful for the Reference Deduction stage. For
the boolean properties, the merged value is obtained
by performing an OR operation between the old and
the new value. For the type of the simple attribute,
the merged value is the broader type between the old
and new type. The types are order from broader to
narrower accordingly: string -> number -> boolean
-> null.
4.3.2 Reference Deduction
The goal of this stage is to determine which simple
attributes are, in fact, a reference to another concept.
As an example, the general rule for an attribute A to
reference a concept C is that, given the set of values
of A values(A) and the set of identifiers/names for the
concept C names(C), the attribute A is a reference to
C if names(C) contain all the values in values(A), i.e.,
values(A) are a subset of names(C). This relationship
can be expressed in the form values(A) ⊂ names(C).
This approach generally works well to identify
references to a single concept, but if an Attribute ref-
erences more than one Concept at the same time, that
is, it references an abstract Concept that one or more
concepts can extend, this method would not be able to
find those kinds of references. One way to deal with
this issue is to predict what the abstract concept could
be.
In the context of metamodel inference, abstract
Concepts are only relevant if at least one reference
uses it as its target. Therefore, a way to find possi-
ble references to abstract concepts is to first consider
a possible Concept hierarchy, including abstract and
non-abstract Concepts, and, for each Concept, find
the SimpleAttributes for which the relationship ex-
pressed by values(A) ⊂ names(C) hold true.
To find a Concept hierarchy, for each Concept C
let attributes(C) be the set which holds all the names
of all the attributes belonging to Concept C. Then,
for all the Concepts found in the 4.3.1 stage, for
each unique pair of Concepts C1 and C2, compute
attributes(C1) ∩ attributes(C2). If the intersection of
the sets is not empty, use it to define a new abstract
Concept. Repeat this with the new abstract Concepts
until no new Concept can be defined.
However, there is one issue with this approach:
given a Concept C that extends abstract Concept AC,
then it follows that names(C) ⊂ names(AC).
Transitively, any Attribute A for which
values(A) ⊂ names(C) holds true implies that
values(A) ⊂ names(AC) also hold true. This might
result in wrongly deduced reference, which is why
out of all the Concepts A might target, the most
specific Concept (the one with the largest set of
labels) is chosen. This stage of the algorithm can be
summed in the following specific steps.
1. Find possible abstract Concepts by finding com-
mon attributes in the existing Concepts;
2. For each non-identifier SimpleAttribute in the
meta-model find the Concepts for which the con-
dition values(A) ⊂ names(AC) holds true. If at
least one Concept is found, select the most spe-
cific one;
3. For each SimpleAttribute in the last step, if one
Concept is chosen, upgrade it to a Reference,
with the selected Concept as its target and the
containment properties set to false.
5 EVALUATION
In this section we discuss what guided the assessment,
the tools used and how, and the results obtained.
5.1 Evaluation Criteria
Besides the fulfilling of the requirements, some eval-
uation measures are used to validate the hypothesis,
namely: (i) using the generated meta-model, it should
be able to instantiate the same models that were used
for deduction; (ii) instances of the generated meta–
model should be able to be imported into the LCAP;
(iii) the coverage of the features of the input models.
5.2 Test Tools
Four tools (i.e., Input Model Validator, Generated
Model Validator, Metamodel Validator, and Model
Generators) were used for testing the proposal. Their
usage and procedures are explained in this section.
5.2.1 Input Model Validator
The goal of this tool is to validate the inferred meta-
model by validating the input models against it. This
assumes that the input models are valid from the out-
set and, as such, if the meta-model can successfully
MODELSWARD 2023 - 11th International Conference on Model-Based Software and Systems Engineering
172