SlideShare a Scribd company logo
1 of 16
Download to read offline
Efficient Validation of Large Models using
the Mogwaï Tool
Gwendal Daniel
Introduction
 Large models are not a research chimera!
 Civil engineering
 Biology
 Reverse engineering
 Need to provide solutions to
 Store large models
 Efficiently query, transform and validate them
Model Persistence
 Default serialization mechanism: XMI
 Scalable model persistence frameworks
 Use databases to store models
 Relational: CDO
 NoSQL: Morsa, NeoEMF
 Advanced features (versioning, collaborative editing, transactions)
 Low memory footprint
Model Queries and Transformations
API Call1
…
API Calln
OCL
Query
OCL
Interpreter
EMF API Database
Package.allInstances().name
get(p1)
get(p1,name)
…
get(pn)
get(pn,name)
Low-level modeling API
→ Not aligned with the
database capabilities
Fragmented queries
→ Not efficient
→ Remote database
Intermediate objects
→ Memory consumption
→ Execution time overhead
Model Queries and Transformations
 Not efficient to compute model queries and transformations
 Why can’t we write database queries manually?
 Model 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!
Mogwaï
 Translation engine
 Support for OCL and ATL
 Generates generic Gremlin traversals
 Backend-agnostic queries
 Model datastore
 Abstraction layer on top of the backend
 Defines query and transformation primitives
 Implementations for NeoEMF, Neo4j3, and experimental Jdbc support
Mogwaï
Mogwaï
Translation Engine
Model
Database
Model Query
Gremlin
Script
Model Datastore
Impl.
uses
e1: El
Model Datastore
Definition
uses
implements
Database
results
e1: El
e1: ElModel
Elements
v1
v3
v2Reification
Model Validation
Mogwaï efficiently supports model queries and transformations
What about model validation?
 Two-step process
 Find the elements to check (i.e. involved in at least one constraint)
 Typically costly in scalable model persistence frameworks
 Check the constraints for each elements
 Efficiently computed by Mogwaï query engine
 Can we optimize this two step process to benefit from Mogwaï?
Model Validation
Mogwaï
Translation Engine
Model
Database
Model Constraints
Gremlin
Script
Model Datastore
Impl.
uses
e1: El
Model Datastore
Definition
uses
implements
Database
results
e1: El
e1: ElModel
Elements
v1
v3
v2Reification
Constraint
Pre-processing
Constraint pre-processing
context Client inv validClient:
self.hasPaid implies self.orders.products
->forAll(p | p.price > 0)
Constraint Rewriting
• Based on existing work
1- Find all the Clients
2- Evaluate validClient for each
Client instance
Client.allInstances()->select(c | !(c.hasPaid implies
c.orders.products->forAll(p.price > 0)))
Constraint Rewriting
 Systematic mapping
 Translate context-specific constraints into global queries
 Local optimizations
 Mogwaï benefits
 Efficient allInstances() computation
 Execute a single query
 Return all the instances violating the constraint
Evaluation
0
1000
2000
3000
4000
5000
6000
7000
8000
9000
10000
MDT OCL Standard AllInstances + Mogwaï Pre-processing + Mogwaï
Model Validation Execution Time (ms)
NotEmptyClassName ValidJavadocTags
Benchmarks
Java Model
~ 80 000 elements
3 configurations / 2 constraints
Evaluation
0
20
40
60
80
100
120
140
MDT OCL Standard AllInstances + Mogwaï Pre-processing + Mogwaï
Model Validation Memory Consumption (MB)
NotEmptyClassName ValidJavadocTags
Benchmarks
Java Model
~ 80 000 elements
3 configurations / 2 constraints
Conclusion
 Mogwai
 Translation-based approach
 Standard language support
 No query fragmentation
 Support for various datastores
 Model validation with Mogwaï
 Constraint pre-processing
 Single query execution
 Positive results
Future Work
 Advanced rewriting techniques
 Adapted to the underlying database ‘’schema’’
 Heuristics (number of operations, nested iterators, etc)
 Constraint composition
 Static analysis
 Reuse common parts in constraint navigation paths
 Rewrite a set of constraints
