ArcGIS banner

Creating a many-to-many attributed relationship class

Segment 1 of 5

Top  Previous  Next

Relationship classes are used to manage the associations between objects in one class (feature class or table) and objects in another.

When one origin object can relate to multiple destination objects and, conversely, one destination object can relate to multiple origin objects a relationship class with Many-to-Many cardinality is required. In this example, a relationship class between owners and parcels will be created in which a given parcel may have many owners, and a given owner may own many parcels.

When a many-to-many relationship class is created an intermediate table is created and stored in the geodatabase. The intermediate table is used to store the relationships between the two associated features and/or rows based on their foreign keys. This table contains at least the foreign key to the origin feature class or table and the foreign key to the destination feature class or table. Other attributes can also be stored in the intermediate table that describe the relationship itself. In this example, there is an additional attribute in the relationship class that stores the percent ownership for each relationship between the owners and parcels.

In this example you will now see how to create an attributed relationship class between the parcels and the owners so that when you open the data in ArcMap you can easily find out which owners own which parcels.

To create the new relationship class, right-click the Landbase feature dataset, point to New, then click Relationship Class.

The first panel of the New Relationship Class wizard is used to specify the name, origin, and destination feature class or table for the new relationship class. Type a name for the relationship class. In this example the relationship is called “Parcel_Owners”. To set the origin table, click a feature class or table in the Origin table box. To set the destination table, click a feature class or table in the destination table box.

The next panel is used to specify the type of relationship class you are creating. In this example the relationship class is a simple one, since owners and parcels can exist in the database independently of each other. You can, therefore, accept the default type—simple relationship class.

The next step is to specify the path labels and the message notification direction. The forward path label describes the relationship as it is navigated from the origin class to the destination class—in this case, from Parcels to Owners. The backward path label describes the relationship when navigated in the other direction— from Owners to Parcels. In this example “is owned by” will be the forward path label and “owns” will be the backward path label.

The message notification direction describes how messages are passed between related objects. Message notification is not required for this relationship class, so accept the default of None.

The next step is to specify the cardinality of the relationship. The cardinality describes the possible number of objects in either feature class or table which can be related to objects in the other feature class or table. This relationship will have M–N (many-to-many) cardinality. This means that a given owner may own many parcels and conversely, a given parcel can be owned by many owners.

The next step is to specify whether the new relationship class will have attributes. In this example, the Parcel_Owners relationship class has one additional attribute, which stores the percent ownership for each relationship between the owners and parcels.

In an attributed relationship, the intermediate table must have fields that act as foreign keys to the origin and destination feature classes or tables. These foreign keys relate to the primary keys on the origin and destination feature class or table primary keys. In the next panel the primary and foreign keys are set for the relationship class. The foreign keys will be added as fields to the intermediate table. In this example, the primary key in the parcel table is the property ID and the primary key in the owners table is the owner name.

When the relationship class is first created the intermediate table is empty. In order to use the intermediate table to navigate between the origin and destination features it has to be manually populated. This can be accomplished in an ArcMap edit session or by using the Table to Relationship Class tool located in the ArcToolbox (ArcToolbox > Data Management Tools > Relationship Classes > Table to Relationship Class).