<!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>A Common Integrated Framework for Heterogeneous Modeling Services</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Anastasia Mavridou</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Tamas Kecskes</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Qishen Zhang</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Janos Sztipanovits</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Vanderbilt University</institution>
        </aff>
      </contrib-group>
      <abstract>
        <p>Modeling languages are often used for designing complex systems. To simplify the modeling process, system designers can use dedicated modeling frameworks, which provide all necessary tools and services in order to facilitate system development and decrease costs by eliminating errors early at design time. Nowadays, the emergence of heterogeneous engineering domains has led to design flows that span multiple Domain Specific Modeling Languages (DSMLs). As a result, analyzing system behavior requires the semantic integration of modeling domains through languages that are supported by formal semantics, are easily adaptable, and provide scalable and eficient correctness-checking services. To this end, we present a framework that provides heterogeneous modeling services that are based on the combination of two formalisms, 1) logics and 2) graphs. On one hand, we use the FORMULA tool to formalize the semantics of DSMLs and provide a common integrated semantic background. On the other hand, we use graph queries specified in Gremlin to employ eficient query and model analysis services. Our framework ofers a complete model-based engineering solution that includes graphical modeling and version control services, which are integrated into a web-based collaborative environment.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>INTRODUCTION</title>
      <p>
        Modeling frameworks are key enables of model-driven engineering.
They provide necessary tools and services to system designers in
order to facilitate system development and eliminate errors early
at design time. The adoption of model-engineering methods in
new cross-disciplinary fields such as Cyber-Physical Systems (CPS)
brings new challenges in modeling frameworks [
        <xref ref-type="bibr" rid="ref17">17</xref>
        ], which are now
required to provide heterogeneous services for capturing
multiabstraction and multi-fidelity models expressed in many diferent
DSMLs. The list of DSMLs used is not static; it changes and evolves
depending on the application needs.
      </p>
      <p>Analyzing system structure and behavior, and pursuing
crossdomain trade-ofs requires the semantic integration of modeling
domains. To do that, modeling frameworks must be extensible
and adaptable to allow modeling in diferent DSMLs in a way that
their semantics are captured in a formal manner to allow
rigorously specifying model transformations. Additionally, modeling
frameworks are called to provide heterogeneous services that
include 1) engineering services for graphical modeling,
metamodeling, version-control, etc.; 2) a common integrated semantic
background represented in a formal language; 3) eficient and scalable
correctness-checking mechanisms.</p>
      <p>
        On one hand, even though logic-based languages [
        <xref ref-type="bibr" rid="ref15 ref5 ref6">5, 6, 15</xref>
        ] can
be very efective for formally capturing constraints, model
transformations and proof generations, they might not scale. On the other
hand, even though graph-based query languages [
        <xref ref-type="bibr" rid="ref1 ref16">1, 16</xref>
        ] can be very
eficient for model analysis and clustering, they cannot be used for
model synthesis and proof generation. We believe that a framework
that combines both languages, and thus, all their advantages, can
provide the expressiveness and the eficiency needed for modeling
and analyzing large, heterogeneous systems.
      </p>
      <p>
        Our work is based on previous preliminary work presented in [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ].
The primary contribution of [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ] was the deep semantic integration
of WebGME [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ], a meta-programmable modeling tool, with
FORMULA [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ], a formal framework and tool for specifying DSMLs.
Deep integration requires that the engineering view of an evolving
model and its formal representation to be tightly synchronized.
The approach taken in [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ] for the formalization of the WebGME
metamodeling language with FORMULA was specific to WebGME
and thus, cannot be generalized for other metamodeling languages.
Additionally, it did not support automatic derivation of
conformance constraints nor eficient querying through graph-database
languages. There are other works in the field [
        <xref ref-type="bibr" rid="ref1 ref18">1, 18</xref>
        ] that show the
integration of several aspects of our work, but they all lack some
of the functionalities we provide - either the capability of visual
editing and user defined constraints, or they are tied to a single
domain. Our contributions are threefold:
(1) We study and formally present the semantics of the WebGME
metamodeling language;
(2) We study a formal, abstract, easy-to-reason model based on
typed graphs for capturing the semantics of metamodeling
languages. Our approach eliminates as much as possible
error-prone user input by automatically deriving consistency
conditions that must be met. Additionally, our approach is
generic; we have applied it on the WebGME metamodeling
language but it can be applied to any other metamodeling
language.
(3) We develop a framework that provides heterogeneous
services, which are based on the combination of diferent
formalisms. We use logic-based and graph-based languages and
study their relation.
      </p>
      <p>Our web-based, open source1 framework provides a set of
engineering services. It allows real-time collaboration between multiple
developers. Project changes are committed and versioned, which
enables branching, merging and viewing the history of a project.</p>
      <p>The organization of the paper is as follows. Section 2 provides