Websites & Software Repositories
NeoEMF: neoemf.com
Mogwaï: github.com/atlanmod/mogwai
gdaniel.github.io

More Related Content

Similar to Efficient Validation of Large Models using the Mogwaï Tool

Clipper: A Low-Latency Online Prediction Serving System
Clipper: A Low-Latency Online Prediction Serving SystemClipper: A Low-Latency Online Prediction Serving System
Clipper: A Low-Latency Online Prediction Serving SystemDatabricks
 
Thesis Defense (Gwendal DANIEL) - Nov 2017
Thesis Defense (Gwendal DANIEL) - Nov 2017Thesis Defense (Gwendal DANIEL) - Nov 2017
Thesis Defense (Gwendal DANIEL) - Nov 2017Gwendal Daniel
 
Clipper at UC Berkeley RISECamp 2017
Clipper at UC Berkeley RISECamp 2017Clipper at UC Berkeley RISECamp 2017
Clipper at UC Berkeley RISECamp 2017Dan Crankshaw
 
EMF-IncQuery presentation at TOOLS 2012
EMF-IncQuery presentation at TOOLS 2012EMF-IncQuery presentation at TOOLS 2012
EMF-IncQuery presentation at TOOLS 2012Istvan Rath
 
Object- Relational Persistence in Smalltalk
Object- Relational Persistence in SmalltalkObject- Relational Persistence in Smalltalk
Object- Relational Persistence in SmalltalkESUG
 
Real-world Entity Framework
Real-world Entity FrameworkReal-world Entity Framework
Real-world Entity FrameworkLynn Langit
 
Pragmatic Architecture in .NET
Pragmatic Architecture in .NETPragmatic Architecture in .NET
Pragmatic Architecture in .NEThousecor
 
Oleksii Moskalenko "Continuous Delivery of ML Pipelines to Production"
Oleksii Moskalenko "Continuous Delivery of ML Pipelines to Production"Oleksii Moskalenko "Continuous Delivery of ML Pipelines to Production"
Oleksii Moskalenko "Continuous Delivery of ML Pipelines to Production"Fwdays
 
Clipper: A Low-Latency Online Prediction Serving System: Spark Summit East ta...
Clipper: A Low-Latency Online Prediction Serving System: Spark Summit East ta...Clipper: A Low-Latency Online Prediction Serving System: Spark Summit East ta...
Clipper: A Low-Latency Online Prediction Serving System: Spark Summit East ta...Spark Summit
 
Agile Development in .NET
Agile Development in .NETAgile Development in .NET
Agile Development in .NETdanhermes
 
Tensors Are All You Need: Faster Inference with Hummingbird
Tensors Are All You Need: Faster Inference with HummingbirdTensors Are All You Need: Faster Inference with Hummingbird
Tensors Are All You Need: Faster Inference with HummingbirdDatabricks
 
From Hours to Minutes: The Journey of Optimizing Mask-RCNN and BERT Using MXNet
From Hours to Minutes: The Journey of Optimizing Mask-RCNN and BERT Using MXNetFrom Hours to Minutes: The Journey of Optimizing Mask-RCNN and BERT Using MXNet
From Hours to Minutes: The Journey of Optimizing Mask-RCNN and BERT Using MXNetEric Haibin Lin
 
IncQuery-D: Incremental Queries in the Cloud
IncQuery-D: Incremental Queries in the CloudIncQuery-D: Incremental Queries in the Cloud
IncQuery-D: Incremental Queries in the CloudGábor Szárnyas
 
Towards a Macrobenchmark Framework for Performance Analysis of Java Applications
Towards a Macrobenchmark Framework for Performance Analysis of Java ApplicationsTowards a Macrobenchmark Framework for Performance Analysis of Java Applications
Towards a Macrobenchmark Framework for Performance Analysis of Java ApplicationsGábor Szárnyas
 
How to Create Your Own Product-Modeling Environment
How to Create Your Own Product-Modeling EnvironmentHow to Create Your Own Product-Modeling Environment
How to Create Your Own Product-Modeling EnvironmentTim Geisler
 
