|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
Registered: July 2009
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.
|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
Registered: July 2009
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...
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;
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?
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...
Powered by FUDForum
. Page generated in 0.02213 seconds