background information. Section 3 presents the theoretical
foundation of our approach, which is based on labeled and typed graphs
and first-order logic conformance conditions. Section 4 and 5 presents
the translation of the graphs and conformance conditions in
FORMULA and Gremlin languages, respectively. Section 6 discusses</p>
      <sec id="sec-1-1">
        <title>1https://github.com/kecso/comif-hems</title>
        <p>the translation of specific metamodel and model instances in
FORMULA and Gremlin, while also provides implementation details.
Section 7 concludes the paper.
2</p>
      </sec>
    </sec>
    <sec id="sec-2">
      <title>METAMODELING AND WEBGME</title>
      <p>
        There exists a plethora of metamodeling languages and tools; Kern
et al. provide a comparative analysis [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ]. In this paper, we use
the Web Generic Modeling Environment (WebGME) [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ]
metaprogrammable modeling tool. The metamodeling language of
WebGME is shown in Figure 1 as a UML Class diagram [
        <xref ref-type="bibr" rid="ref14">14</xref>
        ].
      </p>
      <p>A project in WebGME is a collection of metamodels and models.
When a user creates a new project, it contains the First Class
Object (FCO), which comprises the root of the inheritance hierarchy.
FCO has a fixed attribute name of type String, which is inherited
by all other objects. Additionally, objects may contain several other
attributes. An Attribute defines a property of an object, which
can be typed as String, Integer, Float, Enumeration, etc.</p>
      <p>Relations between objects include Pointer, Set membership,
Mixin, Inheritance, and Containment. Inheritance and Mixin
are similar to UML inheritance and UML realization, respectively.
Inheritance and Mixin are both associated with FCO by: 1) a strong
containment for their “sources”, i.e., baseOf, interfaceOf and
2) a weak association for their “destinations”, i.e., instanceOf,
implementationOf. The strong association denotes the fact that if
the base (resp. interface) of an inheritance (resp. mixin) relation is
deleted, the inheritance (resp. mixin) relation is deleted as well.</p>
      <p>Furthermore, the Containment and Pointer are similar to a
UML containment and UML binary directed named association,
respectively. In the same manner, Set membership is similar to a UML
directed named association between an instance of an owner object
type and an unordered set of member objects of another type. Set
membership can be considered as a collection of pointers. For all
three relations their source is associated with FCO through a strong
containment association and their destination is associated with
FCO through a weak association. All three relations have additional
user-defined properties. Set membership and Pointer include
property name of type String. Additionally, Containment and Set
membership include propery md of type UnlimitedNatural that
denotes the destination multiplicity of the child. The source
multiplicities of Containment and Set membership are always 1.
Notice that Inheritance, Pointer, and Mixin do not have the md
property because the multiplicities of their instances are not user
defined but fixed. The source multiplicities of each Inheritance,
Pointer, and Mixin instance are all equal to 1. The destination
multiplicities of each Inheritance, Pointer, and Mixin instance
are equal to ∗, 1, and ∗, respectively.</p>
    </sec>
    <sec id="sec-3">
      <title>3 SEMANTIC FOUNDATIONS</title>
      <p>
        Before we provide the formal definitions let us first give the intuition
behind our approach. We aim at describing the semantics of a
metamodeling language with an abstract, high-level language that
enables easy reasoning. Graphs provide such an abstract language
and have been studied extensively for representing metamodels
and models [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ]. Additionally, we aim at describing the generic
conformance conditions at the meta-meta model level. So instead of
creating sets of rules — one set per relation instance — we generalize
these rules, by describing them at the meta-meta model level.
      </p>
      <p>We define labeled graphs, which are directed graphs edge-labeled
with names and multiplicities, to specify (meta-)metamodels.</p>
      <p>Definition 3.1. (Labeled graph). A labeled graph is a quadruple
L = ⟨V , E, λv , λe ⟩, with a set of vertices V , a set of directed edges
E ⊆ V 2, and labeling functions 1) λv : V 7→ N and 2) λe : E 7→
I × N × I , where N is a set of names and I is a set of intervals of
the form = N2 ∪ N × {∗}.</p>
      <p>For ease of presentation, we define the notation ∀e ∈ E, ∀v ∈ V :
• src(e) ∈ V denotes the source vertex of e,
• dst (e) ∈ V denotes the destination vertex of e,
• ms(e) ∈ I denotes the source multiplicity of e,
• md(e) ∈ I denotes the destination multiplicity of e,
• n(e), n(v) ∈ N denote the names of e and v, respectively.
We require the following uniqueness conditions:
• ∀v1, v2 ∈ V , if n(v1) = n(v2) then v1 = v2,
• ∀e1, e2 ∈ E, if src(e1) = src(e2), n(e1) = n(e2), and dst (e1) =
dst (e2) then e1 = e2 with source and destination
multiplicities ms(e1) ∪ ms(e2) and md(e1) ∪ md(e2), respectively.
Next, we define Model graphs, which we use to specify models.</p>
      <p>
        Definition 3.2. (Model graph). A model graph is a Labeled graph