Using Grid Technologies in the Cloud for High Scalability
Using Grid Technologies in the Cloud for High ScalabilityUsing Grid Technologies in the Cloud for High Scalability
Using Grid Technologies in the Cloud for High Scalabilitymabuhr
 
Camunda BPM 7.2: Performance and Scalability (English)
Camunda BPM 7.2: Performance and Scalability (English)Camunda BPM 7.2: Performance and Scalability (English)
Camunda BPM 7.2: Performance and Scalability (English)camunda services GmbH
 
NoSQL Introduction, Theory, Implementations
NoSQL Introduction, Theory, ImplementationsNoSQL Introduction, Theory, Implementations
NoSQL Introduction, Theory, ImplementationsFirat Atagun
 

Similar to Efficient Validation of Large Models using the Mogwaï Tool (20)

Clipper: A Low-Latency Online Prediction Serving System
Clipper: A Low-Latency Online Prediction Serving SystemClipper: A Low-Latency Online Prediction Serving System
Clipper: A Low-Latency Online Prediction Serving System
 
Thesis Defense (Gwendal DANIEL) - Nov 2017
Thesis Defense (Gwendal DANIEL) - Nov 2017Thesis Defense (Gwendal DANIEL) - Nov 2017
Thesis Defense (Gwendal DANIEL) - Nov 2017
 
Clipper at UC Berkeley RISECamp 2017
Clipper at UC Berkeley RISECamp 2017Clipper at UC Berkeley RISECamp 2017
Clipper at UC Berkeley RISECamp 2017
 
EMF-IncQuery presentation at TOOLS 2012
EMF-IncQuery presentation at TOOLS 2012EMF-IncQuery presentation at TOOLS 2012
EMF-IncQuery presentation at TOOLS 2012
 
Object- Relational Persistence in Smalltalk
Object- Relational Persistence in SmalltalkObject- Relational Persistence in Smalltalk
Object- Relational Persistence in Smalltalk
 
Real-world Entity Framework
Real-world Entity FrameworkReal-world Entity Framework
Real-world Entity Framework
 
Pragmatic Architecture in .NET
Pragmatic Architecture in .NETPragmatic Architecture in .NET
Pragmatic Architecture in .NET
 
Oleksii Moskalenko "Continuous Delivery of ML Pipelines to Production"
Oleksii Moskalenko "Continuous Delivery of ML Pipelines to Production"Oleksii Moskalenko "Continuous Delivery of ML Pipelines to Production"
Oleksii Moskalenko "Continuous Delivery of ML Pipelines to Production"
 
Clipper: A Low-Latency Online Prediction Serving System: Spark Summit East ta...
Clipper: A Low-Latency Online Prediction Serving System: Spark Summit East ta...Clipper: A Low-Latency Online Prediction Serving System: Spark Summit East ta...
Clipper: A Low-Latency Online Prediction Serving System: Spark Summit East ta...
 
Agile Development in .NET
Agile Development in .NETAgile Development in .NET
Agile Development in .NET
 
Tensors Are All You Need: Faster Inference with Hummingbird
Tensors Are All You Need: Faster Inference with HummingbirdTensors Are All You Need: Faster Inference with Hummingbird
Tensors Are All You Need: Faster Inference with Hummingbird
 
From Hours to Minutes: The Journey of Optimizing Mask-RCNN and BERT Using MXNet
From Hours to Minutes: The Journey of Optimizing Mask-RCNN and BERT Using MXNetFrom Hours to Minutes: The Journey of Optimizing Mask-RCNN and BERT Using MXNet
From Hours to Minutes: The Journey of Optimizing Mask-RCNN and BERT Using MXNet
 
NoSQL and ACID
NoSQL and ACIDNoSQL and ACID
NoSQL and ACID
 
IncQuery-D: Incremental Queries in the Cloud
IncQuery-D: Incremental Queries in the CloudIncQuery-D: Incremental Queries in the Cloud
IncQuery-D: Incremental Queries in the Cloud
 
Apache Drill (ver. 0.2)
Apache Drill (ver. 0.2)Apache Drill (ver. 0.2)
Apache Drill (ver. 0.2)
 
