The <Relationship> and <ManyRelationship> Tags
As stated in the Relationships topic, DHFC leverages GIS relationships to maintain data integrity, inform tracing, perform queries, and facilitate other functions. That same help topic describes the process of creating these relationships in your geodatabase.
This help topic describes the equivalent relationship tags in the Schema.xml that inform the application of the geodatabase relationships.
There are two possible relationship tags: <Relationship> and <ManyRelationship>.
-
<Relationship>
-
Use this tag for one-to-one (1–1) relationships in the geodatabase.
-
Also use this tag for one-to-many (1–M) relationships in the geodatabase.
For example, RFCoupler has a 1–M relationship with RFCouplerPort in the geodatabase. Thus, in the Schema.xml, the <Relationship> tag is present to inform the application of this relationship. The tag follows all the <Field> tags, and it is bold in the following example:
<Table CoaxName="RFCouplerData" EsriDesignName="RFCoupler_D" EsriBuiltName="RFCoupler"> <Field CoaxName="EsriId" EsriName="OBJECTID" Import="true" /> <Field CoaxName="NetworkId" EsriName="NetworkId" Import="true" /> etc. <Relationship CoaxName="RFCouplerPortData" EsriDesignName="SECom.ARCFM.RFCouplerPort" EsriBuiltName="RFCouplerPort"/>
As seen in the example above, the <Relationship> tag has three attributes:
Attribute
Description
CoaxName
The name of the related DHFC data object. This is a reserved attribute and should not be changed.
EsriDesignName
The Forward Label of the In-Design relationship as found in the relationship properties in the geodatabase.
IMPORTANT: See the topic Relationship Labels and the Schema.xml for more information about the Forward Label referenced in the <Relationship> tag.EsriBuiltName
The Forward Label of the As-Built relationship as found in the relationship properties in the geodatabase.
IMPORTANT: See the topic Relationship Labels and the Schema.xml for more information about the Forward Label referenced in the <Relationship> tag. -
-
<ManyRelationship>
-
Use this tag for many-to-many (M-N) relationships in the geodatabase.
For example, RFCable has a M-N relationship with Duct in the geodatabase. Thus, in the Schema.xml, the <ManyRelationship> tag is present to inform the application of this relationship. The tag follows all the <Field> tags, and it is bold in the following example:
<Table CoaxName="RFCableData" EsriDesignName="RFCable_D" EsriBuiltName="RFCable"> <Field CoaxName="EsriId" EsriName="OBJECTID" Import="true" /> <Field CoaxName="NetworkId" EsriName="NetworkId" Import="true" /> etc. <ManyRelationship CoaxName="RFCable_DuctData" CoaxKey="NetworkID" EsriKey="RFCableID"/>
As seen in the example above, the <ManyRelationship> tag has three attributes:
Attribute
Description
CoaxName
The names of the related DHFC data objects. This is a reserved attribute and should not be changed.
CoaxKey
The Primary Key of the Origin Table/Feature Class in the relationship, as found in the relationship properties in the geodatabase.
EsriKey
The Foreign Key of the Origin Table/Feature Class in the relationship, as found in the relationship properties in the geodatabase.
-
Matching the Appropriate Tag with the Geodatabase Relationship
The tags must be applied as described above. Mismatched tags are not supported. For example, having a M-N relationship in the geodatabase matched with a <Relationship> tag in the Schema.xml (or vice versa) is not supported. The <Relationship> tag is only for 1–1 and 1–M relationships, and the <ManyRelationship> tag is only for M-N relationships.