SlideShare une entreprise Scribd logo
Query Views Transformations
QVT
QVT - Overview
• QVT stands for Query/Views/Transformations
• OMG standard language for expressing queries, views,
and transformations on MOF models
• Defines three model transformation languages. All of
them operate on models which conform to MOF 2.0
meta-models
QVT Transformation Languages
• QVT-Operational Mappings
• imperative language designed for writing unidirectional
transformations
• QVT-Relations
• declarative language designed to permit both unidirectional
and bidirectional model transformations
• QVT-Core
• declarative language designed to be simple and to act as
the target of translation from QVT-Relations
QVT Operational Structure
QVT MMb
Mb
conformsTo
conformsTo
based on
conformsTo
conformsTo
MOF
MMa
Ma
conformsTo
conformsTo
conformsTo
M1
M2
M3
Engine
Tab
based on
input output
executed
Operational Mappings in Use
• Case study: Flattening UML class hierarchies
Flattening UML Class Hierarchies
• Given a source UML model, transform it to another UML model
in which only the leaf classes (classes not extended by other
classes) in inheritance hierarchies are kept.
Rules:
• Transform only the leaf classes in the source model
• Include the inherited attributes and associations
• Attributes with the same name override the inherited
attributes
• Copy the primitive types
Example Input Model
name : String
ssn : String
Person
school : String
EnrolledInSchool
organizationName : String
Employed
Student Employee
«primitive type»
String
CarPhDStudent
firstName : String
lastName : String
FullName
name : FullName
Professor
carOwnership
supervisor
name : String
Course
street : String
city : String
Address
residesAtattends
Example Output Model
«primitive type»
String
Carname : String
ssn : String
school : String
PhDStudent
firstName : String
lastName : String
FullName
name : FullName
ssn : String
organizationName : String
Professor
carOwnership
supervisor
name : String
Course
street : String
city : String
Address
residesAtattends residesAt
ModelTransformation Expressed in
Operational Mappings Language
Overall structure of a transformation program:
transformation SimpleUML2FlattenSimpleUML(in source : SimpleUML
out target : SimpleUML);
…………………………………………………………………
main() {}
…………………………………………………………………
…helpers……………………………………………
…mapping operations………………
Signature:
Declares the transformation
name and the source and
target metamodels.
in and out keywords indicate
source and target model
variables.
Entry point:
The execution of the transformation starts here by
executing the operations in the body of main
Transformation elements:
Transformation consists of mapping operations
and helpers. They form the transformation
logic.
Mapping Operations
• A mapping operation maps one or more source
elements into one or more target elements
• Always unidirectional
• Selects source elements on the base of a type and a
Boolean condition (guard)
• Executes operations in its body to create target
elements
• May invoke other mapping operations and may be
invoked
• Mapping operations may be related by inheritance
Mapping Operations: Example (1)
• Consider the rule that transforms only leaf classes
• Selects only classes without subclasses
• Collects all the inherited properties
• Creates new class in the target model
mapping Class::leafClass2Class(in model : Model) : Class
when {not model.allInstances(Generalization)->exists(g |
g.general = self)}
{
name:= self.name;
abstract:= self.abstract;
attributes:=
self.derivedAttributes()->map property2property(self)->asOrderedSet();
}
Operation body
Signature and guard
name:= self.name;
abstract:= self.abstract;
attributes:=
self.derivedAttributes()->map property2property(self)->asOrderedSet();
Mapping Operations: Example (2)
mapping Class::leafClass2Class(in model : Model) : Class
when {not model.allInstances(Generalization)->exists(g |
g.general = self)}
Operation nameSource element
type
An optional sequence of
input/output parameters
Target element type
Guard
Operation Signature and Guard
The Guard is an OCL expression used to filter source elements of a given
type.The mapping operation is executed only on elements for which the
guard expression is evaluated to true.
name:= self.name;
abstract:= self.abstract;
attributes:=
self.derivedAttributes()->map property2property(self)->asOrderedSet();
The predefined variable self refers
to the source element on which the
operation is executed
The left-hand side of the
assignments denotes
properties of the target
element
Invocation of helper derivedAttributes
The keyword map is used to invoke
another mapping operation named
property2property over the
elements returned by the helper
derivedAttributes
Mapping Operations: Example (3)
The mapping operation body contains initialization expressions for the properties of
the target element.When an operation is executed over a source element the self
variable is bound to it and an instance of the target type is created.Then the
operation body is executed.
Operation Body
• Helpers are operations associated to a type that return a
result
• Both primitive and model types can be used
• Helpers may be used to perform complex navigations over
source models
• Helpers have:
• List of input parameters
• An executable body
Helpers
Helpers Example
query Class::derivedAttributes() : OrderedSet(Property){
if self.generalizations->isEmpty() then self.attributes
else
self.attributes->union(
self.generalizations->collect(g |
g.general.derivedAttributes()->select(attr |
not self.attributes->exists(att | att.name = attr.name)
)
)->flatten()
)->asOrderedSet()
endif
}
The context type of the helper
derivedAttributes Result type
Invoking Mapping Operations
……………………………………………………
attributes:=
self.derivedAttributes()->map property2property(self)->asOrderedSet();
……………………………………………………
mapping Property::property2property(in ownerClass : Class) : Property{
name:= self.name;
type:= self.type;
owner:= ownerClass;
}
Invocation of property2property on every
member of the set returned by
derivedAttributes query
Constructs for Managing the Flow of Control
• There are cases where more sophisticated control flow is needed.
The following imperative constructs are available:
• While
• forEach
• Break
• Continue
• If-then-else
QVT Future Improvements
• Tool support is still insufficient
• Many issues need further exploration:
• Performance;
• Testing;
• Scalability of transformations;
• Ease of use;
• Handling change propagation;
• Reuse mechanisms.
Thank you!
Hussein Alshkhir