M = ⟨V , E, λv , λe ⟩ such that for all edges e ∈ E, ms(e) = md(e) =
[
        <xref ref-type="bibr" rid="ref1 ref1">1, 1</xref>
        ].
      </p>
      <p>
        Typed graphs have been previously studied by the model
transformation community [
        <xref ref-type="bibr" rid="ref4 ref7">4, 7</xref>
        ]. We propose an extension of typed
graphs to check the model conformance, which allows to capture
inheritance defined between nodes of the metamodel.
      </p>
      <p>Definition 3.3. (Typed graph). A typed graph is a quadruple
T = ⟨L, M, τv , τe ⟩ where L and M are labeled and model graphs,
respectively; τv : VM ∪ VL 7→ 2VL , τe : EM 7→ EL</p>
      <p>Definition 3.3 describes the inheritance relation 1) between
vertices of the model or labeled graph and vertices of the labeled graph
and 2) edges of the model graph and edges of the labeled graph. The
L graph specifies a metamodel with node types and edge types. The
M graph is an instance model referencing these types. The type(s)
of each vertex v and edge e, of M, is τv (v) and τe (e), respectively.</p>
      <p>Definition 3.4. (Model conformance). For a typed graph T =
⟨L, M, τv , τe ⟩, a model, represented by the model graph M, conforms
to a metamodel, represented by the labeled directed graph L if a set
of conditions hold:
n
conforms(T ) = Û (i),
i=1
where (i) represents logical formulae that are either 1) generic and
automatically derived from T or 2) application-specific and thus,
user-defined.
3.1</p>
    </sec>
    <sec id="sec-4">
      <title>Automatically-derived Conditions</title>
      <p>For a typed graph T = ⟨L, M, τv , τe ⟩, we derive the following
conformance conditions:</p>
      <p>(1) ≜ ∀vM ∈ VM , ∃vL ∈ VL : vL ∈ τv (vM ) .</p>
      <p>Meaning of (1): for each vertex in the model graph there exists a
vertex in the labeled graph that characterizes its type.
(2) ≜ ∀eM ∈ EM , ∃eL ∈ EL :</p>
      <p>τe (eM ) = eL ∧ src(eL) ∈ τv (src(eM )) .</p>
      <p>Meaning of (2): for each edge eM in the model graph, there exists
an edge eL in the labeled graph, such that eM is of type eL and the
source vertex of eM is of type of the source vertex of eL.
(3) ≜ ∀eM ∈ EM , ∃eL ∈ EL :</p>
      <p>τe (eM ) = eL ∧ dst(eL) ∈ τv (dst(eM )) .</p>
      <p>Meaning of (3): for each edge eM in the model graph, there exists
an edge eL in the labeled graph, such that eM is of type eL and the
destination vertex of eM is of type of the destination vertex of eL.
(4) ≜ ∀vA ∈ VM , ∀eL ∈ EL, ∀VMS ⊆ VM , ∃vB ∈ VMS ,
∀eM ∈ EM : src(eL) &lt; τv (vA) ∨ src(eM ) , vA ∨</p>
      <p>dst(eM ) , vB ∨ τe (eM ) , eL ∨ |VMS | ∈ md(eL).</p>
      <p>Meaning of (4): each vertex vA of the model graph is correctly
connected to a subset of the vertices of the model graph according
to the destination multiplicities of all the edges of the labeled graph
that are connected to the vertex that corresponds to the type of vA.
(5) ≜ ∀eL ∈ EL, ∀vM ∈ VM , ∃eM ∈ EM : src(eL) &lt; τv (vM ) ∨
0 ∈ md(eL) ∨ (src(eM ) = vM ∧ eL = τe (eM )) .</p>
      <p>Meaning of (5): for each edge eL of the labeled graph there exists
at least an edge eM , which is an instance of eL in the model graph
if the corresponding destination cardinality of eL does not include
zero and there exists at least a node vM such that src(eM ) = vM .
(6) ≜ ∀vA ∈ VM , ∀eL ∈ EL, ∀VMS ⊆ VM , ∃vB ∈ VMS ,
∀eM ∈ EM : src(eL) &lt; τv (vA) ∨ src(eM ) , vB ∨</p>
      <p>dst(eM ) , vA ∨ τe (eM ) , eL ∨ |VMS | ∈ ms(eL).</p>
      <p>Meaning of (6): each vertex vA of the model graph is correctly
connected to a subset of the vertices of the model graph according
to the source multiplicities of all the edges of the labeled graph that
are connected to the vertex that corresponds to the type of vA.
(7) ≜ ∀eL ∈ EL, ∀vM ∈ VM , ∃eM ∈ EM : dst(eL) &lt; τv (vM ) ∨
∧ 0 ∈ ms(eL) ∨ (dst(eM ) = vM ∧ eL = τe (eM )) .</p>
      <p>Meaning of (7): for each edge eL of the labeled graph there exists
