Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » MoDisco » Discoverer doesn't set xmi:id(The resulting xmi file doesn't contain reference ids, it uses xpath format instead)
Discoverer doesn't set xmi:id [message #1689335] Mon, 23 March 2015 10:46 Go to next message
Fábio Silva is currently offline Fábio SilvaFriend
Messages: 18
Registered: December 2014
Junior Member
How do I change xpath format to xmi:id ? I'm doing some experiments directly using the resulting xmi file that comes from a discoverer, but for the time being I have to resolve the xpath elements manually. Is there a way to generate it the way I want? I know the EMF model supports it, so it shouldn't be a big issue.
Re: Discoverer doesn't set xmi:id [message #1689371 is a reply to message #1689335] Mon, 23 March 2015 12:23 Go to previous messageGo to next message
Hugo Bruneliere is currently offline Hugo BruneliereFriend
Messages: 674
Registered: July 2009
Senior Member
What is your actual intent when directly handling the XML files?
XMI is just a serialization format (among possibly others) for EMF models.
When an EMF model is loaded in memory, the initially used serialization format does not mind anymore.
There are different technologies allowing to handle efficiently EMF models within the Eclipse Modeling Project: the EMF API itself of course, but also various browsers/editors (cf. MoDisco Model Browser), model transformation techniques (e.g. ATL), etc.


--------------------------------------------------------
Hugo Bruneliere, PhD
NaoMod team (IMT Atlantique & LS2N-CNRS)
Nantes - France
--------------------------------------------------------
Re: Discoverer doesn't set xmi:id [message #1689533 is a reply to message #1689371] Mon, 23 March 2015 20:12 Go to previous messageGo to next message
Fábio Silva is currently offline Fábio SilvaFriend
Messages: 18
Registered: December 2014
Junior Member
My first goal was to import several releases of a project into an XML database such as ExistDB, using the Modisco's XMI format to do so. Later, I thought of importing them into a multi paradigm database such as OrientDB, converting the XMI to JSON. I can use an EMF resource to process, but I consider the underlying model in XMI much simpler, just store every node as an entity and every attribute as a property. Finally, what drove me to the id was the fact that there are nodes called actionRelation and codeRelation with these "xpath like" attributes , which demands unecessary processing to resolve.
Re: Discoverer doesn't set xmi:id [message #1689760 is a reply to message #1689533] Tue, 24 March 2015 09:06 Go to previous messageGo to next message
Hugo Bruneliere is currently offline Hugo BruneliereFriend
Messages: 674
Registered: July 2009
Senior Member
A possibility would be to load back the models you obtained and re-serialize them by setting the specific XMI options you want.
Generally, for storing models in databases, you may take a look to dedicated projects such as Eclipse CDO for instance.
For JSON serialization of your models, you may be interested in the EMF-REST project.


--------------------------------------------------------
Hugo Bruneliere, PhD
NaoMod team (IMT Atlantique & LS2N-CNRS)
Nantes - France
--------------------------------------------------------
Re: Discoverer doesn't set xmi:id [message #1690138 is a reply to message #1689760] Wed, 25 March 2015 13:00 Go to previous message
Fábio Silva is currently offline Fábio SilvaFriend
Messages: 18
Registered: December 2014
Junior Member
Hugo, it worked! I simply loaded the xmi, iterated over the resources and used the code below
    XMIResource resource = (XMIResource)obj.eResource();
    if(resource == null) {
      throw new IllegalStateException("Object not attached to resource.");
    }
    resource.setID(obj, UUID.randomUUID().toString());


It also resolved all "xpath like" parameters. Thank you so much!!!
I will take a look at EMF-REST project. Maybe it's a better solution.
Previous Topic:KDM to UML converter
Next Topic:Running Modisco discoverer programmatically and standalone
Goto Forum:
  


Current Time: Thu Apr 25 17:21:13 GMT 2024

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

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

Back to the top