Entity Modelling

www.entitymodelling.org - entity modelling introduced from first principles - relational database design theory and practice - dependent type theory

The Scope Concept

In terms of our understanding of a domain of discourse it is significant that reference relationships may be limited in scope - for example it is a characteristic of the line assignment reference relationship shown in figure 33 that its instances are local to the context of individual plays: It is obvious, I know, but it is part of the nature of a play that a line is never assigned to a character of a different play - we might summarise the situation by saying that assignment is intra-play not inter-play. We have chosen to express this fact of limited scope in bullet (iv) of figure 33 and it is significant that the diagram alone does not express this fact1. Most significantly, the Entity Relationship diagram notation is able to express the types and cardinalities of reference relationships and how they are articulated but not their scopes. Nonetheless every reference relationship has a scope, the scope is fundamentally important, it can be expressed in words, or, as we see later, in equations, or in a subordinate diagram called a scope diagram.

  • a play is composed of one or more spoken lines
  • a play is composed of one or more characters
  • a spoken line is assigned to exactly one character
  • each line of a play is assigned to a character of that same play
Figure 33
Composition and reference within the script of a play

Contrast the situation of figure 33 with that of figure 34. Despite figure 34 being similar in shape to the earlier figure, in this case instances of the reference relationship are not limited in scope. Rather the point of the relationship translation is to cross languages - it establishes an inter-language relationship rather than intra-language relationship. This again shows that the scope of a relationship - the extent to which it is global or local - inter or intra - cannot be deduced from the entity relationship diagram. Other means of expression must be used. Gaining an understanding of scope and the means of its expression is an important part of learning entity modelling.

  • a language has one or more native books
  • a language has one or more translated books
  • a translated book is a translation of exactly one native book
  • a native book is translated as zero,one or more translated books
Figure 34
Translations of a book

A further example is given in figure 35 in which there is an example of a reference relationship between types at different levels in a composition hierarchy.

  • a recipe has one or more ingredients
  • a recipe has one or more steps
  • a step has one or more full or partial uses of zero, one or more ingredients
  • a thing used makes reference to zero or one ingredients
  • if a thing used in a step of a recipe makes reference to an ingredient then the ingredient is an ingredient within the very same recipe
Figure 35
Recipes and their ingredients. In this figure bullets (i) to (iv) restate what is said in the diagram. Bullet (v) adds to the diagram - it is a scope statement for relationship use of.

Context and Relationship Scope

Some errors arise through confusions of context and some such, in programming parlance, are called scope violations or scope errors. These are different to, but can be related with, the category mistakes identified by Gilbert Ryle. Whereas a category mistake is an attempt to relate entities whose types are inconsistent with the defined end types of a relationship, a scope violation occurs if the types are correct but the contexts of the respective entities, or, equivalently, the enclosing composite entities (see wider perspective on context), are inconsistent with the defined scope of the relationship. Scope violations are attempts to relate across contexts improperly.

Knowledge of a relationship's scope is a very significant part of understanding how a relationship is used and failure to respect this aspect of proper usage is what constitutes a scope violation.

For example when talking about the cast members of a performance of King Lear it would be a scope error to suggest that a member of cast play the character Desdemona for Desdemona is a character within the scope of different play namely Othello. The type of entity is correct for ‘Desdemona’ is indeed a character of a play, but the context is not. It is part of our knowledge of the plays part of/part played by relationship (see figure 36) that this is a relationship whose scope is local to the enclosing play context. We can say that it is intra-play rather than inter-play.

It would be a scope error in a conversation about antipodeans to assert that the New Zealand born physicist Ernest Rutherford could have been a native of Nelson in Lancashire, a place just 20 miles away from where he was Professor of Physics. Not only would it be a factual error - it would be non-sensical and this is because of the grasp we have of the meta-relationship between relationships country of birth and place of birth, that the latter is a more detailed version of the former. The assertion would violate the scope of the place of birth relationship (see figure 37).

Figure 36
Model of the Performance of a Play
Figure 37
The relationship place of birth is scope constrained to country of birth.

Likewise it would be a scope error to think that a local telephone call could be made between different countries or that the hydrogen of a water molecule could be covalently bonded to the oxygen of a different molecule or that the captain of one team in a cricket match might be scheduled to bat for the opposing team. All of these errors are characterised as failures to respect the scopes of relationships.

In accord with the most fundamental principles of information theory the more constrained a relationship is in its scope then the less the information needed to express its individual instances or facts of which it comprises. So the definition of relationship scopes is intimately connected to specifying information requirements for representing or communicating relationship instances.

For example if we wish to propose that, in the context of a performance of King Lear, we give someone the role of ‘the fool’ then we do not have to say ‘the fool in King Lear’ we simply have to say ‘the fool’ for our shared knowledge of the scope of the relationship plays part of/part played by implies the rest. Contrast this to the description often given of previous parts played by the actors as an enumeration of characters within plays.

1Bullet (iv) of figure 33 adds to the information given in the diagram and is different in this respect to bullets (i),(ii),(iii) for these simply restate what is already asserted by the diagram