Skip to main content



      Home
Home » Modeling » EMF » Working with edges on nodes
Working with edges on nodes [message #411840] Tue, 07 August 2007 14:30 Go to next message
Eclipse UserFriend
Hi!

I'm using EMF and GMF in my master thesis, and have a more theoretical question:

Most editors define edges for nodes (EClasses in EMF). How can edges be incorperated in EMF?

My best guess now is using generic attributes, is there a better way that I've missed?

Regards
Re: Working with edges on nodes [message #411845 is a reply to message #411840] Tue, 07 August 2007 14:59 Go to previous messageGo to next message
Eclipse UserFriend
Tomas,

I'm not sure I understand the question. Often one could define a graph
as nodes that are related by references and in that case, there'd be no
specific object to represent an edge in such a graph. But you could
also explicitly model edges an objects and then the nodes would refer to
edges and the edges would refer to nodes. In this case, the edges,
being objects, could then carry additional entries. This is somewhat
related to the issue in
https://bugs.eclipse.org/bugs/show_bug.cgi?id=105920 where we would
potentially model an association using link EClasses that have
unidirectional references out to the objects at the ends of the
association...


Tomas Zijdemans wrote:
> Hi!
>
> I'm using EMF and GMF in my master thesis, and have a more theoretical question:
>
> Most editors define edges for nodes (EClasses in EMF). How can edges be incorperated in EMF?
>
> My best guess now is using generic attributes, is there a better way that I've missed?
>
> Regards
>
Re: Working with edges on nodes [message #411852 is a reply to message #411845] Wed, 08 August 2007 03:43 Go to previous messageGo to next message
Eclipse UserFriend
Thank you for answering so quick :)

I think you understood me quite well. I'm building my editor on top of an Protege-OWL base where edges are defined for objects (as their own objects). My first try was to modell the edges as EClasses, and then refer to them from my nodes (also Eclasses ofcourse). This gave me NullPointerExeptions, or wouldn't allow me to create nodes.

Is there any tutorials or references I should consider? (I have the EMF book)
Re: Working with edges on nodes [message #411854 is a reply to message #411852] Wed, 08 August 2007 06:30 Go to previous messageGo to next message
Eclipse UserFriend
Tomas,

One important idea to keep in mind is to have a proper idea of which
references are containments and which are not. To serialize properly
objects must be in a resource directly or must be contained by an object
that itself is in a resource directly or indirectly via containment. In
other words, every object that's referenced must have eResource() !=
null. One way to achieve that is to define a graph class that has
containment references for all notes and another one for all edges.
Another approach would be for the nodes to contain the edges (but of
course only one of the two ends of the edge would be a containment
reference since an object can be contained by at most one containing
object. So I'm not sure the specifics of your problem, but it seems
likely that you might have not thought carefully about how to use
containment. If you can be more explicit about the problem, I can
better point you at where to look next...


Tomas Zijdemans wrote:
> Thank you for answering so quick :)
>
> I think you understood me quite well. I'm building my editor on top of an Protege-OWL base where edges are defined for objects (as their own objects). My first try was to modell the edges as EClasses, and then refer to them from my nodes (also Eclasses ofcourse). This gave me NullPointerExeptions, or wouldn't allow me to create nodes.
>
> Is there any tutorials or references I should consider? (I have the EMF book)
>
Re: Working with edges on nodes [message #411861 is a reply to message #411854] Wed, 08 August 2007 08:07 Go to previous messageGo to next message
Eclipse UserFriend
Thank you for the insight. I will explore your suggestions.

Let me try to explain further:

My classes are not relating directly. Ex: Java class "OntologyClass" has a value "generalisedBy" (one of it's edges) which is an object of type "SubClassRelationSet". This class holds references to which "OntologyClass" (or node) it belongs to, and holds all the ontologyClasses it generalises.

So in a model "OntologyClass" <-> "SubClassRelation" <-> (0,*) "OntologyClass". This "SubClassRelation"-Class has it's own attributes, but it's not desirable to model this underlaying class.

What I would really like is to be able, in GMF, to draw an arrow (reference) between to instances of a class , and then afterwards be able to click on that arrow (to view/edit attributes).
Re: Working with edges on nodes [message #411862 is a reply to message #411861] Wed, 08 August 2007 08:31 Go to previous messageGo to next message
Eclipse UserFriend
This is a multi-part message in MIME format.
--------------000704010303050800010607
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Tomas,

Comments below.


Tomas Zijdemans wrote:
> Thank you for the insight. I will explore your suggestions.
>
> Let me try to explain further:
>
> My classes are not relating directly. Ex: Java class "OntologyClass" has a value "generalisedBy" (one of it's edges) which is an object of type "SubClassRelationSet". This class holds references to which "OntologyClass" (or node) it belongs to, and holds all the ontologyClasses it generalises.
>
I see. I would have expected generalizedBy to be multi-valued and to
have SubClassRelation as representing a single generalization relation
between two OntologyClass instances. But this way seems fine too, just
not what I expected because the former way would allow attributes per
generalization and this way allows only attributes for all
generalizations as a unit.
> So in a model "OntologyClass" <-> "SubClassRelation" <-> (0,*) "OntologyClass". This "SubClassRelation"-Class has it's own attributes, but it's not desirable to model this underlaying class.
>
I suppose you mean it's not desirable to see it as a node in the
graphical representation. Instead you'd like to see it as an edge....
> What I would really like is to be able, in GMF, to draw an arrow (reference) between to instances of a class , and then afterwards be able to click on that arrow (to view/edit attributes).
>
It would seem that a SubClassRelation*Set *would correspond to many
graphical edges not just one edge. Is that really your intent? I doubt
GMF supports such a thing. I suppose one way to look at it is to treat
the OntologyClass and it's SubClassRelationSet as both mapping to the
same node and then treading the SubClassRelationSet's references to
other OntologyClasses as the edges; I'm not sure if this is supported
either.
*
*

--------------000704010303050800010607
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Tomas,<br>
<br>
Comments below.<br>
<br>
<br>
Tomas Zijdemans wrote:
<blockquote
cite="mid:40600999.61186574875152.JavaMail.root@cp9.dzone.com"
type="cite">
<pre wrap="">Thank you for the insight. I will explore your suggestions.

Let me try to explain further:

My classes are not relating directly. Ex: Java class "OntologyClass" has a value "generalisedBy" (one of it's edges) which is an object of type "SubClassRelationSet". This class holds references to which "OntologyClass" (or node) it belongs to, and holds all the ontologyClasses it generalises.
</pre>
</blockquote>
I see.&nbsp; I would have expected generalizedBy to be multi-valued and to
have SubClassRelation as representing a single generalization relation
between two OntologyClass instances.&nbsp; But this way seems fine too, just
not what I expected because the former way would allow attributes per
generalization and this way allows only attributes for all
generalizations as a unit.<br>
<blockquote
cite="mid:40600999.61186574875152.JavaMail.root@cp9.dzone.com"
type="cite">
<pre wrap="">
So in a model "OntologyClass" &lt;-&gt; "SubClassRelation" &lt;-&gt; (0,*) "OntologyClass". This "SubClassRelation"-Class has it's own attributes, but it's not desirable to model this underlaying class.
</pre>
</blockquote>
I suppose you mean it's not desirable to see it as a node in the
graphical representation.&nbsp; Instead you'd like to see it as an edge....<br>
<blockquote
cite="mid:40600999.61186574875152.JavaMail.root@cp9.dzone.com"
type="cite">
<pre wrap="">
What I would really like is to be able, in GMF, to draw an arrow (reference) between to instances of a class , and then afterwards be able to click on that arrow (to view/edit attributes).
</pre>
</blockquote>
It would seem that a SubClassRelation<b>Set </b>would correspond to
many graphical edges not just one edge.&nbsp; Is that really your intent?&nbsp; I
doubt GMF supports such a thing.&nbsp;&nbsp; I suppose one way to look at it is
to treat the OntologyClass and it's SubClassRelationSet as both mapping
to the same node and then treading the SubClassRelationSet's references
to other OntologyClasses as the edges; I'm not sure if this is
supported either.<br>
<b><br>
</b><br>
</body>
</html>

--------------000704010303050800010607--
Re: Working with edges on nodes [message #412074 is a reply to message #411862] Thu, 16 August 2007 08:29 Go to previous messageGo to next message
Eclipse UserFriend
I'm sorry generalizedBy is multi-valued. This is a set. This set has attributes such as rolename (this is supported in gmf), and a couple of other ints and booleans.

Maybee I can show this in the context menu of links in GMF?

And another ting: Is it possible to show the cardinality of references in gmf?
Re: Working with edges on nodes [message #412076 is a reply to message #412074] Thu, 16 August 2007 08:43 Go to previous message
Eclipse UserFriend
This is a multi-part message in MIME format.
--------------010200000900030904080604
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Tomas,

These are GMF questions now best asked on the GMF newsgroup:

news://news.eclipse.org/eclipse.modeling.gmf


Tomas Zijdemans wrote:
> I'm sorry generalizedBy is multi-valued. This is a set. This set has attributes such as rolename (this is supported in gmf), and a couple of other ints and booleans.
>
> Maybee I can show this in the context menu of links in GMF?
>
> And another ting: Is it possible to show the cardinality of references in gmf?
>


--------------010200000900030904080604
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Tomas,<br>
<br>
These are GMF questions now best asked on the GMF newsgroup:<br>
<blockquote><a href="news://news.eclipse.org/eclipse.modeling.gmf">news://news.eclipse.org/eclipse.modeling.gmf</a><br>
</blockquote>
<br>
Tomas Zijdemans wrote:
<blockquote
cite="mid:778997690.9151187267410169.JavaMail.root@cp9.dzone.com"
type="cite">
<pre wrap="">I'm sorry generalizedBy is multi-valued. This is a set. This set has attributes such as rolename (this is supported in gmf), and a couple of other ints and booleans.

Maybee I can show this in the context menu of links in GMF?

And another ting: Is it possible to show the cardinality of references in gmf?
</pre>
</blockquote>
<br>
</body>
</html>

--------------010200000900030904080604--
Previous Topic:Feature 'noNamespaceSchemaLocation' not found.
Next Topic:Dynamically loading model specific code from within generated code.
Goto Forum:
  


Current Time: Wed Nov 05 07:47:17 EST 2025

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

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

Back to the top