EntityLogic.org

www.entitylogic.org - entity modelling introduced from first principles


Diagrams Expressing Scopes

To summarise, the plays the part of relationship is limited in scope. In the specific context of a cast member, the part they play is in the same play as the performance is a performance of.

The relationship plays the part of has a type constraint : in its proper usage it has to relate cast members with characters but it also has a scope constraint: that the character is a character within the context of the play being performed.

  • Whenever a cast member plays the part of a character then the performance the cast member is part of is a performance of the play the character is a part of.
Figure 21
A scope constraint diagram for relationship plays part of. In such a diagram it is the lower horizontal relationship shown in bold which is the subject of the constraint. We have given an alternative explanation of the constraint to the right of the diagram but it is wordy and difficult to follow - for this reason we prefer to draw the diagram and have this mean the very same thing.

In mathematical notation it is possible to include the scope constraint as a more general kind of type constraint than can be expressed in an entity model, namely a dependent type constraint. In entity modelling this is not possible and every relationship defined in a model should have a scope constraint specified for it. There is no standard way of doing this but an accompanying diagram, one per associative relationship is a satisfactory way of doing this. Figure 21 is the scope constraint diagram for relationship plays part of.

The diagram in figure 22 can be interpreted as the scope constraints for relationship assigned to within the context of the entity models of figure 5. The text on the right of the figure explains the constraint expressed by the scope diagram - it seems obvious but this is so only if we know this model and this relationship i.e. providing we understand its proper usage. In this example there is a single entity type at the top of the diagram - therefore we call the diagram a scope triangle rather than a scope square.

If we allow of the use of identity relationship in a scope square and allow it to be drawn horizontally then any scope triangle can be re-expressed as a scope square as illustrated by figure 23.

  • Whenever a line of a play is assigned to a character then the play the character is part of is the same play as the line is part of.
Figure 22
A scope constraint diagram for relationship assigned to. This is a scope triangle because rooted at a single entity type.

Some relationships may be unconstrained in their scope in the sense that they are global in their reach. We have given an example of such a relationship, translation of, in figure 6. The scope of this relationship, the fact that it is unconstrained, is expressed by the relationship scope diagram in figure 24. By way of explanation - what this diagram says is :

The absolute of the language of a translated book is the absolute of the language of the native book it is a translation of.

In other words it says that the relationship translation of is such that two absolutes are equal - which is to say nothing at all about the relationship because a priori all absolutes are equal as absolute is unique of its type.

Figure 23
The identity relationship is same as used to express the scope triangle of figure 22 as a square.
Figure 24
An example of a scope diagram for a relationship which is unconstrained in scope - the scope diagram is rooted at absolute.