Towards a Macrobenchmark Framework for Performance Analysis of Java Applications
Towards a Macrobenchmark Framework for Performance Analysis of Java ApplicationsTowards a Macrobenchmark Framework for Performance Analysis of Java Applications
Towards a Macrobenchmark Framework for Performance Analysis of Java Applications
 
How to Create Your Own Product-Modeling Environment
How to Create Your Own Product-Modeling EnvironmentHow to Create Your Own Product-Modeling Environment
How to Create Your Own Product-Modeling Environment
 
Using Grid Technologies in the Cloud for High Scalability
Using Grid Technologies in the Cloud for High ScalabilityUsing Grid Technologies in the Cloud for High Scalability
Using Grid Technologies in the Cloud for High Scalability
 
Camunda BPM 7.2: Performance and Scalability (English)
Camunda BPM 7.2: Performance and Scalability (English)Camunda BPM 7.2: Performance and Scalability (English)
Camunda BPM 7.2: Performance and Scalability (English)
 
NoSQL Introduction, Theory, Implementations
NoSQL Introduction, Theory, ImplementationsNoSQL Introduction, Theory, Implementations
NoSQL Introduction, Theory, Implementations
 

Recently uploaded

(9818099198) Call Girls In Noida Sector 14 (NOIDA ESCORTS)
(9818099198) Call Girls In Noida Sector 14 (NOIDA ESCORTS)(9818099198) Call Girls In Noida Sector 14 (NOIDA ESCORTS)
(9818099198) Call Girls In Noida Sector 14 (NOIDA ESCORTS)riyaescorts54
 
Pests of soyabean_Binomics_IdentificationDr.UPR.pdf
Pests of soyabean_Binomics_IdentificationDr.UPR.pdfPests of soyabean_Binomics_IdentificationDr.UPR.pdf
Pests of soyabean_Binomics_IdentificationDr.UPR.pdfPirithiRaju
 
ALL ABOUT MIXTURES IN GRADE 7 CLASS PPTX
ALL ABOUT MIXTURES IN GRADE 7 CLASS PPTXALL ABOUT MIXTURES IN GRADE 7 CLASS PPTX
ALL ABOUT MIXTURES IN GRADE 7 CLASS PPTXDole Philippines School
 
Four Spheres of the Earth Presentation.ppt
Four Spheres of the Earth Presentation.pptFour Spheres of the Earth Presentation.ppt
Four Spheres of the Earth Presentation.pptJoemSTuliba
 
Microphone- characteristics,carbon microphone, dynamic microphone.pptx
Microphone- characteristics,carbon microphone, dynamic microphone.pptxMicrophone- characteristics,carbon microphone, dynamic microphone.pptx
Microphone- characteristics,carbon microphone, dynamic microphone.pptxpriyankatabhane
 
Bioteknologi kelas 10 kumer smapsa .pptx
Bioteknologi kelas 10 kumer smapsa .pptxBioteknologi kelas 10 kumer smapsa .pptx
Bioteknologi kelas 10 kumer smapsa .pptx023NiWayanAnggiSriWa
 
preservation, maintanence and improvement of industrial organism.pptx
preservation, maintanence and improvement of industrial organism.pptxpreservation, maintanence and improvement of industrial organism.pptx
preservation, maintanence and improvement of industrial organism.pptxnoordubaliya2003
 
User Guide: Capricorn FLX™ Weather Station
User Guide: Capricorn FLX™ Weather StationUser Guide: Capricorn FLX™ Weather Station
User Guide: Capricorn FLX™ Weather StationColumbia Weather Systems
 
User Guide: Pulsar™ Weather Station (Columbia Weather Systems)
User Guide: Pulsar™ Weather Station (Columbia Weather Systems)User Guide: Pulsar™ Weather Station (Columbia Weather Systems)
User Guide: Pulsar™ Weather Station (Columbia Weather Systems)Columbia Weather Systems
 
Call Girls in Majnu Ka Tilla Delhi 🔝9711014705🔝 Genuine
Call Girls in Majnu Ka Tilla Delhi 🔝9711014705🔝 GenuineCall Girls in Majnu Ka Tilla Delhi 🔝9711014705🔝 Genuine
Call Girls in Majnu Ka Tilla Delhi 🔝9711014705🔝 Genuinethapagita
 
