Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » QVT-OML » EPX to Ecore and EMX to Xtext instances
EPX to Ecore and EMX to Xtext instances [message #1856671] Thu, 22 December 2022 00:18 Go to next message
Klarise Hund is currently offline Klarise HundFriend
Messages: 25
Registered: October 2022
Junior Member
Hi,

Can I use QVTo to transform
models (.emx) to Xtext models,
where .emx models conform to UML and UML Profiles (.epx) files?

Thanks!
Re: EPX to Ecore and EMX to Xtext instances [message #1856676 is a reply to message #1856671] Thu, 22 December 2022 08:12 Go to previous messageGo to next message
Christopher Gerking is currently offline Christopher GerkingFriend
Messages: 116
Registered: April 2011
Senior Member
Hi Klarise

What do you mean by Xtext model? A metamodel representing the Xtext grammar? Or a serialization of a concrete model instance according to the rules of the grammar?


KInd regards
Christopher
Re: EPX to Ecore and EMX to Xtext instances [message #1856679 is a reply to message #1856676] Thu, 22 December 2022 10:40 Go to previous messageGo to next message
Klarise Hund is currently offline Klarise HundFriend
Messages: 25
Registered: October 2022
Junior Member
Hi Christopher,

Sorry, I should have explained myself better. :)

This is my current situation. I have .emx models which conform to the UML metamodel and a UML profile (epx extension) (i.e., the EMX model contains instances of elements of both the UML metamodel and the UML profile). Now I need to transform these emx models to instances of an Xtext grammar (i.e., models conforming to the Xtext grammar/genetated Ecore metamodel).

Would that be possible?

Thanks!
Re: EPX to Ecore and EMX to Xtext instances [message #1856685 is a reply to message #1856679] Thu, 22 December 2022 14:27 Go to previous message
Christopher Gerking is currently offline Christopher GerkingFriend
Messages: 116
Registered: April 2011
Senior Member
Basically yes, that's possible. The output of QVTo is a model in its abstract syntax (based on the generated Ecore metanodel). For any such model, Xtext provides the required facilities to serialize that model into a concrete textual syntax that conforms to the grammar. These two steps should be completely interoperable.

In case you want to do that in practice, you could use the launch configurations provided by Eclipse QVTo, which enable you to specify the URIs of the input and output models explicitly. Provided that your Xtext language is properly integrated with EMF, QVTo will automatically invoke the Xtext serializer when saving your output models to the specified URI. You will need to use the proper file extension for your output URI, thereby indicating to EMF which serializer to use. Hence, using the QVTo UI, this should work out of the box. Did you try that?

In case you want to do it programmatically, take a look at how you get Xtext to serialize your EMF models accordingly. This has nothing to do with QVTo.

Kind regards
Christopher
Previous Topic:Representing QVT-Operational transformations in XML, JSON or or any other serialized format
Next Topic:Transform UML models with applied profile
Goto Forum:
  


Current Time: Wed Sep 25 14:13:53 GMT 2024

Powered by FUDForum. Page generated in 0.04414 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top