|
Re: Do I need a new discoverer to pull out a metamodel described in xml [message #909156 is a reply to message #909095] |
Thu, 06 September 2012 16:25 |
Hugo Bruneliere Messages: 674 Registered: July 2009 |
Senior Member |
|
|
Hello,
First, thanks for looking to MoDisco
Concerning your problem, it depends from the finality of your developed solution.
MoDisco will allow you to directly obtain generic XML models out of any XML file (an XML document, an XML schema) via the provided XML Discoverer: cf. the MoDisco User Guide (in Technologies >> XML). Note that I also encourage you to take a look to the other MoDisco components such as the generic MoDisco Model Browser for instance.
Then, from these models (in EMF), you will be able to use any of the EMF-based modeling technologies to manipulate them. This includes notably model transformation technologies such as ATL (http://www.eclipse.org/atl/) which allows producing other models (possibly conforming to other metamodels) from them.
However, if your problem is just directly mapping your XML Schema with Ecore, EMF already provides built-in features to implement this (cf. the EMF documentation and forum).
I hope this helps.
Best regards,
Hugo
--------------------------------------------------------
Hugo Bruneliere, PhD
NaoMod team (IMT Atlantique & LS2N-CNRS)
Nantes - France
--------------------------------------------------------
|
|
|
Re: Do I need a new discoverer to pull out a metamodel described in xml [message #909170 is a reply to message #909095] |
Thu, 06 September 2012 17:04 |
Tom H Messages: 139 Registered: July 2009 |
Senior Member |
|
|
The target metamodel is from a project called Apache Ofiz, and it specifies its own entity-relations systems and persistence in XML mappings.
So I can use the basic XSD-EMF bridge, to import the entity.xsd metamodel and manipulate the ofbiz-entities.xml files as instances of that metamodel, and this is good.
But the EObject is an EClass of type "Entity", with an instance value of for example "OfBizEntityType". So using basic xsd->emf I have their entity-system metamodel expressed in ecore.
Also using MoDisco xml discoverer, I can point at a ofbiz-entities.xml file, which will give me back a meta-model corresponding to the their existing xsd file.
So I can discover their entity system metamodel from instances. Which is similar to the above.
However I want to get back the DB and Java objects that are output from the instances of the entity-system, hence I need to discover the metamodel from the instances expressed in the mappings. (rather than the metamodel of the entity-system itself)
I guess the analogy would be that, if you (in a crazy world) wanted to be able to have model correspondence from some hibernate persistence model to ecore model, what is the strategy for that?
my initial ideas are...
EMF Facet?
As these metamodels are in XML, should I create an EMF facet that extends the xml schema? because I am looking for correspondence between something like this;
<entity entity-name="EntityAuditLog">
and the ecore version;
<eClassifiers xsi:type="ecore:EClass" name="EntityAuditLog">
create a facet type call entity, and then use a query to find the elements that match?
model to model mapping with ATL
maybe this is more appropriate?
Ofbiz discoverer?
Not looked into this one, but I imagine I would base it on the xml discoverer, and then on inspection reflect all the element instances as types, ie, kind of "promote" the instances to types...
|
|
|
Re: Do I need a new discoverer to pull out a metamodel described in xml [message #909511 is a reply to message #909170] |
Fri, 07 September 2012 09:01 |
Hugo Bruneliere Messages: 674 Registered: July 2009 |
Senior Member |
|
|
Hello,
I's not very clear to me what is your final objective: which (types of) artifacts/models do you want to produce as outputs?
In any case, the first step is for sure to obtain a reusable model out of your input XML file.
For this, as said before, you can use either directly EMF or the MoDisco XML discoverer according to your needs.
Then, if you have to extract information from this model, model transformation is really appropriate.
However, you thus have to clearly identify what is(are) the metamodel(s) you will target.
Best regards,
Hugo
--------------------------------------------------------
Hugo Bruneliere, PhD
NaoMod team (IMT Atlantique & LS2N-CNRS)
Nantes - France
--------------------------------------------------------
|
|
|
Powered by
FUDForum. Page generated in 0.02223 seconds