Main Page/Resources/MTBenchmark/Class2Relational

From Atenea

Jump to: navigation, search

Contents

Class2Relational

We have modified the well-known Class2Relational case study (also the input metamodel) and obtained 18 different (simplified in terms of number of rules) versions where each of them considers a different set of rule features. In this way, we start with a case study where there is only one rule and it contains no binding, and then we extend it considering different filter conditions (simple ones and with collections involved), bindings, resolutions of traces, different cardinalities in the rules, etc.

Metamodels

Input metamodel

Download Class.ecore or show Class.ecore tree view


Image:ClassMM.png

Output metamodel

Download Relational.ecore or show Relational.ecore tree view

Image:Relatinal.png

Transformations

As an example, in the following we show the ATL transformations for every one of the Class2Relational scenarios we have considered.


Case 0

Download Case0.atl from here.

rule Rule1 {
   from
      c1 : MM!Class
   to 
      t1 : MM1!Table
}

Case 1

Download Case1.atl from here.

rule Rule1 {
   from
      c1 : MM!Class
   to 
      t1 : MM1!Table (
         name <- c1.name
      )
}

Case 2

Download Case2.atl from here.

rule Rule2 {
   from
      c1 : MM!Class (not c1.isAbstract)
   to 
      t1 : MM1!Table (
         name <- c1.name
      )
}

Case 3

Download Case3.atl from here.

rule Rule3 {
   from
      c1 : MM!Class (c1.att -> notEmpty())
   to 
      t1 : MM1!Table (
         name <- c1.name
      )
}

Case 4

Download Case4.atl from here.

rule Rule4 {
   from
      c1 : MM!Class (MM!Attribute->allInstances()->exists(a | c1.att->includes(a)))
   to 
      t1 : MM1!Table (
         name <- c1.name
      )
}

Case 5

Download Case5.atl from here.

rule Rule51 {
   from
      c1 : MM!Class
   to 
      t1 : MM1!Table (
         name <- c1.name,
         col <- c1.att
      )
}
rule Rule52 {
   from
      a1 : MM!Attribute
   to 
      c1 : MM1!Column (
         name <- a1.name
      )
}

Case 6

Download Case6.atl from here.

rule Rule61 {
   from
      c1 : MM!Class (not c1.isAbstract)
   to 
      t1 : MM1!Table (
         name <- c1.name,
         col <- c1.att
      )
}
rule Rule62 {
   from
      a1 : MM!Attribute
   to 
      c1 : MM1!Column (
         name <- a1.name
      )
}

Case 7

Download Case7.atl from here.

rule Rule71 {
   from
      c1 : MM!Class (c1.att -> notEmpty())
   to 
      t1 : MM1!Table (
         name <- c1.name,
         col <- c1.att
      )
} 
rule Rule72 {
   from
      a1 : MM!Attribute
   to 
      c1 : MM1!Column (
         name <- a1.name
      )
}

Case 8

Download Case8.atl from here.

rule Rule81 {
   from
      c1 : MM!Class (MM!Attribute->allInstances()->exists(a | c1.att->includes(a)))
   to 
      t1 : MM1!Table (
         name <- c1.name,
         col <- c1.att
      )
} 
rule Rule82 {
   from
      a1 : MM!Attribute
   to 
      c1 : MM1!Column (
         name <- a1.name
      )
}

Case 9

Download Case9.atl from here.

rule Rule91 {
   from
      c1 : MM!Class
   to 
      t1 : MM1!Table (
         name <- c1.name
      )
} 
rule Rule92 {
   from
      a1 : MM!Attribute
   to 
      c1 : MM1!Column (
         name <- a1.name
      )
}

Case 10

Download Case10.atl from here.

rule Rule10 {
   from
      a1 : MM!Attribute
   to 
      c1 : MM1!Column (
         name <- a1.owner.name + '-' + a1.name
      )
}

Case 11

Download Case11.atl from here.

rule Rule11 {
   from
      c1 : MM!Class
   to 
      t1 : MM1!Table (
         name <- c1.name
      ),
      col1 : MM1!Column (
         name <- c1.name + 'key'
      )
}

Case 12

Download Case12.atl from here.

rule Rule12 {
   from
      c : MM!Class,
      a : MM!Attribute
   to 
      c1 : MM1!Column (
         name <- c.name + '-' + a.name
      )
}

Case 13

Download Case13.atl from here.

rule Rule13 {
   from
      c : MM!Class,
      a : MM!Attribute (not c.isAbstract)
   to 
      c1 : MM1!Column (
         name <- c.name + '-' + a.name
      )
}

Case 14

Download Case14.atl from here.

rule Rule14 {
   from
      c : MM!Class,
      a : MM!Attribute (c.att -> notEmpty())
   to 
      c1 : MM1!Column (
         name <- c.name + '-' + a.name
   )
}

Case 15

Download Case15.atl from here.

rule Rule15 {
   from
      c : MM!Class,
      a : MM!Attribute
   to 
      t : MM1!Table (
         name <- c.name          
      ),
      c1 : MM1!Column (
         name <- c.name + '-' + a.name
      )
}

Case 16

Download Case16.atl from here.

rule Rule16 {
   from
      c : MM!Class,
      a : MM!Attribute (c.att->includes(a))
   to 
      t : MM1!Table (
         name <- c.name          
      ),
      c1 : MM1!Column (
         name <- c.name + '-' + a.name
      )
}

Case 17

Download Case17.atl from here.

helper context MM!Class def : check : Boolean = 
   self.att -> notEmpty() and not self.isAbstract
; 
helper context MM!Attribute def : check : Boolean = 
   not self.owner.isAbstract
;
rule Rule1 {
   from
      c1 : MM!Class (c1.check)
   to 
      t1 : MM1!Table (
         name <- c1.name,
         col <- c1.att
      )
}
rule Rule2 {
   from
      a1 : MM!Attribute (a1.check)
   to 
      c1 : MM1!Column (
         name <- a1.name
      )
}

Input models

The input models are the same that were presented [here] for the Identity case study.

Personal tools