Contenu connexe

Tendances

Etl - Extract Transform Load
Etl - Extract Transform LoadEtl - Extract Transform Load
Etl - Extract Transform Load
ABDUL KHALIQ
 
All About PL/SQL Collections
All About PL/SQL CollectionsAll About PL/SQL Collections
All About PL/SQL Collections
Steven Feuerstein
 
Food & Beverage Company Business Capability Model
	 Food & Beverage Company Business Capability Model	 Food & Beverage Company Business Capability Model
Food & Beverage Company Business Capability Model
Flevy.com Best Practices
 
Hands On With the Alf Action Language: Making Executable Modeling Even Easier
Hands On With the Alf Action Language: Making Executable Modeling Even EasierHands On With the Alf Action Language: Making Executable Modeling Even Easier
Hands On With the Alf Action Language: Making Executable Modeling Even Easier
Ed Seidewitz
 
C# classes objects
C#  classes objectsC#  classes objects
C# classes objects
Dr.Neeraj Kumar Pandey
 
Introduction to Oracle
Introduction to OracleIntroduction to Oracle
Introduction to Oracle
Achmad Solichin
 
Drv13 power flex 755 programming with devicelogix
Drv13   power flex 755 programming with devicelogixDrv13   power flex 755 programming with devicelogix
Drv13 power flex 755 programming with devicelogix
confidencial
 
Etl techniques
Etl techniquesEtl techniques
Etl techniques
mahezabeenIlkal
 
BPMN 2.0 overview
BPMN 2.0 overviewBPMN 2.0 overview
BPMN 2.0 overview
solomd
 
Unit 5 composite datatypes
Unit 5  composite datatypesUnit 5  composite datatypes
Unit 5 composite datatypes
DrkhanchanaR
 
Doors hints and tips schema
Doors hints and tips schemaDoors hints and tips schema
Doors hints and tips schema
Hazel Woodcock
 
Les01 (retrieving data using the sql select statement)
Les01 (retrieving data using the sql select statement)Les01 (retrieving data using the sql select statement)
Les01 (retrieving data using the sql select statement)
Achmad Solichin
 
Innoslate's Ontology - LML, SysML, DoDAF, and more
Innoslate's Ontology - LML, SysML, DoDAF, and moreInnoslate's Ontology - LML, SysML, DoDAF, and more
Innoslate's Ontology - LML, SysML, DoDAF, and more
Elizabeth Steiner
 
The road to plm
The road to plmThe road to plm
The road to plm
Robert Kennedy
 
