Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Modeling (top-level project) » Interrogating ecore model and programmatically generating model instances
Interrogating ecore model and programmatically generating model instances [message #636118] Fri, 29 October 2010 11:43 Go to next message
Geejay is currently offline Geejay
Messages: 160
Registered: February 2010
Senior Member
Very high level question:

I am using an app which generates ecore models (maybe I should be calling
them model instances?).

I modify the model using a UI (drag and drop, adding properties).

Now I want to programmatically produce models that conform to the models
that are produced by the GUI.

How do I get started?

I imagine the steps would be:

**interrogate the GUI generated models to figure out the schema
*map this schema into some sort of Java based model.
*produce models using Java
*export the Java model into a model that conforms to the schema found in
step **

Am I at all on the right path?

Thanks for any help
Re: Interrogating ecore model and programmatically generating model instances [message #636128 is a reply to message #636118] Fri, 29 October 2010 12:22 Go to previous messageGo to next message
Ed Merks is currently offline Ed Merks
Messages: 26141
Registered: July 2009
Senior Member
Comments below.

geejay wrote:
> Very high level question:
>
> I am using an app which generates ecore models (maybe I should be
> calling them model instances?).
>
> I modify the model using a UI (drag and drop, adding properties).
>
> Now I want to programmatically produce models that conform to the
> models that are produced by the GUI.
>
> How do I get started?
>
> I imagine the steps would be:
>
> **interrogate the GUI generated models to figure out the schema
> *map this schema into some sort of Java based model.
> *produce models using Java
> *export the Java model into a model that conforms to the schema found
> in step **
It's all starting to hurt my brain. Maybe reading this will help:
http://www.ibm.com/developerworks/library/os-eclipse-dynamic emf/
>
> Am I at all on the right path?
>
> Thanks for any help
Re: Interrogating ecore model and programmatically generating model instances [message #636130 is a reply to message #636128] Fri, 29 October 2010 12:35 Go to previous messageGo to next message
Geejay is currently offline Geejay
Messages: 160
Registered: February 2010
Senior Member
Thats great. Thanks Ed, I really didnt want to make your head hurt :)

It sort of misses the step of interrogating the model though. I am guessing
the company who owns the model (IBM) would not want to make it public, and
as such I have no way of getting my hands on the entire ecore model
namespace without interrogating existing model instances.

Any ideas?

"Ed Merks" <Ed.Merks@gmail.com> wrote in message
news:iaee3h$8nn$2@news.eclipse.org...
> Comments below.
>
> geejay wrote:
>> Very high level question:
>>
>> I am using an app which generates ecore models (maybe I should be calling
>> them model instances?).
>>
>> I modify the model using a UI (drag and drop, adding properties).
>>
>> Now I want to programmatically produce models that conform to the models
>> that are produced by the GUI.
>>
>> How do I get started?
>>
>> I imagine the steps would be:
>>
>> **interrogate the GUI generated models to figure out the schema
>> *map this schema into some sort of Java based model.
>> *produce models using Java
>> *export the Java model into a model that conforms to the schema found in
>> step **
> It's all starting to hurt my brain. Maybe reading this will help:
> http://www.ibm.com/developerworks/library/os-eclipse-dynamic emf/
>>
>> Am I at all on the right path?
>>
>> Thanks for any help
Re: Interrogating ecore model and programmatically generating model instances [message #636146 is a reply to message #636130] Fri, 29 October 2010 13:14 Go to previous messageGo to next message
Ed Merks is currently offline Ed Merks
Messages: 26141
Registered: July 2009
Senior Member
Comments below.

geejay wrote:
> Thats great. Thanks Ed, I really didnt want to make your head hurt :)
>
> It sort of misses the step of interrogating the model though.
You figure out what kind of object is in the resource and then you use
it's API to "interrogate" it.
> I am guessing the company who owns the model (IBM)
IBM doesn't own any of these models. It's open source.
> would not want to make it public, and as such I have no way of getting
> my hands on the entire ecore model namespace without interrogating
> existing model instances.
Again, I haven't a clue what you're driving at. It's open source, all
the APIs are public, there are entire books describing what you can do...
>
> Any ideas?
I'm not sure I understand what's holding you up.
>
> "Ed Merks" <Ed.Merks@gmail.com> wrote in message
> news:iaee3h$8nn$2@news.eclipse.org...
>> Comments below.
>>
>> geejay wrote:
>>> Very high level question:
>>>
>>> I am using an app which generates ecore models (maybe I should be
>>> calling them model instances?).
>>>
>>> I modify the model using a UI (drag and drop, adding properties).
>>>
>>> Now I want to programmatically produce models that conform to the
>>> models that are produced by the GUI.
>>>
>>> How do I get started?
>>>
>>> I imagine the steps would be:
>>>
>>> **interrogate the GUI generated models to figure out the schema
>>> *map this schema into some sort of Java based model.
>>> *produce models using Java
>>> *export the Java model into a model that conforms to the schema
>>> found in step **
>> It's all starting to hurt my brain. Maybe reading this will help:
>> http://www.ibm.com/developerworks/library/os-eclipse-dynamic emf/
>>>
>>> Am I at all on the right path?
>>>
>>> Thanks for any help
>
Re: Interrogating ecore model and programmatically generating model instances [message #636725 is a reply to message #636146] Tue, 02 November 2010 15:12 Go to previous messageGo to next message
Geejay is currently offline Geejay
Messages: 160
Registered: February 2010
Senior Member
Ok I think I have the wrong terminology here.

By model I mean the ECore "meta"-model, the abstract model that describes
the rules a particular model instance must follow.

An analogy would be an XML schema, and an XML document which is written
according to the schema.

Keeping on with the analogy, I have an XML document which follows a
particular schema. Now I want to find out what the schema is (reverse
engineer it). Is there any way to work out the an ECore model from instances
of it?

Thanks

Greg

"Ed Merks" <Ed.Merks@gmail.com> wrote in message
news:iaeh5i$esd$1@news.eclipse.org...
> Comments below.
>
> geejay wrote:
>> Thats great. Thanks Ed, I really didnt want to make your head hurt :)
>>
>> It sort of misses the step of interrogating the model though.
> You figure out what kind of object is in the resource and then you use
> it's API to "interrogate" it.
>> I am guessing the company who owns the model (IBM)
> IBM doesn't own any of these models. It's open source.
>> would not want to make it public, and as such I have no way of getting my
>> hands on the entire ecore model namespace without interrogating existing
>> model instances.
> Again, I haven't a clue what you're driving at. It's open source, all the
> APIs are public, there are entire books describing what you can do...
>>
>> Any ideas?
> I'm not sure I understand what's holding you up.
>>
>> "Ed Merks" <Ed.Merks@gmail.com> wrote in message
>> news:iaee3h$8nn$2@news.eclipse.org...
>>> Comments below.
>>>
>>> geejay wrote:
>>>> Very high level question:
>>>>
>>>> I am using an app which generates ecore models (maybe I should be
>>>> calling them model instances?).
>>>>
>>>> I modify the model using a UI (drag and drop, adding properties).
>>>>
>>>> Now I want to programmatically produce models that conform to the
>>>> models that are produced by the GUI.
>>>>
>>>> How do I get started?
>>>>
>>>> I imagine the steps would be:
>>>>
>>>> **interrogate the GUI generated models to figure out the schema
>>>> *map this schema into some sort of Java based model.
>>>> *produce models using Java
>>>> *export the Java model into a model that conforms to the schema found
>>>> in step **
>>> It's all starting to hurt my brain. Maybe reading this will help:
>>> http://www.ibm.com/developerworks/library/os-eclipse-dynamic emf/
>>>>
>>>> Am I at all on the right path?
>>>>
>>>> Thanks for any help
>>
Generating metamodel from models [Was: Interrogating ecore model and programmatically generating mod [message #636739 is a reply to message #636725] Tue, 02 November 2010 15:58 Go to previous messageGo to next message
Vincent MAHE is currently offline Vincent MAHE
Messages: 129
Registered: July 2009
Senior Member
Le 02/11/2010 16:12, geejay a écrit :
> Ok I think I have the wrong terminology here.
>
> By model I mean the ECore "meta"-model, the abstract model that
> describes the rules a particular model instance must follow.
>
> An analogy would be an XML schema, and an XML document which is written
> according to the schema.
>
> Keeping on with the analogy, I have an XML document which follows a
> particular schema. Now I want to find out what the schema is (reverse
> engineer it). Is there any way to work out the an ECore model from
> instances of it?
>
> Thanks
>
> Greg
>
Discovering the metamodel which corresponds to a set of given models
(which then will conform to this metamodel) is an interesting question
(but still open from what I know).
--
Cordialement

Vincent MAHÉ

Ingénieur Expert - Projet IDM++ - Équipe AtlanMod
École des Mines de Nantes
La Chantrerie - 4, rue Alfred Kastler
B.P. 20722 - F-44307 NANTES Cedex 3
Tel: (33)2 51 85 81 00
Re: Interrogating ecore model and programmatically generating model instances [message #636749 is a reply to message #636118] Tue, 02 November 2010 16:26 Go to previous messageGo to next message
Sylvain EVEILLARD is currently offline Sylvain EVEILLARD
Messages: 523
Registered: July 2009
Senior Member
I don't think this is that hard though you may end with an unprecise meta-model (cardinalities especially).

But how would you read the models then ? In XML ?
Re: Interrogating ecore model and programmatically generating model instances [message #636763 is a reply to message #636749] Tue, 02 November 2010 16:46 Go to previous messageGo to next message
Geejay is currently offline Geejay
Messages: 160
Registered: February 2010
Senior Member
Yep, read the "template" models in as XML, then ideally I would generate
typed Java classes representing the model from there somehow.


"Sylvain EVEILLARD" <s.eveillard@netfective.com> wrote in message
news:iapdt8$jeg$1@news.eclipse.org...
> I don't think this is that hard though you may end with an unprecise
> meta-model (cardinalities especially).
>
> But how would you read the models then ? In XML ?
Re: Interrogating ecore model and programmatically generating model instances [message #636764 is a reply to message #636118] Tue, 02 November 2010 17:14 Go to previous message
Sylvain EVEILLARD is currently offline Sylvain EVEILLARD
Messages: 523
Registered: July 2009
Senior Member
Wouldn't it be easier to directly build the ecore meta-model ?
That's what I would do.
Previous Topic:Text to Model Transformation
Next Topic:Ada 95 or 2005 metamodel resource (ecore)
Goto Forum:
  


Current Time: Sat Oct 25 17:40:51 GMT 2014

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

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