GenBio2 - Lesson 1 - Introduction to Genetics.pptx
GenBio2 - Lesson 1 - Introduction to Genetics.pptxGenBio2 - Lesson 1 - Introduction to Genetics.pptx
GenBio2 - Lesson 1 - Introduction to Genetics.pptxBerniceCayabyab1
 
《Queensland毕业文凭-昆士兰大学毕业证成绩单》
《Queensland毕业文凭-昆士兰大学毕业证成绩单》《Queensland毕业文凭-昆士兰大学毕业证成绩单》
《Queensland毕业文凭-昆士兰大学毕业证成绩单》rnrncn29
 
Harmful and Useful Microorganisms Presentation
Harmful and Useful Microorganisms PresentationHarmful and Useful Microorganisms Presentation
Harmful and Useful Microorganisms Presentationtahreemzahra82
 
Pests of castor_Binomics_Identification_Dr.UPR.pdf
Pests of castor_Binomics_Identification_Dr.UPR.pdfPests of castor_Binomics_Identification_Dr.UPR.pdf
Pests of castor_Binomics_Identification_Dr.UPR.pdfPirithiRaju
 
Microteaching on terms used in filtration .Pharmaceutical Engineering
Microteaching on terms used in filtration .Pharmaceutical EngineeringMicroteaching on terms used in filtration .Pharmaceutical Engineering
Microteaching on terms used in filtration .Pharmaceutical EngineeringPrajakta Shinde
 
FREE NURSING BUNDLE FOR NURSES.PDF by na
FREE NURSING BUNDLE FOR NURSES.PDF by naFREE NURSING BUNDLE FOR NURSES.PDF by na
FREE NURSING BUNDLE FOR NURSES.PDF by naJASISJULIANOELYNV
 
basic entomology with insect anatomy and taxonomy
basic entomology with insect anatomy and taxonomybasic entomology with insect anatomy and taxonomy
basic entomology with insect anatomy and taxonomyDrAnita Sharma
 
BIOETHICS IN RECOMBINANT DNA TECHNOLOGY.
BIOETHICS IN RECOMBINANT DNA TECHNOLOGY.BIOETHICS IN RECOMBINANT DNA TECHNOLOGY.
BIOETHICS IN RECOMBINANT DNA TECHNOLOGY.PraveenaKalaiselvan1
 
Forensic limnology of diatoms by Sanjai.pptx
Forensic limnology of diatoms by Sanjai.pptxForensic limnology of diatoms by Sanjai.pptx
Forensic limnology of diatoms by Sanjai.pptxkumarsanjai28051
 

Recently uploaded (20)

Hot Sexy call girls in Moti Nagar,🔝 9953056974 🔝 escort Service
Hot Sexy call girls in  Moti Nagar,🔝 9953056974 🔝 escort ServiceHot Sexy call girls in  Moti Nagar,🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Moti Nagar,🔝 9953056974 🔝 escort Service
 
(9818099198) Call Girls In Noida Sector 14 (NOIDA ESCORTS)
(9818099198) Call Girls In Noida Sector 14 (NOIDA ESCORTS)(9818099198) Call Girls In Noida Sector 14 (NOIDA ESCORTS)
(9818099198) Call Girls In Noida Sector 14 (NOIDA ESCORTS)
 
Pests of soyabean_Binomics_IdentificationDr.UPR.pdf
Pests of soyabean_Binomics_IdentificationDr.UPR.pdfPests of soyabean_Binomics_IdentificationDr.UPR.pdf
Pests of soyabean_Binomics_IdentificationDr.UPR.pdf
 
ALL ABOUT MIXTURES IN GRADE 7 CLASS PPTX
ALL ABOUT MIXTURES IN GRADE 7 CLASS PPTXALL ABOUT MIXTURES IN GRADE 7 CLASS PPTX
ALL ABOUT MIXTURES IN GRADE 7 CLASS PPTX
 