CapellaDays2022 | Saratech | Interface Control Document Generation and Linkag...
CapellaDays2022 | Saratech | Interface Control Document Generation and Linkag...CapellaDays2022 | Saratech | Interface Control Document Generation and Linkag...
CapellaDays2022 | Saratech | Interface Control Document Generation and Linkag...
Obeo
 
Ccpp pune
Ccpp puneCcpp pune
Ccpp pune
prabhatjon
 
Builder Design Pattern (Generic Construction -Different Representation)
Builder Design Pattern (Generic Construction -Different Representation)Builder Design Pattern (Generic Construction -Different Representation)
Builder Design Pattern (Generic Construction -Different Representation)
Sameer Rathoud
 
SQL Functions
SQL FunctionsSQL Functions
SQL Functions
ammarbrohi
 
9 Trng6_Change_Management_CIT.pdf
9 Trng6_Change_Management_CIT.pdf9 Trng6_Change_Management_CIT.pdf
9 Trng6_Change_Management_CIT.pdf
RatheshPriyanK1
 

Tendances (20)

Etl - Extract Transform Load
Etl - Extract Transform LoadEtl - Extract Transform Load
Etl - Extract Transform Load
 
All About PL/SQL Collections
All About PL/SQL CollectionsAll About PL/SQL Collections
All About PL/SQL Collections
 
Food & Beverage Company Business Capability Model
	 Food & Beverage Company Business Capability Model	 Food & Beverage Company Business Capability Model
Food & Beverage Company Business Capability Model
 
Hands On With the Alf Action Language: Making Executable Modeling Even Easier
Hands On With the Alf Action Language: Making Executable Modeling Even EasierHands On With the Alf Action Language: Making Executable Modeling Even Easier
Hands On With the Alf Action Language: Making Executable Modeling Even Easier
 
C# classes objects
C#  classes objectsC#  classes objects
C# classes objects
 
Introduction to Oracle
Introduction to OracleIntroduction to Oracle
Introduction to Oracle
 
Drv13 power flex 755 programming with devicelogix
Drv13   power flex 755 programming with devicelogixDrv13   power flex 755 programming with devicelogix
Drv13 power flex 755 programming with devicelogix
 
Etl techniques
Etl techniquesEtl techniques
Etl techniques
 
Masters Marksheet
Masters MarksheetMasters Marksheet
Masters Marksheet
 
BPMN 2.0 overview
BPMN 2.0 overviewBPMN 2.0 overview
BPMN 2.0 overview
 
Unit 5 composite datatypes
Unit 5  composite datatypesUnit 5  composite datatypes
Unit 5 composite datatypes
 
Doors hints and tips schema
Doors hints and tips schemaDoors hints and tips schema
Doors hints and tips schema
 
Les01 (retrieving data using the sql select statement)
Les01 (retrieving data using the sql select statement)Les01 (retrieving data using the sql select statement)
Les01 (retrieving data using the sql select statement)
 
Innoslate's Ontology - LML, SysML, DoDAF, and more
Innoslate's Ontology - LML, SysML, DoDAF, and moreInnoslate's Ontology - LML, SysML, DoDAF, and more
Innoslate's Ontology - LML, SysML, DoDAF, and more
 
The road to plm
The road to plmThe road to plm
The road to plm
 
CapellaDays2022 | Saratech | Interface Control Document Generation and Linkag...
CapellaDays2022 | Saratech | Interface Control Document Generation and Linkag...CapellaDays2022 | Saratech | Interface Control Document Generation and Linkag...
CapellaDays2022 | Saratech | Interface Control Document Generation and Linkag...
 
Ccpp pune
Ccpp puneCcpp pune
Ccpp pune
 
Builder Design Pattern (Generic Construction -Different Representation)
Builder Design Pattern (Generic Construction -Different Representation)Builder Design Pattern (Generic Construction -Different Representation)
Builder Design Pattern (Generic Construction -Different Representation)
 
SQL Functions
SQL FunctionsSQL Functions
SQL Functions
 
9 Trng6_Change_Management_CIT.pdf
9 Trng6_Change_Management_CIT.pdf9 Trng6_Change_Management_CIT.pdf
9 Trng6_Change_Management_CIT.pdf
 

Similaire à Query Views Transformations (QVT)

walkmod - JUG talk
walkmod - JUG talkwalkmod - JUG talk
walkmod - JUG talk
walkmod
 
