Converting Multiway Relationships to Binary

Converting Multiway Relationships to Binary

There are a number of data models, such as ODL (Object Definition Language), which we introduce in "Introduction to ODL", that limit relationships to be binary. Therefore, while the E/R model does not require binary relationships, it is helpful to watch that any relationship connecting more than two entity sets can be converted to a collection of  binary, many-one relationships. We can introduce a new entity set

Moving the attribute to an entity set
whose entities we may consider as tuples of the relationship set for the multiway relationship. We call this entity set a connecting entity set. We then introduce many- one relationships from the connecting entity set to each of the entity sets that provide elements of tuples in the original, multiway relationship. If an entity set performs more than one role, then it is the target of one relationship for each role.

Example : The four-way Contracts relationship in "Roles in Relationships" figure, can be replaced by an entity set that we may also call Contracts. As seen in "Subclasses in the E/R Model" figure, it participates in four relationships. If the relationship set for the relationship Contracts has a 4-tuple

(studio1, studio2, star, movie)

then the entity set Contracts has an entity e. This entity is linked by relationship Star-of to the entity star in entity set Stars. It is linked by relationship Movie-of to the entity movie in Movies. It is linked to entities studio1 and studio2 of Studios by relationships Studio-of-star and Producing-studio, respectively.

Note that we have presumed there are no attributes of entity set Contracts, though the other entity sets in "Subclasses in the E/R Model" figure have unseen attributes. Nevertheless, it is possible to add attributes, such as the date of signing, to entity set Contracts.



Tags