Gremlin-ATL: a Scalable Model Transformation Framework

14
Gremlin-ATL: a Scalable Model Transformation Framework Gwendal DANIEL Inria, IMT Atlantique, LS2N [email protected] Frédéric JOUAULT ESEO [email protected] Gerson SUNYE Inria, IMT Atlantique, LS2N [email protected] Jordi CABOT ICREA - UOC [email protected]

Transcript of Gremlin-ATL: a Scalable Model Transformation Framework

Page 1: Gremlin-ATL: a Scalable Model Transformation Framework

Gremlin-ATL: a Scalable Model Transformation Framework

Gwendal DANIELInria, IMT Atlantique, LS2N

[email protected]

Frédéric JOUAULTESEO

[email protected]

Gerson SUNYEInria, IMT Atlantique, LS2N

[email protected]

Jordi CABOTICREA - UOC

[email protected]

Page 2: Gremlin-ATL: a Scalable Model Transformation Framework

Introduction

• Complex and large models• Civil Engineering

• Biology

• Reverse Engineering

• Need to provide solutions to• Store large models

• Efficiently query them

• Compute complex transformations

2G. Daniel - Gremlin-ATL: a Scalable Model Transformation Framework

Page 3: Gremlin-ATL: a Scalable Model Transformation Framework

Model Persistence

• Default serialization mechanism: XMI

• Scalable model persistence frameworks

• Use databases to store models

• Relational: CDO

• NoSQL: Morsa, NeoEMF

• Low memory footprint

3G. Daniel - Gremlin-ATL: a Scalable Model Transformation Framework

Modeling API

ModelingFramework

DatabaseModeler

Page 4: Gremlin-ATL: a Scalable Model Transformation Framework

Model Persistence

API Call1…

API Calln

ModelTransformation

TransformationEngine

ModelingFramework

Database

rule myRule {from pp : In!Personto ee: Out!Entity (

name <- p.name)

}

get(pp1)get(pp1, name)create(ee1, Entity)set(ee1, name)…get(ppn)get(ppn, name)create(een, Entity)set(een, name)

Typical Model Transformation Tool

Under the hood

4

Low-level modeling API→ Not aligned with thedatabase capabilities

Fragmented queries→ Not efficient→ Remote database

Intermediate objects→ Memory consumption→ Execution time overhead

G. Daniel - Gremlin-ATL: a Scalable Model Transformation Framework

Page 5: Gremlin-ATL: a Scalable Model Transformation Framework

Model Persistence

• Not efficient to compute model queries and transformations

• Why can’t we write database queries manually?• Modern persistence frameworks typically rely on NoSQL databases

• Multiple query languages, data representation, etc

• Low-level queries are hard to understand and maintain

• Modeling expertise vs. Database expertise

• Solution: generate them!

5G. Daniel - Gremlin-ATL: a Scalable Model Transformation Framework

Page 6: Gremlin-ATL: a Scalable Model Transformation Framework

Gremlin-ATL• Generate database queries from model transformations

• Bypass modeling framework APIs

• Benefit of all the query capabilities of the backend

6

ATLtoGremlinTransformation

GremlinTraversal

DatabaseATL Transformation

G. Daniel - Gremlin-ATL: a Scalable Model Transformation Framework

rule myRule {from pp : In!Personto ee: Out!Entity (

name <- pp.name)

}

g.idx(‘’metaclasses’’)[[name:Person]].transform{ee = g.createVertex(Entity);e.addEdge(‘’instanceof’’,

g.idx(‘’metaclasses’’)[[name:Entity]]ee.name = it.name

}.iterate();Database

Gremlin-ATLTransformation Tool

Under the hood

Page 7: Gremlin-ATL: a Scalable Model Transformation Framework

Gremlin-ATL

• Input: ATL

• Well-known in the modelingcommunity

• Hybrid language

• Transformation rules

• Embeds OCL

rule myRule {from pp : In!Person (

not pp.name.isEmpty())to ee : Out!Entity(

name ← pp.name}

7G. Daniel - Gremlin-ATL: a Scalable Model Transformation Framework

Page 8: Gremlin-ATL: a Scalable Model Transformation Framework

Gremlin-ATL

• Output: Gremlin

• Multi-database query language

• Graph traversals

• Easily extensible

• Native Neo4j support, OrientDB …

• NeoEMF/Graph

g.idx(‘metaclasses’)[[name:Person]].inE(‘instanceOf’).outV.filter{!it.name.isEmtpy()}.transform{

ee = g.createVertex();ee.addEdge(‘instanceOf’, g.idx(‘metaclasses’)[[name:Entity]]); ee.name = it.name;

}.iterate()

8G. Daniel - Gremlin-ATL: a Scalable Model Transformation Framework

Page 9: Gremlin-ATL: a Scalable Model Transformation Framework

rule myRule {from pp : In!Person (

not pp.name.isEmpty())to ee : Out!Entity(

name ← pp.name)

}

Gremlin-ATL

• 3 steps process• Map ATL constructs to their Gremlin equivalent

• Merge the created Gremlin constructs into a script

• Send the script to the database

9

g.idx(‘metaclasses’)[[name:Person]].inE(‘instanceOf’).outV

.filter{!it.name.isEmtpy()}

.transform{ee = g.createVertex();ee.addEdge(‘instanceOf’, g.idx(‘metaclasses’)[[name:Entity]]);

ee.name = it.name;}.iterate()

G. Daniel - Gremlin-ATL: a Scalable Model Transformation Framework

Page 10: Gremlin-ATL: a Scalable Model Transformation Framework

Evaluation

10

0

50000

100000

150000

200000

250000

300000

set1 set2 set3 set4

Java2KDM Execution Time (ms)

ATL Gremlin-ATL

OutOfMemory

G. Daniel - Gremlin-ATL: a Scalable Model Transformation Framework

Models containing 6000 to 3,5M elementsJava2KDM TransformationNeoEMF/Graph

Page 11: Gremlin-ATL: a Scalable Model Transformation Framework

Evaluation

11G. Daniel - Gremlin-ATL: a Scalable Model Transformation Framework

Models containing 6000 to 3,5M elementsJava2KDM TransformationNeoEMF/Graph

0

100

200

300

400

500

600

set1 set2 set3 set4

Java2KDM Memory Consumption (MB)

ATL Gremlin-ATL

OutOfMemory

Page 12: Gremlin-ATL: a Scalable Model Transformation Framework

Conclusion

• Benefits

• No query fragmentation / intermediate objects

• Positive results on large models

• Extensible architecture (see our article)

• Drawbacks

• Less efficient than existing solutions for small / in-memory models

• Need to be manually integrated

• Tightly coupled to the model persistence framework

12G. Daniel - Gremlin-ATL: a Scalable Model Transformation Framework

Page 13: Gremlin-ATL: a Scalable Model Transformation Framework

Conclusion

• Future Work• Extend our mapping

• Reuse schema inferrence approaches• Ease the integration of other persistence frameworks / data sources

• Gremlin-ATL to express data migration operations• Promising results on the Neo4j panama paper database (see our article)

13G. Daniel - Gremlin-ATL: a Scalable Model Transformation Framework

Page 14: Gremlin-ATL: a Scalable Model Transformation Framework

Question?

Thank you for your attention!

Websites / RepositoriesNeoEMF: neoemf.comGremlin-ATL: github.com/atlanmod/mogwai

https://github.com/SOM-Research

https://github.com/AtlanMod

14G. Daniel - Gremlin-ATL: a Scalable Model Transformation Framework