Angular2 with TypeScript
Angular2 with TypeScript Angular2 with TypeScript
Angular2 with TypeScript
Rohit Bishnoi
 
MDE in Practice
MDE in PracticeMDE in Practice
MDE in Practice
Abdalmassih Yakeen
 
Predictable reactive state management - ngrx
Predictable reactive state management - ngrxPredictable reactive state management - ngrx
Predictable reactive state management - ngrx
Ilia Idakiev
 
MOSKitt Transformations And Traceability
MOSKitt Transformations And TraceabilityMOSKitt Transformations And Traceability
MOSKitt Transformations And Traceability
Javier Muñoz
 
Introduction to UML
Introduction to UMLIntroduction to UML
graph
graphgraph
Streams in Java 8
Streams in Java 8Streams in Java 8
Streams in Java 8
Tobias Coetzee
 
uml.ppt
uml.pptuml.ppt
uml.ppt
RojaPogul1
 
C language
C languageC language
C language
Robo India
 
Rdbms chapter 1 function
Rdbms chapter 1 functionRdbms chapter 1 function
Rdbms chapter 1 function
dipumaliy
 
Cs 1023 lec 10 uml (week 3)
Cs 1023 lec 10 uml (week 3)Cs 1023 lec 10 uml (week 3)
Cs 1023 lec 10 uml (week 3)
stanbridge
 
C++ - Constructors,Destructors, Operator overloading and Type conversion
C++ - Constructors,Destructors, Operator overloading and Type conversionC++ - Constructors,Destructors, Operator overloading and Type conversion
C++ - Constructors,Destructors, Operator overloading and Type conversion
Hashni T
 
Aspdot
AspdotAspdot
Chapter One Function.pptx
Chapter One Function.pptxChapter One Function.pptx
Chapter One Function.pptx
miki304759
 
Plc part 3
Plc  part 3Plc  part 3
Plc part 3
Taymoor Nazmy
 
30csharp
30csharp30csharp
30csharp
Sireesh K
 
30c
30c30c
Unit 7. Functions
Unit 7. FunctionsUnit 7. Functions
Unit 7. Functions
Ashim Lamichhane
 
Basics of cpp
Basics of cppBasics of cpp
Basics of cpp
vinay chauhan
 

Similaire à Query Views Transformations (QVT) (20)

walkmod - JUG talk
walkmod - JUG talkwalkmod - JUG talk
walkmod - JUG talk
 
Angular2 with TypeScript
Angular2 with TypeScript Angular2 with TypeScript
Angular2 with TypeScript
 
MDE in Practice
MDE in PracticeMDE in Practice
MDE in Practice
 
Predictable reactive state management - ngrx
Predictable reactive state management - ngrxPredictable reactive state management - ngrx
Predictable reactive state management - ngrx
 
MOSKitt Transformations And Traceability
MOSKitt Transformations And TraceabilityMOSKitt Transformations And Traceability
MOSKitt Transformations And Traceability
 
Introduction to UML
Introduction to UMLIntroduction to UML
Introduction to UML
 
graph
graphgraph
graph
 
Streams in Java 8
Streams in Java 8Streams in Java 8
Streams in Java 8
 
uml.ppt
uml.pptuml.ppt
uml.ppt
 
C language
C languageC language
C language
 
Rdbms chapter 1 function
Rdbms chapter 1 functionRdbms chapter 1 function
Rdbms chapter 1 function
 
Cs 1023 lec 10 uml (week 3)
Cs 1023 lec 10 uml (week 3)Cs 1023 lec 10 uml (week 3)
Cs 1023 lec 10 uml (week 3)
 
C++ - Constructors,Destructors, Operator overloading and Type conversion
C++ - Constructors,Destructors, Operator overloading and Type conversionC++ - Constructors,Destructors, Operator overloading and Type conversion
C++ - Constructors,Destructors, Operator overloading and Type conversion
 
Aspdot
AspdotAspdot
Aspdot
 
Chapter One Function.pptx
Chapter One Function.pptxChapter One Function.pptx
Chapter One Function.pptx
 
Plc part 3
Plc  part 3Plc  part 3
Plc part 3
 
30csharp
30csharp30csharp
30csharp
 
30c
30c30c
30c
 
Unit 7. Functions
Unit 7. FunctionsUnit 7. Functions
Unit 7. Functions
 