Four Spheres of the Earth Presentation.ppt
Four Spheres of the Earth Presentation.pptFour Spheres of the Earth Presentation.ppt
Four Spheres of the Earth Presentation.ppt
 
Microphone- characteristics,carbon microphone, dynamic microphone.pptx
Microphone- characteristics,carbon microphone, dynamic microphone.pptxMicrophone- characteristics,carbon microphone, dynamic microphone.pptx
Microphone- characteristics,carbon microphone, dynamic microphone.pptx
 
Bioteknologi kelas 10 kumer smapsa .pptx
Bioteknologi kelas 10 kumer smapsa .pptxBioteknologi kelas 10 kumer smapsa .pptx
Bioteknologi kelas 10 kumer smapsa .pptx
 
preservation, maintanence and improvement of industrial organism.pptx
preservation, maintanence and improvement of industrial organism.pptxpreservation, maintanence and improvement of industrial organism.pptx
preservation, maintanence and improvement of industrial organism.pptx
 
User Guide: Capricorn FLX™ Weather Station
User Guide: Capricorn FLX™ Weather StationUser Guide: Capricorn FLX™ Weather Station
User Guide: Capricorn FLX™ Weather Station
 
User Guide: Pulsar™ Weather Station (Columbia Weather Systems)
User Guide: Pulsar™ Weather Station (Columbia Weather Systems)User Guide: Pulsar™ Weather Station (Columbia Weather Systems)
User Guide: Pulsar™ Weather Station (Columbia Weather Systems)
 
Call Girls in Majnu Ka Tilla Delhi 🔝9711014705🔝 Genuine
Call Girls in Majnu Ka Tilla Delhi 🔝9711014705🔝 GenuineCall Girls in Majnu Ka Tilla Delhi 🔝9711014705🔝 Genuine
Call Girls in Majnu Ka Tilla Delhi 🔝9711014705🔝 Genuine
 
GenBio2 - Lesson 1 - Introduction to Genetics.pptx
GenBio2 - Lesson 1 - Introduction to Genetics.pptxGenBio2 - Lesson 1 - Introduction to Genetics.pptx
GenBio2 - Lesson 1 - Introduction to Genetics.pptx
 
《Queensland毕业文凭-昆士兰大学毕业证成绩单》
《Queensland毕业文凭-昆士兰大学毕业证成绩单》《Queensland毕业文凭-昆士兰大学毕业证成绩单》
《Queensland毕业文凭-昆士兰大学毕业证成绩单》
 
Harmful and Useful Microorganisms Presentation
Harmful and Useful Microorganisms PresentationHarmful and Useful Microorganisms Presentation
Harmful and Useful Microorganisms Presentation
 
Pests of castor_Binomics_Identification_Dr.UPR.pdf
Pests of castor_Binomics_Identification_Dr.UPR.pdfPests of castor_Binomics_Identification_Dr.UPR.pdf
Pests of castor_Binomics_Identification_Dr.UPR.pdf
 
Microteaching on terms used in filtration .Pharmaceutical Engineering
Microteaching on terms used in filtration .Pharmaceutical EngineeringMicroteaching on terms used in filtration .Pharmaceutical Engineering
Microteaching on terms used in filtration .Pharmaceutical Engineering
 
FREE NURSING BUNDLE FOR NURSES.PDF by na
FREE NURSING BUNDLE FOR NURSES.PDF by naFREE NURSING BUNDLE FOR NURSES.PDF by na
FREE NURSING BUNDLE FOR NURSES.PDF by na
 
basic entomology with insect anatomy and taxonomy
basic entomology with insect anatomy and taxonomybasic entomology with insect anatomy and taxonomy
basic entomology with insect anatomy and taxonomy
 
BIOETHICS IN RECOMBINANT DNA TECHNOLOGY.
BIOETHICS IN RECOMBINANT DNA TECHNOLOGY.BIOETHICS IN RECOMBINANT DNA TECHNOLOGY.
BIOETHICS IN RECOMBINANT DNA TECHNOLOGY.
 
Forensic limnology of diatoms by Sanjai.pptx
Forensic limnology of diatoms by Sanjai.pptxForensic limnology of diatoms by Sanjai.pptx
Forensic limnology of diatoms by Sanjai.pptx
 

