www.entitymodelling.org - entity modelling introduced from first principles - relational database design theory and practice - dependent type theory
We are not alone should we dispair at the difficult of expression of concepts. It is a favourite topic of poets1 and we have already mentioned H.G.Wells' musing:
I would say that there are axes of ambiguity that typically confound our best efforts at expression. The examples in this section illustrate how by use of entity relationship modelling we can overcome some of these difficulties.
It is often the case that a single word in a single dictionary sense can be used at a number of different levels. We can illustrate this with the word book which in its primary sense seems unambiguous but consider how we can ask the question:
We expect an answer to the first question to be a count of book titles or ISBN numbers but we expect an answer to the second to be a count of actual physical books sold by publishers. The use of the word book in the first question is at a different level to the use in the second question. The two are related and we classify as a reference relationship: .
An entity model can help disambiguate these distinct uses. We have the situation shown in figure 16.
The word word itself is also used at different levels. For example if we set about counting how many words in the English language we will be counting a different type of entity than if we count words in an essay or in an advertisement that we pay for by the word. There is a clear type instance relationship between the two which we again classify as a reference relationship: . This thinking leads to the model in figure 17.
The word letter also for we can count the letters in a word and each one is an occurrence of a letter from the alphabet as shown in figure 18.
In the model in figure 19 we introduce a third type of word and third type of letter:
This leads to the model shown in figure 20.
In this model there is a further example of a scope square2; this is shown in figure 21.
Returning for a moment to the question of when to model a relationship as composition (vertical) and when as reference (horizontal) we see that in the model in figure 20 the distinction between composition and reference has been representative of these considerations: