www.entitymodelling.org - entity modelling introduced from first principles - relational database design theory and practice - dependent type theory
Reference relationships are a second class of relationships and are distinguished from composition relationships by being depicted connecting to the sides of the boxes representing entity types rather than to the upper and lower edges. Without distinction, connection to the left or right sides of the boxes can be made; the side can be chosen for the convenience for the drawing. A text label at one end of a relationship line serves to describe the relationship from the point of view of the subject entity at that end. For example, we can say a chicken lays an egg or that an egg is laid by a chicken. Though there is a single relationship between chicken and egg there are two ways of articulating it and accordingly the relationship is shown labelled at each end:
For convenience of the diagramming we can, without changing the meaning, turn this about so:
A chicken hatches from an egg too and we can add this to the diagram:
Of course, what we see here represented on the diagram are types of things not actual things — so the diagram does not express that a chicken lays the very same egg that it hatches from: rather that a chicken lays things of the type egg and that it is hatched from a thing of the same type.