Basics of cpp
Basics of cppBasics of cpp
Basics of cpp
 

Dernier

ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, FactsALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
Green Software Development
 
Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
Paco van Beckhoven
 
Mobile app Development Services | Drona Infotech
Mobile app Development Services  | Drona InfotechMobile app Development Services  | Drona Infotech
Mobile app Development Services | Drona Infotech
Drona Infotech
 
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket ManagementUtilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
Max Andersen
 
DDS-Security 1.2 - What's New? Stronger security for long-running systems
DDS-Security 1.2 - What's New? Stronger security for long-running systemsDDS-Security 1.2 - What's New? Stronger security for long-running systems
DDS-Security 1.2 - What's New? Stronger security for long-running systems
Gerardo Pardo-Castellote
 
Artificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension FunctionsArtificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension Functions
Octavian Nadolu
 
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Crescat
 
socradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdfsocradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdf
SOCRadar
 
E-commerce Application Development Company.pdf
E-commerce Application Development Company.pdfE-commerce Application Development Company.pdf
E-commerce Application Development Company.pdf
Hornet Dynamics
 
Preparing Non - Technical Founders for Engaging a Tech Agency
Preparing Non - Technical Founders for Engaging  a  Tech AgencyPreparing Non - Technical Founders for Engaging  a  Tech Agency
Preparing Non - Technical Founders for Engaging a Tech Agency
ISH Technologies
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
Fermin Galan
 
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteAI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
Google
 
Transform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR SolutionsTransform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR Solutions
TheSMSPoint
 
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
Łukasz Chruściel
 
Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...
Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...
Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...
kalichargn70th171
 
GreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-JurisicGreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-Jurisic
Green Software Development
 
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j
 
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
mz5nrf0n
 

Dernier (20)

ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, FactsALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
 
Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
 
Mobile app Development Services | Drona Infotech
Mobile app Development Services  | Drona InfotechMobile app Development Services  | Drona Infotech
Mobile app Development Services | Drona Infotech
 
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket ManagementUtilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
 
DDS-Security 1.2 - What's New? Stronger security for long-running systems
DDS-Security 1.2 - What's New? Stronger security for long-running systemsDDS-Security 1.2 - What's New? Stronger security for long-running systems
DDS-Security 1.2 - What's New? Stronger security for long-running systems
 
Artificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension FunctionsArtificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension Functions
 
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
 
socradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdfsocradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdf
 
E-commerce Application Development Company.pdf
E-commerce Application Development Company.pdfE-commerce Application Development Company.pdf
E-commerce Application Development Company.pdf
 
Preparing Non - Technical Founders for Engaging a Tech Agency
Preparing Non - Technical Founders for Engaging  a  Tech AgencyPreparing Non - Technical Founders for Engaging  a  Tech Agency
Preparing Non - Technical Founders for Engaging a Tech Agency
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
 
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteAI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
 
Transform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR SolutionsTransform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR Solutions
 
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
 
Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...
Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...
Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...
 
GreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-JurisicGreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-Jurisic
 
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
 
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
 

