|
|
Re: Does EMF/GMF support this? [message #120357 is a reply to message #120218] |
Wed, 18 April 2007 18:15 |
Eclipse User |
|
|
|
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.
|
|
|
Powered by
FUDForum. Page generated in 0.10936 seconds