Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Does EMF/GMF support this?
Does EMF/GMF support this? [message #120218] Wed, 18 April 2007 14:02 Go to next message
Mark Brodhun is currently offline Mark BrodhunFriend
Messages: 30
Registered: July 2009
Member
I'm a newbie with GMF and I can't figure out how to correctly define a
link mapping from my schema. At present I have specific requirements as
to how the resulting XML looks - something like this:

<Links about="whatever...">
<columnComparison columnOperator="EQ" sourceCol="x" targetCol="y"/>
<cardinality>1:M</cardinality>
<source resource="http://tempuri.org"/>
<target resource="http://tempuri.org"/>
</Links>

Following is part of my schema - note how the source/target features
needed for the link mapping are defined as XML attributes.

<xsd:element name="Relations">
<xsd:complexType>
<sequence>
<element name="Tables" type="TableType" />
<element name="DerivedTables" type="DerivedTableType" />
<element name="QueryDerivedTables" type="QueryDerivedTableType" />
<element name="Links" type="dam:LinkType" minOccurs="0"
maxOccurs="unbounded" />
</sequence>
</xsd:complexType>
</xsd:element>

<xsd:complexType name="LinkType" ecore:name="Link">
<xsd:sequence>
<element name="columnComparison" type="dam:ColumnComparisonType"
minOccurs="1" maxOccurs="unbounded" />
<element name="cardinality" type="dam:CardinalityEnum" minOccurs="1"/>
<element name="source" type="dam:resourceAttributeType"
minOccurs="1"/>
<element name="target" type="dam:resourceAttributeType"
minOccurs="1"/>
</xsd:sequence>
<xsd:attribute name="about" type="xsd:string" />
</xsd:complexType>

<xsd:complexType name="resourceAttributeType"
ecore:name="ResourceAttribute">
<xsd:attribute name="resource" type="xsd:anyURI"
ecore:reference="dam:AbstractTableBase" />
</xsd:complexType>

Thanks in advance for any help.
Re: Does EMF/GMF support this? [message #120295 is a reply to message #120218] Wed, 18 April 2007 15:16 Go to previous messageGo to next message
Mark Brodhun is currently offline Mark BrodhunFriend
Messages: 30
Registered: July 2009
Member
I should have added... Once I select 'links' as the EReference for the
domain element/containment feature; then that only allows me to select
"Link" as the containment feature/Element; and therefore the 'resource'
EAttribute is not a valid choice. So I'm starting to think this schema
is the problem (i.e. these constructs aren't supported?).

Mark wrote:
> I'm a newbie with GMF and I can't figure out how to correctly define a
> link mapping from my schema. At present I have specific requirements as
> to how the resulting XML looks - something like this:
>
> <Links about="whatever...">
> <columnComparison columnOperator="EQ" sourceCol="x" targetCol="y"/>
> <cardinality>1:M</cardinality>
> <source resource="http://tempuri.org"/>
> <target resource="http://tempuri.org"/>
> </Links>
>
> Following is part of my schema - note how the source/target features
> needed for the link mapping are defined as XML attributes.
>
> <xsd:element name="Relations">
> <xsd:complexType>
> <sequence>
> <element name="Tables" type="TableType" />
> <element name="DerivedTables" type="DerivedTableType" />
> <element name="QueryDerivedTables" type="QueryDerivedTableType" />
> <element name="Links" type="dam:LinkType" minOccurs="0"
> maxOccurs="unbounded" />
> </sequence>
> </xsd:complexType>
> </xsd:element>
>
> <xsd:complexType name="LinkType" ecore:name="Link">
> <xsd:sequence>
> <element name="columnComparison"
> type="dam:ColumnComparisonType" minOccurs="1"
> maxOccurs="unbounded" />
> <element name="cardinality" type="dam:CardinalityEnum" minOccurs="1"/>
> <element name="source" type="dam:resourceAttributeType"
> minOccurs="1"/>
> <element name="target" type="dam:resourceAttributeType"
> minOccurs="1"/>
> </xsd:sequence>
> <xsd:attribute name="about" type="xsd:string" />
> </xsd:complexType>
>
> <xsd:complexType name="resourceAttributeType"
> ecore:name="ResourceAttribute">
> <xsd:attribute name="resource" type="xsd:anyURI"
> ecore:reference="dam:AbstractTableBase" />
> </xsd:complexType>
>
> Thanks in advance for any help.
Re: Does EMF/GMF support this? [message #120357 is a reply to message #120218] Wed, 18 April 2007 18:15 Go to previous message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

Mark,

I'm not sure I really understand the GMF part of the question, but for
the anyURI value of the "resource" attribute to be handled as an
EReference in EMF, the URI will have to be of the form
<baseURI>#<fragment> where the baseURI determines the resource, and the
fragment determines the referenced object within the resource.


Mark wrote:
> I'm a newbie with GMF and I can't figure out how to correctly define a
> link mapping from my schema. At present I have specific requirements
> as to how the resulting XML looks - something like this:
>
> <Links about="whatever...">
> <columnComparison columnOperator="EQ" sourceCol="x" targetCol="y"/>
> <cardinality>1:M</cardinality>
> <source resource="http://tempuri.org"/>
> <target resource="http://tempuri.org"/>
> </Links>
>
> Following is part of my schema - note how the source/target features
> needed for the link mapping are defined as XML attributes.
>
> <xsd:element name="Relations">
> <xsd:complexType>
> <sequence>
> <element name="Tables" type="TableType" />
> <element name="DerivedTables" type="DerivedTableType" />
> <element name="QueryDerivedTables" type="QueryDerivedTableType" />
> <element name="Links" type="dam:LinkType"
> minOccurs="0" maxOccurs="unbounded" />
> </sequence>
> </xsd:complexType>
> </xsd:element>
>
> <xsd:complexType name="LinkType" ecore:name="Link">
> <xsd:sequence>
> <element name="columnComparison"
> type="dam:ColumnComparisonType" minOccurs="1"
> maxOccurs="unbounded" />
> <element name="cardinality" type="dam:CardinalityEnum" minOccurs="1"/>
> <element name="source" type="dam:resourceAttributeType"
> minOccurs="1"/>
> <element name="target" type="dam:resourceAttributeType"
> minOccurs="1"/>
> </xsd:sequence>
> <xsd:attribute name="about" type="xsd:string" />
> </xsd:complexType>
>
> <xsd:complexType name="resourceAttributeType"
> ecore:name="ResourceAttribute">
> <xsd:attribute name="resource" type="xsd:anyURI"
> ecore:reference="dam:AbstractTableBase" />
> </xsd:complexType>
>
> Thanks in advance for any help.
Previous Topic:How to add manually some model "elements" to a diagram (where "elements" are giv
Next Topic:How to not to persist the notational views
Goto Forum:
  


Current Time: Sat Jul 27 15:55:29 GMT 2024

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

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

Back to the top