at least an edge eM , which is an instance of eL in the model graph
if the corresponding source cardinality of eL does not include zero
and there exists at least a node vM such that dst(eM ) = vM .</p>
    </sec>
    <sec id="sec-5">
      <title>4 LOGIC-BASED FORMULA SPECIFICATION</title>
      <p>
        FORMULA (Formal Modeling Using Logic Programming and
Analysis) [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] is a specification language and tool that can be used to
formally model and verify specifications. It has been successfully
used to verify critical drivers in Windows [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ].
      </p>
      <p>Next, we show the equivalent specifications of a labeled, model
and typed graph in FORMULA. The complete specification is wrapped
in a domain block, which delimits a domain-specific abstraction.</p>
      <p>The specification of a labeled graph is as follows:
MetaNode ::= new ( name : String ).</p>
      <p>MetaEdge ::= new ( name : String , src : MetaNode ,</p>
      <p>dst : MetaNode , ms: Multiplicity , md: Multiplicity ).
Multiplicity ::= new ( low : Natural , high : Natural + {"*" }).</p>
      <p>FORMULA supports algebraic data types and these are used to
encode user defined relations. For example, the first line of the labeled
graph specification declares a data type constructor MetaNode()
for instantiating meta-level nodes (VL). This constructor produces
MetaNode instances that have a field called name of type String.</p>
      <p>Similarly, the specification of a model graph is as follows:
Node ::= new ( name : String , type : MetaNode ).</p>
      <p>Edge ::= new ( name : String , type : MetaEdge ,</p>
      <p>src : Node , dst : Node ).</p>
      <p>For simplification, we have omitted the source and destination
multiplicities of a model graph since they are always equal to 1.</p>
      <p>The inheritance relation between the nodes and edges of the
labeled and model graphs is defined through the typed graph. We use
the following transitive closure relation to specify node inheritance:
NodeInheritance ::= new ( base : MetaNode ,</p>
      <p>instance : MetaNode + Node ).</p>
      <p>NodeInstanceOf ::= ( MetaNode , MetaNode + Node ).
NodeInstanceOf (b,i) :- NodeInheritance (b,i) ;</p>
      <p>NodeInheritance (b,m), NodeInstanceOf (m,i).</p>
      <p>Edge inheritance can be directly checked through the type
argument of each Edge. We additionally define the WrongMultiplicity
condition, which follows directly from the labeled graph definition.
WrongMult :- Multiplicity (low , high ), high !="*", low &gt; high .
4.1</p>
    </sec>
    <sec id="sec-6">
      <title>Automatically-derived Conditions</title>
      <p>To generate the conditions presented in Section 3.1 in FORMULA,
for a typed graph T = ⟨L, M, τv , τe ⟩, we take the negation of the
formulas. Due to space limitations we show the equivalent
specification for a subset of conditions. The negation of (2) is translated
to FORMULA as follows:
not2 :- e is Edge , no {m | m is MetaEdge ,</p>
      <p>m = e.type , NodeInstanceOf (m.src ,e. src )}.</p>
      <p>The negation of (4) is translated to FORMULA as the conjunction
of (not4a) and (not4b), which are defined as follows:
not4a :- n is Node , m is MetaEdge ,</p>
      <p>NodeInstanceOf (m.src ,n),
count ({s|s is Node , e is Edge (_,m,n,s )}) &lt; m.md. low .
not4b :- n is Node , m is MetaEdge ,</p>
      <p>NodeInstanceOf (m.src ,n), m.md. high != "*",
count ({s|s is Node , e is Edge (_,m,n,s )}) &gt; m.md. high .</p>
      <sec id="sec-6-1">
        <title>The underscores denote “dont care” variables.</title>
      </sec>
    </sec>
    <sec id="sec-7">
      <title>5 GRAPH-BASED GREMLIN SPECIFICATION</title>
      <p>
        Graph databases use graph structures to represent and store data.
They allow to retrieve data of complex hierarchical structures in a
simple and fast manner, in comparison with relational databases.
We use the Gremlin traversal machine and language [
        <xref ref-type="bibr" rid="ref16">16</xref>
        ] by the
