• Nem Talált Eredményt

The current thesis is structured into nine main chapters (including this introduction) that contain overviews and new results and two appendices complementing the main parts with additional infor-mation.

• Chapter 2 gives an introduction to the basics of modeling language specification.

1.5. THE STRUCTURE OF THE THESIS 7

• Chapter 3 presents the technique of graph transformation.

• Chapter 4 introduces the basic principles of implementing graph transformation and discusses considerations about the efficiency of pattern matching algorithms.

• Chapter 5 presents a benchmarking framework for model transformation tools (as suggested by Contribution 1) to quantitatively assess and analyze their run-time performance and to compare different optimization strategies used for of pattern matching.

• Chapter 6 proposes a novel approach for graph transformation built on top of standard relational database management systems, which corresponds to Contribution 2.

• Chapter 7 presents a technique to implement adaptive and model-sensitive graph pattern match-ing modules (as suggested by Contribution 3), which use the statistics of the instance model under transformation to dynamically select the optimal from precompiled strategies.

• Chapter 8 presents the foundations of an incremental graph pattern matching engine (as proposed by Contribution 4), which keeps track of existing matchings in an incremental way to reduce the execution time of graph pattern matching.

• Finally, Chapter 9 concludes the main parts of the current thesis.

Notational guide

In order to obtain a consistence appearance of the thesis, the following rules are followed.

• This thesis is mainly written in third person singular. In conclusions after each chapter, I empha-size my own contribution by first person singular or plural.

• Terms in formal definitionsare printed inboldletters.

• Newconcepts,informal definitionsandtheoremsare typeset initalics.

• Code extractsalways appear astypewrittentext in listings with grey background.

• For referring totexts in figures,sans seriffonts are used.

CHAPTER

2

Graph Models

In this chapter, the basics of modeling language specification are introduced. Concepts are presented on the object-relational mapping [49], which is reused as a running example in later chapters. Finally, in order to demonstrate the practical links of the theoretical concepts, a corresponding Java based implementation is presented.

2.1 Metamodels

This section summarizes the foundations of modeling language specification. The abstract syntax of a modeling language (or domain) is described by themetamodel. Nodes of the metamodel are called classes. Inheritancemay be defined between classes, which means that the inherited class has all the properties its parent has, but it may further contain some additional ones. Associationsdefine connec-tions between classes. Both ends of an association may have amultiplicity constraintattached to them, which declares the number of objects that, at run-time, may participate in an association. We consider the most typical multiplicity constraints, which are the at most one (denoted implicitly by diamonds for containment, or explicitly by the 0..1 notation for general associations at the corresponding line end), and the arbitrary (denoted uniformly by line ends with * multiplicity).

While attribute handling is an important practical aspect, we decided not to include it in the formal-ization of metamodels presented in the current chapter. Since the core ideas of the current dissertation can be discussed without this issue, we believe that this simplification in the formal treatment does not have significant impact. Note that attribute handling was, in fact, implemented in the relational database approach (Chapter 6), and it was formally discussed in [151].

Example 1 For presenting metamodeling concepts, the object-relational mapping [49] has been se-lected as a running example. In this domain, UML class diagrams are transformed to relational data models, according to the following guidelines. Packages and classes of the class diagram are con-verted one by one to database schemas and tables, respectively. Each association is transformed to a corresponding table as well. Each table has a column with primary key for storing identifiers, and one column for each attribute of the original class or association. Inheritance is reflected in relational databases as foreign key constraints. Finally, structural well-formedness criteria defined by association ends are also represented by foreign key constraints in the database.

9

10 CHAPTER 2. GRAPH MODELS

The metamodels of UML class diagrams and relational database schemas (following the CWM standard [108]) are depicted in Fig. 2.1. In order to avoid complex figures, only the relevant parts of the metamodel are presented.

Figure 2.1: Metamodel of the problem domain

The metamodel consists of 16 classes including elements of UML class diagrams such asFeature,

Class, and Association, and of relational database concepts such asTable, Schema, andColumn. Note that the CWM standard derives database notions from UML notions by inheritance as in case of class

Column, which is inherited from classAttribute(see Fig. 2.1).

Association (structural feature type)SFTconnects classesFeatureandClass. An at most one mul-tiplicity constraint can be found at the end of association SFTthat is next to class Class expressing that eachFeaturecan have at most oneClassas its type. However, in the other direction, an arbitrary multiplicity constraint holds, which means that eachClassmay denote the type of manyFeatures.

Furthermore, we use reference edgesRef(denoted by dashed lines in instance models) for connect-ing source and target model nodes despite they are not included in the CWM standard.

Formalization

Now the formalization of concepts related to metamodels is presented by following the notation of [151].

Definition 1 Adirected graph(denoted byG= (VG, EG, srcG, trgG)) is a 4-tuple, whereVGandEG denote nodes and edges of the graph, respectively. FunctionssrcG : EG→VGandtrgG : EG→VG map edges to their source and target node, respectively.

Definition 2 Ametamodel(denoted byM M) is a directed graph, where

• VM M andEM Mdenote nodes and edges of the metamodel;

• aclassCis a node of the metamodel, formally,C∈VM M;

• associations (Assoc) and generalization (inheritance) edges (Inher) constitute a (distinct and complete) partition of edges, formally,EM M =Assoc∪Inher, Assoc∩Inher=∅;

• associations can be further partitioned into ’many-to-many’ (AssocM2M) and ’many-to-one’ (AssocM2O) associations, formally, Assoc = AssocM2M ∪ AssocM2O, AssocM2M ∩ AssocM2O=∅