Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Merging metamodel and metadata
Merging metamodel and metadata [message #1256533] Tue, 25 February 2014 14:36 Go to next message
Mt Naj is currently offline Mt NajFriend
Messages: 8
Registered: January 2014
Junior Member
Our use case can be generally split into three steps:

1. We have created an Ecore metamodel with which we instantiate an editor. For example, one of the metamodel classes is a "Data Request". A Data Request can contain two other classes: "Dimensions" or "Measures".

2. Business users use the editor to collaborate and populate the model with metadata. A user might create a Data Request called "Balance Sheet" with an enumerated Dimension of "Asset" (e.g., cash, inventory, furniture, etc.), a Dimension of type date called "Year End" and a Measure of type decimal called "Carrying Amount".

3. This metadata is then used to create XSD's that describe and constrain data for ETL via XML. From the above example, we could generate a XSD for the "Balance Sheet" Data Request which is used to populate an XML file with the Assets for a given Year End and their corresponding Carrying Amounts.

The UI division between steps 1 and 2 is important to create a clear separation between metamodel and metadata. For step 3, the data could be coming from external sources, which is why we have chosen XSD and XML to transport the data.

QUESTION: Is it possible to convert the metadata generated in step 2 into an Ecore model (i.e., package) that references the original metamodel? This way, for step 3 we can leverage the Eclipse Modelling platform for the creation of the XSD's and subsequent loading and validation of data. Or are there any other ways we could use our metadata to leverage the Eclipse Modelling platform for step 3?
Re: Merging metamodel and metadata [message #1256591 is a reply to message #1256533] Tue, 25 February 2014 15:42 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
Registered: July 2009
Senior Member
Comments below.

On 25/02/2014 3:36 PM, Mt Naj wrote:
> Our use case can be generally split into three steps:
>
> 1. We have created an Ecore metamodel with which we instantiate an
> editor. For example, one of the metamodel classes is a "Data
> Request". A Data Request can contain two other classes: "Dimensions"
> or "Measures".
> 2. Business users use the editor to collaborate and populate the model
> with metadata. A user might create a Data Request called "Balance
> Sheet" with an enumerated Dimension of "Asset" (e.g., cash, inventory,
> furniture, etc.), a Dimension of type date called "Year End" and a
> Measure of type decimal called "Carrying Amount".
>
> 3. This metadata is then used to create XSD's that describe and
> constrain data for ETL via XML. From the above example, we could
> generate a XSD for the "Balance Sheet" Data Request which is used to
> populate an XML file with the Assets for a given Year End and their
> corresponding Carrying Amounts.
>
> The UI division between steps 1 and 2 is important to create a clear
> separation between metamodel and metadata. For step 3, the data could
> be coming from external sources, which is why we have chosen XSD and
> XML to transport the data.
>
> QUESTION: Is it possible to convert the metadata generated in step 2
> into an Ecore model (i.e., package) that references the original
> metamodel?
I suppose so. If you map your meta model to XSD you can map it to
Ecore, after all we have a mapping from XSD to Ecore...
> This way, for step 3 we can leverage the Eclipse Modelling platform
> for the creation of the XSD's and subsequent loading and validation of
> data.
Yes, from an XSD you can create an Ecore model that can read and write
instances that conform to the XSD.
> Or are there any other ways we could use our metadata to leverage the
> Eclipse Modelling platform for step 3?
Given your transforming to XSD, you could transform to Ecore and from
that you can generate (Export... on the GenModel wrapper for the Ecore
model) to XSD.

To start with, try this out but using your XSD:
http://help.eclipse.org/kepler/index.jsp?topic=/org.eclipse.emf.doc/tutorials/xlibmod/xlibmod.html

These links are useful too:

http://www.theserverside.com/news/1364302/Binding-XML-to-Java
http://www.eclipse.org/modeling/emf/docs/overviews/XMLSchemaToEcoreMapping.pdf

Note that these kinds of things are support for dynamic models, not just
for generated model, so you could map directly to an Ecore model,
annotated with extended metadata to specify exactly how you expect/want
the XML to look, and use that to read and write instances...


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:GWT EMF reflective editor
Next Topic:Valid instances of models - interesting perspective
Goto Forum:
  


Current Time: Fri Mar 29 14:53:37 GMT 2024

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

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

Back to the top