Apache TinkerPop Project. Gremlin provides a general graph
database interface that can be used on top of various industrial graph
database implementations. Our Gremlin graphs have vertices and
edges with a dedicated label property and a number of other
properties. The MetaNodes and MetaEdges of the labeled graph are
specified in Gremlin as follows:
graph . addVertex ('class ',' MetaNode ','name ',
' theNameOfTheMetaNode ');
graph . addVertex ('class ',' MetaEdge ','name ',
' nameOfTheMetaEdge ');
ME. addEdge ('src ',sMN ,'min ':0[ , 'max ':1]);
ME. addEdge ('dst ',dMN ,'min ':0[ , 'max ':1]);
For every MetaEdge and MetaNode, a vertex is created in the graph
specification. These vertices have an extra class property for
identifying their origin. To represent the src and dst properties of the
MetaEdge, we use labeled edges in the graph (ME is the MetaEdge
while sMN is the source MetaNode, and dMN is the destination
MetaNode). In the edge specifications, the property max is not defined
if the interval does not have an upper bound. Model graph
speciifcations are identical to Meta graph specifications with the only
diference being that their class properties are either set to Node or
Edge. To represent the type property and the inheritance relation
among node types, we specify the additional edges:
nodeOrMetaNode . addEdge ('type ', metaNode );
edge . addEdge ('type ', metaEdge );
      </p>
    </sec>
    <sec id="sec-8">
      <title>5.1 Automatically-derived Conditions</title>
      <p>Similarly, we generate the conditions presented in Section 3.1 as