Efficient Validation of Large Models using the Mogwaï Tool

  • 1. Efficient Validation of Large Models using the Mogwaï Tool Gwendal Daniel
  • 2. Introduction  Large models are not a research chimera!  Civil engineering  Biology  Reverse engineering  Need to provide solutions to  Store large models  Efficiently query, transform and validate them
  • 3. Model Persistence  Default serialization mechanism: XMI  Scalable model persistence frameworks  Use databases to store models  Relational: CDO  NoSQL: Morsa, NeoEMF  Advanced features (versioning, collaborative editing, transactions)  Low memory footprint
  • 4. Model Queries and Transformations API Call1 … API Calln OCL Query OCL Interpreter EMF API Database Package.allInstances().name get(p1) get(p1,name) … get(pn) get(pn,name) Low-level modeling API → Not aligned with the database capabilities Fragmented queries → Not efficient → Remote database Intermediate objects → Memory consumption → Execution time overhead
  • 5. Model Queries and Transformations  Not efficient to compute model queries and transformations  Why can’t we write database queries manually?  Model 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!
  • 6. Mogwaï  Translation engine  Support for OCL and ATL  Generates generic Gremlin traversals  Backend-agnostic queries  Model datastore  Abstraction layer on top of the backend  Defines query and transformation primitives  Implementations for NeoEMF, Neo4j3, and experimental Jdbc support
  • 7. Mogwaï Mogwaï Translation Engine Model Database Model Query Gremlin Script Model Datastore Impl. uses e1: El Model Datastore Definition uses implements Database results e1: El e1: ElModel Elements v1 v3 v2Reification
  • 8. Model Validation Mogwaï efficiently supports model queries and transformations What about model validation?  Two-step process  Find the elements to check (i.e. involved in at least one constraint)  Typically costly in scalable model persistence frameworks  Check the constraints for each elements  Efficiently computed by Mogwaï query engine  Can we optimize this two step process to benefit from Mogwaï?
  • 9. Model Validation Mogwaï Translation Engine Model Database Model Constraints Gremlin Script Model Datastore Impl. uses e1: El Model Datastore Definition uses implements Database results e1: El e1: ElModel Elements v1 v3 v2Reification Constraint Pre-processing
  • 10. Constraint pre-processing context Client inv validClient: self.hasPaid implies self.orders.products ->forAll(p | p.price > 0) Constraint Rewriting • Based on existing work 1- Find all the Clients 2- Evaluate validClient for each Client instance Client.allInstances()->select(c | !(c.hasPaid implies c.orders.products->forAll(p.price > 0)))
  • 11. Constraint Rewriting  Systematic mapping  Translate context-specific constraints into global queries  Local optimizations  Mogwaï benefits  Efficient allInstances() computation  Execute a single query  Return all the instances violating the constraint
  • 12. Evaluation 0 1000 2000 3000 4000 5000 6000 7000 8000 9000 10000 MDT OCL Standard AllInstances + Mogwaï Pre-processing + Mogwaï Model Validation Execution Time (ms) NotEmptyClassName ValidJavadocTags Benchmarks Java Model ~ 80 000 elements 3 configurations / 2 constraints
  • 13. Evaluation 0 20 40 60 80 100 120 140 MDT OCL Standard AllInstances + Mogwaï Pre-processing + Mogwaï Model Validation Memory Consumption (MB) NotEmptyClassName ValidJavadocTags Benchmarks Java Model ~ 80 000 elements 3 configurations / 2 constraints
  • 14. Conclusion  Mogwai  Translation-based approach  Standard language support  No query fragmentation  Support for various datastores  Model validation with Mogwaï  Constraint pre-processing  Single query execution  Positive results
  • 15. Future Work  Advanced rewriting techniques  Adapted to the underlying database ‘’schema’’  Heuristics (number of operations, nested iterators, etc)  Constraint composition  Static analysis  Reuse common parts in constraint navigation paths  Rewrite a set of constraints
  • 16. Websites & Software Repositories NeoEMF: neoemf.com Mogwaï: github.com/atlanmod/mogwai gdaniel.github.io