Entity Modelling

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


Relational, Hierarchical or Multi-dimensional

In figure 8 I have drawn a graph that is equivalent to one presentated by Mathematican Robin Gandy in his lecture ‘Structure in Mathematics’1; he presents the love relationships to be found in Iris Murdoch's novel Severed Head as a directed graph and I shall use this as example data.

We consider how the information in this graph can be communicated as a set of independent messages and we illustrate the use of entity models inclusive of reference attributes to document the message structures.

Figure 8
Example from ‘Structure in Mathematics’ of a directed graph showing the love relationships to be found in Iris Murdoch's novel ‘Severed Head’.

There is of course nothing special about this example —loves is a recursive many-many binary relationship and any such can be represented by a pair of many-one relationships and the pattern is that of a directed graph. We are using this example to provide us with some data with which we can illustrate relational and non-relational choices of message system in a simple setting. In a subsequent section we will build on this example to illustrate further features.

We illustrate four different choices of message system for communicating directed graphs. Each choice has a natural affinity with a different entity model; having said that, the pertinent point is that the models only differ in the categorisation of binary relationships as either reference of composition. In all cases the models have two binary relationships representing the giver and the receiver of love respectivly. Abstractly these are the arc adjacency relationships of a directed graph i.e. the source respectively the destination of each arc of the graph. If both of these binary relationships are classified as reference then two reference attributes represent them in messages and a relational message system results. If one or the other binary relationships is classifed as a reference relationship then a hierarchical message structure results. There is a choice of two relationships to represent as compositional and so a choice of two message systems. Finally we illustrate the case when both binary relationships are considered to be composition relationships.

The first message system illustrated is relational, the next two hierarchical and the final one is two dimensional.

Relational

VVVVV
character
name sex
ALEXANDER M
ANTONIA F
HONOR F
GEORGIE F
PALMER M
MARTIN M
hhhhhh
VVVVV
hhhhhh
love
of character for character
ALEXANDER ANTONIA
ANTONIA ALEXANDER
ANTONIA PALMER
HONOR PALMER
GEORGIE ALEXANDER
GEORGIE MARTIN
PALMER ANTONIA
PALMER GEORGIE
PALMER HONOR
MARTIN HONOR
MARTIN GEORGIE
MARTIN PALMER
Figure 9
This is a relational representation. The messages are shown in rows of a table but equally we could have written them in English. The messages are relational because each message contains data from attributes of a single subject entity.

Hierarchy of Person Loving

character
name
shows love
for character
ALEXANDER
ANTONIA
ANTONIA
ALEXANDER
PALMER
GEORGIE
ALEXANDER
MARTIN
HONOR
PALMER
MARTIN
GEORGIE
HONOR
PALMER
PALMER
ANTONIA
GEORGIE
HONOR
hhhhhh
VVVVV
hhhhhh
VVVVV
This is different to the representation in figure 9 in that one of relationships has been represented as a composition relationship rather than as a referrence relationship. The composition structure of the message then follows the composition structure of the model. From this representation you may quickly find who is loved by ALEXANDER, who is loved by ANTONIA and so on.
Figure 10
Gandy's love relationships data presented non-relationally. This is a hierarchical representation. It is a non-relational because a single row of the table i.e. a single message contains data from a number of different entities. Each message has a subject which is an entity of type character but also contains details of subordinate love entities.

Hierarchy of Person Being Loved

character
name
receives love
of character
ALEXANDER
ANTONIA
GEORGIE
ANTONIA
ALEXANDER
PALMER
GEORGIE
MARTIN
PALMER
HONOR
MARTIN
PALMER
MARTIN
GEORGIE
PALMER
ANTONIA
HONOR
MARTIN
hhhhhh
VVVVV
hhhhhh
VVVVV
From this representation which is also non-relational, but now with a different choice of message composition as represented by the different choice of composition relationship in the model, you may quickly find who ALEXANDER is loved by, who ANTONIA is loved by and so on.
Figure 11
Gandy's love relationships data presented non-relationally with a different choice of composition structure.

A 2D Representation of Loving and Being Loved

ANTONIO GEORGIE HONOR MARTIN PALMER ALEXANDER
ANTONIO x x
GEORGIE x x
HONOR x x
MARTIN
PALMER x x x x
ALEXANDER x x
hhhhhh
VVVVV
hhhhhh
This way of modelling directed graphs is akin to the matrix structure modelled in chapter one. Applied to the representation of the Severed Head love relationships it implies a communication in which it is apparent both (i) who loves each subject a,g,h and so on and (ii) who each subject a,g,h, etc. is loved by.
Figure 12
Gandy's love relationships data presented non-relationally with a 2-D choice of composition structure.

1In Structuralism, edited by D. Robey, Wolfson College Lectures, 1972.