Gremlin queries. Due to space limitations we show the equivalent
specifications for conditions (2) and (4):
not2 = g.V (). has ('class ','Edge '). not (
match (__.as('s'). out ('type '). out ('src '). as('a'),
__.as('s'). out ('src '). out ('type '). as('b')
. where ('b',eq('a')))). hasNext ();
Query not2 uses the match step where multiple traversals can be
checked. For every Edge vertex it checks whether there is no match
based first on type and second on src edges, and continues by
checking for no match in the opposite order, i.e., first on src and
second on type. Similarly, queries not4a, not4b are as follows:
not4a = g.V (). has ('class ',' MetaEdge '). match (__.as('m').
in('type '). groupCount (). by( out ('src ')).
order ( local ). by( values , incr ). select ( values ).
limit (local ,1). as('actual '),__.as('m').
outE ('src '). properties ('min '). value ().
as('allowed '). where ('allowed ',gt('actual ')).</p>
      <p>hasNext ();
not4b = g.V (). has ('class ',' MetaEdge '). where ( outE ('src ').
has ('max ')). match (__.as('m'). in('type ').
groupCount (). by( out ('src ')). order ( local ).
by( values , decr ). select ( values ). limit (local ,1).
as('actual '),__.as('m'). outE ('src ').
properties ('max '). value (). as('allowed ').</p>
      <p>where ('allowed ',gt('actual ')). hasNext ();</p>
    </sec>
    <sec id="sec-9">
      <title>6 INTEGRATION INTO THE DESIGNBIP TOOL</title>
      <p>
        We apply our framework on the DesignBIP tool [
        <xref ref-type="bibr" rid="ref13">13</xref>
        ].
BehaviorInteraction-Priority (BIP) is a component-based framework that has
been efectively used for the correct-by-construction development
of large systems [
        <xref ref-type="bibr" rid="ref12 ref2">2, 12</xref>
        ]. DesignBIP is a WebGME-based tool that
allows to graphically model and generate BIP systems.
      </p>
    </sec>
    <sec id="sec-10">
      <title>6.1 Part of the DesignBIP Metamodel</title>
      <p>The DesignBIP metamodel is partly shown in Figure 3. A Project
contains zero or more ComponentType objects. Each ComponentType
contains at least one StateBase, at least one TransitionBase, and
zero or more Guard instances. A ComponentType contains exactly
one InitialState. StateBase is an abstract object, meaning that
it can only be instantiated as InitialState or State. Similarly,
TransitionBase is also an abstract object. The TransitionBase
object points to StateBase through the src and dst pointers.</p>
      <p>6.1.1 DesignBIP metamodel in FORMULA. Our dedicated
WebGMEbased FORMULA code editor parses the MetaNodes and then
automatically creates the corresponding FORMULA rules. The
MetaNodes are specified in FORMULA as shown in the second row of
Figure 2. Next, the plugin parses the relations specified in the
metamodel and their multiplicities and creates multiplicity rules, e.g.,:
starMultiplicity is Multiplicity (0,"*").
exactlyOneMultiplicity is Multiplicity (1, 1).</p>
      <p>As you can see in Figure 3, WebGME concepts have attributes of
type String and asset. The types of these attributes are modeled
as MetaNodes in the labeled graph, while the containment of an
attribute by a concept is modeled as a MetaEdge, as follows:
String is MetaNode (" String ").
metaAttr1 is MetaEdge (" guardName ", TransitionBase , String ,
starMultiplicity , exactlyOneMultiplicity )</p>
      <p>Next, the plugin creates FORMULA rules for the additional
MetaEdge instances. Pointers are specified as shown in the fourth
row of Figure 2. Similarly, containments are specified as shown
in the second row of Figure 2. Set memberships are specified as
shown in the sixth row of Figure 2. Inheritance is specified with the
constructor NodeInheritance, as shown in the last row of Figure 2.</p>
      <p>6.1.2 DesignBIP metamodel in Gremlin. To generate the graph
database queries, we have created a second translator. The
equivalent Gremlin specifications for the WebGME concepts and relations
are shown in Figure 2. A notable diference between the FORMULA
and Gremlin specifications is that the cardinalities are defined in the
form of min and max properties of edges of the graph. Additionally,
the unbounded cardinality intervals are simply represented by not
defining the max property. Another diference is the type edges.
They represent the NodeInstanceOf relationship which means that
every base of a MetaNode is directly connected and we do not have
to make long traversals to get the information.</p>
    </sec>
    <sec id="sec-11">
      <title>DesignBIP Model Example</title>
      <p>Let us now consider the DesignBIP FSM model shown in Figure 4.</p>
      <p>The FSM has four states off, on, done, wait. The states are
conSpontaneousTransition, and InternalTransition (Figure 3).
Transitions on, off, and finished, illustrated by continuous lines,
are of type EnforceableTransition. Transition end, illustrated</p>
      <p>S p o n t a n e o u s T r a n s i t i o n 4 e n d , m o d e l A t t r 1 )
nected with transitions that are of three types: EnforceableTransition, The containment relation between the !finished attribute and the</p>
      <p>6.2.2 DesignBIP Model in Gremlin. Next, we present portions
of the generated Gremlin specification for the model of Figure 4.</p>
      <p>For instance, the on state is specified in Gremlin as follows.</p>
      <p>State2on = graph . addVertex ('class ','Node ', 'name ','s2 ').</p>
      <p>State2on . addEdge ('type ',State ).</p>
      <p>State2on . addEdge ('type ', StateBase ).</p>
      <p>State2on . addEdge ('type ',FCO ).</p>
      <p>The translation take cares of realizing the transitive closure of the
FORMULA definition of NodeInheritance. Similarly, the
specification of the guardname attribute in Gremlin is as follows:
modelAttr1 . addEdge ('type ',String ).
modelAttr1HasGuard = graph . addVertex ('class ','Edge ',
' guardName ','_t4 ').
modelAttr1HasGuard . addEdge ('src ', Transition4end ).
modelAttr1HasGuard . addEdge ('dst ', modelAttr1 ).
modelAttr1HasGuard . addEdge ('type ', metaAttr1 ).</p>
      <p>The specification of relations, for example the pointer relation
between state off and enforceable transition on, is as follows:
modelPointer1 = graph . addVertex ('class ','Edge ','name ','p1 ').
modelPointer1 . addEdge ('type ', metaPointer1src ).
metaPointer1 . addEdge ('src ', EnforceableTransition3on ).
metaPointer1 . addEdge ('dst ', InitialState1off ).</p>
    </sec>
    <sec id="sec-12">
      <title>6.3 Implementation</title>
      <p>To extend and allow the integration of these diferent
representations, we developed two dedicated code editors (the FORMULA
one can be seen in Figure 5) to the WebGME. Both editors have
two types of content: 1) read-only content that is generated from
the visually created meta-model and model and 2) a user-defined
portion where the user can add any additional constraint. The
read-only part can only be altered by using the graphical model or
meta-model editor of the WebGME. The code-editors also provide
‘check-buttons’ to run an on-demand evaluation of the given model.
This is done through dedicated plugins that communicate with the
integrated FORMULA and Gremlin console engines to check the
well-formedness of the model. Though we have not completed any
extensive performance testing between the two representations,
our first tests show that conformance checking in Gremlin is more
scalable and eficient than a similar task in FORMULA. With the
BIP domain (having 49 MetaNodes and 39 MetaEdges) and a
relatively large model (4082 Nodes and 12670 Edges), the FORMULA
execution took 113s while the Gremlin remained under 1s.</p>
    </sec>
    <sec id="sec-13">
      <title>7 CONCLUSION</title>
      <p>This paper discusses the integration of WebGME with 1) FORMULA
a formal framework for specifying DSMLs and 2) Gremlin an
graphbased query language. The purpose of the integration has been the
construction of an advanced modeling tool that provides
heterogeneous services. In particular, our framework provides: 1) extensive
model engineering services, such as graphical modeling interfaces,
scalable model repositories, a web-based architecture that allows
collaborative modeling which is backed-up by version control
services; 2) rigorous formal foundations through the integration of the
FORMULA language that can be used for specifying language
semantics, model transformation rules, automated consistency
checking, and model synthesis; 3) eficient Gremlin queries that can be
used for checking model conformance, clustering, and data analysis
of large and complex systems. In the future, we will use FORMULA
for model synthesis and proof generation.</p>
    </sec>
    <sec id="sec-14">
      <title>8 ACKNOWLEDGMENT</title>
      <p>This research was supported by the National Science Foundation