Query Views Transformations (QVT)

  • 2. QVT - Overview • QVT stands for Query/Views/Transformations • OMG standard language for expressing queries, views, and transformations on MOF models • Defines three model transformation languages. All of them operate on models which conform to MOF 2.0 meta-models
  • 3. QVT Transformation Languages • QVT-Operational Mappings • imperative language designed for writing unidirectional transformations • QVT-Relations • declarative language designed to permit both unidirectional and bidirectional model transformations • QVT-Core • declarative language designed to be simple and to act as the target of translation from QVT-Relations
  • 4. QVT Operational Structure QVT MMb Mb conformsTo conformsTo based on conformsTo conformsTo MOF MMa Ma conformsTo conformsTo conformsTo M1 M2 M3 Engine Tab based on input output executed
  • 5. Operational Mappings in Use • Case study: Flattening UML class hierarchies
  • 6. Flattening UML Class Hierarchies • Given a source UML model, transform it to another UML model in which only the leaf classes (classes not extended by other classes) in inheritance hierarchies are kept. Rules: • Transform only the leaf classes in the source model • Include the inherited attributes and associations • Attributes with the same name override the inherited attributes • Copy the primitive types
  • 7. Example Input Model name : String ssn : String Person school : String EnrolledInSchool organizationName : String Employed Student Employee «primitive type» String CarPhDStudent firstName : String lastName : String FullName name : FullName Professor carOwnership supervisor name : String Course street : String city : String Address residesAtattends
  • 8. Example Output Model «primitive type» String Carname : String ssn : String school : String PhDStudent firstName : String lastName : String FullName name : FullName ssn : String organizationName : String Professor carOwnership supervisor name : String Course street : String city : String Address residesAtattends residesAt
  • 9. ModelTransformation Expressed in Operational Mappings Language Overall structure of a transformation program: transformation SimpleUML2FlattenSimpleUML(in source : SimpleUML out target : SimpleUML); ………………………………………………………………… main() {} ………………………………………………………………… …helpers…………………………………………… …mapping operations……………… Signature: Declares the transformation name and the source and target metamodels. in and out keywords indicate source and target model variables. Entry point: The execution of the transformation starts here by executing the operations in the body of main Transformation elements: Transformation consists of mapping operations and helpers. They form the transformation logic.
  • 10. Mapping Operations • A mapping operation maps one or more source elements into one or more target elements • Always unidirectional • Selects source elements on the base of a type and a Boolean condition (guard) • Executes operations in its body to create target elements • May invoke other mapping operations and may be invoked • Mapping operations may be related by inheritance
  • 11. Mapping Operations: Example (1) • Consider the rule that transforms only leaf classes • Selects only classes without subclasses • Collects all the inherited properties • Creates new class in the target model mapping Class::leafClass2Class(in model : Model) : Class when {not model.allInstances(Generalization)->exists(g | g.general = self)} { name:= self.name; abstract:= self.abstract; attributes:= self.derivedAttributes()->map property2property(self)->asOrderedSet(); } Operation body Signature and guard name:= self.name; abstract:= self.abstract; attributes:= self.derivedAttributes()->map property2property(self)->asOrderedSet();
  • 12. Mapping Operations: Example (2) mapping Class::leafClass2Class(in model : Model) : Class when {not model.allInstances(Generalization)->exists(g | g.general = self)} Operation nameSource element type An optional sequence of input/output parameters Target element type Guard Operation Signature and Guard The Guard is an OCL expression used to filter source elements of a given type.The mapping operation is executed only on elements for which the guard expression is evaluated to true.
  • 13. name:= self.name; abstract:= self.abstract; attributes:= self.derivedAttributes()->map property2property(self)->asOrderedSet(); The predefined variable self refers to the source element on which the operation is executed The left-hand side of the assignments denotes properties of the target element Invocation of helper derivedAttributes The keyword map is used to invoke another mapping operation named property2property over the elements returned by the helper derivedAttributes Mapping Operations: Example (3) The mapping operation body contains initialization expressions for the properties of the target element.When an operation is executed over a source element the self variable is bound to it and an instance of the target type is created.Then the operation body is executed. Operation Body
  • 14. • Helpers are operations associated to a type that return a result • Both primitive and model types can be used • Helpers may be used to perform complex navigations over source models • Helpers have: • List of input parameters • An executable body Helpers
  • 15. Helpers Example query Class::derivedAttributes() : OrderedSet(Property){ if self.generalizations->isEmpty() then self.attributes else self.attributes->union( self.generalizations->collect(g | g.general.derivedAttributes()->select(attr | not self.attributes->exists(att | att.name = attr.name) ) )->flatten() )->asOrderedSet() endif } The context type of the helper derivedAttributes Result type
  • 16. Invoking Mapping Operations …………………………………………………… attributes:= self.derivedAttributes()->map property2property(self)->asOrderedSet(); …………………………………………………… mapping Property::property2property(in ownerClass : Class) : Property{ name:= self.name; type:= self.type; owner:= ownerClass; } Invocation of property2property on every member of the set returned by derivedAttributes query
  • 17. Constructs for Managing the Flow of Control • There are cases where more sophisticated control flow is needed. The following imperative constructs are available: • While • forEach • Break • Continue • If-then-else
  • 18. QVT Future Improvements • Tool support is still insufficient • Many issues need further exploration: • Performance; • Testing; • Scalability of transformations; • Ease of use; • Handling change propagation; • Reuse mechanisms.