under award CNS-1521617.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>Renzo</given-names>
            <surname>Angles</surname>
          </string-name>
          and
          <string-name>
            <given-names>Claudio</given-names>
            <surname>Gutierrez</surname>
          </string-name>
          .
          <article-title>Querying rdf data from a graph database perspective</article-title>
          .
          <source>In European Semantic Web Conference</source>
          , pages
          <fpage>346</fpage>
          -
          <lpage>360</lpage>
          ,
          <year>2005</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>Ananda</given-names>
            <surname>Basu</surname>
          </string-name>
          , Matthieu Gallien, Charles Lesire,
          <string-name>
            <surname>Thanh-Hung</surname>
            <given-names>Nguyen</given-names>
          </string-name>
          , Saddek Bensalem, Félix Ingrand, and
          <string-name>
            <given-names>Joseph</given-names>
            <surname>Sifakis</surname>
          </string-name>
          .
          <article-title>Incremental component-based construction and verification of a robotic system</article-title>
          .
          <source>In ECAI</source>
          , volume
          <volume>178</volume>
          , pages
          <fpage>631</fpage>
          -
          <lpage>635</lpage>
          ,
          <year>2008</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>Ankush</given-names>
            <surname>Desai</surname>
          </string-name>
          , Vivek Gupta,
          <string-name>
            <surname>Ethan Jackson</surname>
            ,
            <given-names>Shaz</given-names>
          </string-name>
          <string-name>
            <surname>Qadeer</surname>
            , Sriram Rajamani, and
            <given-names>Damien</given-names>
          </string-name>
          <string-name>
            <surname>Zuferey</surname>
          </string-name>
          . P:
          <article-title>safe asynchronous event-driven programming</article-title>
          .
          <source>ACM SIGPLAN Notices</source>
          ,
          <volume>48</volume>
          (
          <issue>6</issue>
          ):
          <fpage>321</fpage>
          -
          <lpage>332</lpage>
          ,
          <year>2013</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>H</given-names>
            <surname>Ehrig</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K</given-names>
            <surname>Ehrig</surname>
          </string-name>
          ,
          <string-name>
            <given-names>U</given-names>
            <surname>Prange</surname>
          </string-name>
          , and
          <string-name>
            <given-names>G</given-names>
            <surname>Taentzer</surname>
          </string-name>
          .
          <article-title>Fundamentals of algebraic graph transformation</article-title>
          .
          <source>EATCS Series</source>
          ,
          <year>2006</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>Daniel</given-names>
            <surname>Jackson</surname>
          </string-name>
          .
          <article-title>Automating first-order relational logic</article-title>
          .
          <source>In ACM SIGSOFT Software Engineering Notes</source>
          , volume
          <volume>25</volume>
          , pages
          <fpage>130</fpage>
          -
          <lpage>139</lpage>
          . ACM,
          <year>2000</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <surname>Ethan</surname>
            <given-names>K Jackson</given-names>
          </string-name>
          ,
          <string-name>
            <given-names>Eunsuk</given-names>
            <surname>Kang</surname>
          </string-name>
          , Markus Dahlweid, Dirk Seifert, and Thomas Santen.
          <article-title>Components, platforms and possibilities: towards generic automation for mda</article-title>
          .
          <source>In Proceedings of the tenth ACM international conference on Embedded software</source>
          , pages
          <fpage>39</fpage>
          -
          <lpage>48</lpage>
          . ACM,
          <year>2010</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>Frédéric</given-names>
            <surname>Jouault</surname>
          </string-name>
          and
          <string-name>
            <given-names>Jean</given-names>
            <surname>Bézivin</surname>
          </string-name>
          .
          <article-title>Km3: a dsl for metamodel specification</article-title>
          .
          <source>In International Conference on Formal Methods for Open Object-Based Distributed Systems</source>
          , pages
          <fpage>171</fpage>
          -
          <lpage>185</lpage>
          . Springer,
          <year>2006</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>Tamas</given-names>
            <surname>Kecskes</surname>
          </string-name>
          , Qishen Zhang, and
          <string-name>
            <given-names>Janos</given-names>
            <surname>Sztipanovits</surname>
          </string-name>
          .
          <article-title>Bridging engineering and formal modeling: Webgme and formula integration</article-title>
          .
          <source>In Proceedings of the iffth International Workshop on The Globalization of Modeling Languages .</source>
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>Heiko</given-names>
            <surname>Kern</surname>
          </string-name>
          , Axel Hummel, and
          <string-name>
            <given-names>Stefan</given-names>
            <surname>Kühne</surname>
          </string-name>
          .
          <article-title>Towards a comparative analysis of meta-metamodels</article-title>
          .
          <source>In Proceedings of the compilation of the co-located workshops on DSM'11</source>
          , TMC'11, AGERE!
          <year>2011</year>
          , AOOPES'11, NEAT'
          <volume>11</volume>
          ,
          <string-name>
            <surname>&amp;</surname>
            <given-names>VMIL</given-names>
          </string-name>
          <source>'11</source>
          , pages
          <fpage>7</fpage>
          -
          <lpage>12</lpage>
          . ACM,
          <year>2011</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <string-name>
            <given-names>AG</given-names>
            <surname>Kleppe and Arend Rensink</surname>
          </string-name>
          .
          <article-title>On a graph-based semantics for UML class and object diagrams</article-title>
          .
          <source>In Graph Transformation and Visual Modelling Techniques. EASST</source>
          ,
          <year>2008</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          [11]
          <string-name>
            <surname>Miklós</surname>
            <given-names>Maróti</given-names>
          </string-name>
          , Tamás Kecskés, Róbert Kereskényi, Brian Broll, Péter Völgyesi, László Jurácz, Tihamer Levendovszky, and
          <string-name>
            <given-names>Ákos</given-names>
            <surname>Lédeczi</surname>
          </string-name>
          .
          <article-title>Next generation (meta) modeling: Web-and cloud-based collaborative tool infrastructure</article-title>
          .
          <source>MPM@ MoDELS</source>
          ,
          <volume>1237</volume>
          :
          <fpage>41</fpage>
          -
          <lpage>60</lpage>
          ,
          <year>2014</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          [12]
          <string-name>
            <surname>Anastasia</surname>
            <given-names>Mavridou</given-names>
          </string-name>
          , Emmanouela Stachtiari, Simon Bliudze, Anton Ivanov, Panagiotis Katsaros, and
          <string-name>
            <given-names>Joseph</given-names>
            <surname>Sifakis</surname>
          </string-name>
          .
          <article-title>Architecture-based design: A satellite onboard software case study</article-title>
          .
          <source>In International Conference on Formal Aspects of Component Software</source>
          , pages
          <fpage>260</fpage>
          -
          <lpage>279</lpage>
          . Springer,
          <year>2016</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          [13]
          <string-name>
            <surname>Anastasia</surname>
            <given-names>Mavridou</given-names>
          </string-name>
          , Joseph Sifakis, and Janos Sztipanovits.
          <article-title>DesignBIP: A design studio for modeling and generating systems with BIP</article-title>
          .
          <source>In Proc. of 1st International Workshop on Methods and Tools for Rigorous System Design (MeTRiD)</source>
          ,
          <year>June 2018</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          [14]
          <string-name>
            <given-names>Object</given-names>
            <surname>Management</surname>
          </string-name>
          <article-title>Group (OMG)</article-title>
          .
          <source>Unified Modeling Language, Version</source>
          <volume>2</volume>
          .5. https://www.omg.org/spec/UML/2.5/About-UML/,
          <year>2015</year>
          . [Accessed 1-May-2018].
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          [15]
          <string-name>
            <given-names>Mark</given-names>
            <surname>Richters</surname>
          </string-name>
          and
          <string-name>
            <given-names>Martin</given-names>
            <surname>Gogolla</surname>
          </string-name>
          .
          <article-title>On formalizing the UML object constraint language OCL</article-title>
          .
          <source>In International Conference on Conceptual Modeling</source>
          , pages
          <fpage>449</fpage>
          -
          <lpage>464</lpage>
          . Springer,
          <year>1998</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          [16]
          <string-name>
            <surname>Marko</surname>
            <given-names>A Rodriguez.</given-names>
          </string-name>
          <article-title>The gremlin graph traversal machine and language (invited talk)</article-title>
          .
          <source>In Proceedings of the 15th Symposium on Database Programming Languages</source>
          , pages
          <fpage>1</fpage>
          -
          <lpage>10</lpage>
          . ACM,
          <year>2015</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref17">
        <mixed-citation>
          [17]
          <string-name>
            <surname>Janos</surname>
            <given-names>Sztipanovits</given-names>
          </string-name>
          , Ted Bapty, Xenofon Koutsoukos, Zsolt Lattmann, Sandeep Neema, and
          <string-name>
            <given-names>Ethan</given-names>
            <surname>Jackson</surname>
          </string-name>
          .
          <article-title>Model and tool integration platforms for cyberphysical system design</article-title>
          ,
          <year>2018</year>
          . URL dx.doi.org/10.1109/jproc.
          <year>2018</year>
          .
          <volume>2838530</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref18">
        <mixed-citation>
          [18]
          <string-name>
            <given-names>Bahram</given-names>
            <surname>Zarrin</surname>
          </string-name>
          and
          <string-name>
            <given-names>Hubert</given-names>
            <surname>Baumeister</surname>
          </string-name>
          .
          <article-title>An integrated framework to specify domain-specific modeling languages</article-title>
          .
          <source>In 6th International Conference on ModelDriven Engineering and Software Development</source>
          , pages
          <fpage>83</fpage>
          -
          <lpage>94</lpage>
          ,
          <year>2018</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>