Entity Modelling

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

Logical and Physical


We have got to the point where we see that entity models may specify only core attributes and relationships or may specify in addition non-core attributes. They may or may not specify reference attributes that are fully sufficent for communication of entitites; if they do, then the entity model then has affinity to a system of messages. If the scope of reference relationships is fully accounted for then redundant reference attributes can be avoided and the message system is free of redundancies.

For some authors, an entity model with a full complement of reference attributes is called a physical model and contrasted with a model devoid of reference attributes which is called a logical model. However note that, provided the logical model includes proper definitions of scope for reference relationships then, the physical model can be algorithmically generated from it either suitable for a relational message system or suitable for a hierarchical system.

We will use the following definition:

  • An entity model is fully logical provided that it does not contain reference attributes — each attribute of each entity gives information about the entity above and beyond the information given by its relationships
and in contrast:
  • An entity model is fully physical if and only if it includes a specification how each of its relationships is to be represented in an abstract message system.

Example One

The following entity model is fully physical. It is relational because it specifes a reference attribute for each of its relationships.

A fully physical model is non-relational if some relationships have no reference attributes to represent them. The implication is that such relationships are represented by containment

If this model is interpreted as fully physical:

then one relationship, c has an explicit representation by reference attribute whereas the other, a, implicitly, is represented by containment, for it has no associated reference attribute. Similarly if this loosely equivalent model is fully physical :
then it is the other relationship, c, which is to be represented by containment.

Example Two Cascading Identifiers

Consider the two logically equivalent models shown in figure 13. The first is fully logical and the second fully physical.

(a) a fully logical model

(b) a relational fully physical model that is logically equivalent

Figure 13
Two models that are logically the same. The second has affinity to a relational message system.

Now see what happens in fully physical models when some of the relationships are identifying, for instance if we change the example slightly so that in the fully logical model the relationships g and h are specified to be identifying as shown in figure 14 (a). In a corresponding physical model, reference attributes that represent g and h themselves need to be specified as identifying. This, in the fully physical model, requires the existence of further attributes to represent relationships f and g. The identifying attribute of A is said to cascade to entity types B and C. This is illustrated in figure 14 (b).

(a) the same logical model as in figure 13 but with g and h identifying

(b) a relational fully physical model that is logically equivalent

Figure 14
Example of a model in which identifiers have been cascaded.

In the example in figure 14 the attribute b0 of entity type B is shown as being identifying only when taken in conjunction with the relationship h. For this reason the referential attribute a0 which represents h is shown as an identifying attribute of B. The values of a0 and b0 are to be taken in conjunction to identify a unique entity of type B. This in turns means that the relationship g is represented by a pair of attributes of entity type C - both shown as identifying because relationship g is identifying. Finally, as a consequence, the relationship f of the entity type D is by necessity represented by a triple of attributes here shown named a0, b0 and c0 and each annotated with the parenthetical text (R1) to show their role in the model.

Identifying attributes are often called key attributes or just keys and those that individually or in combination reference entities other than the subject entity are sometimes called cascaded keys.

Example Three - Based on an Example of Chen

This example is based on one used by Chen in 1976 in his seminal paper.

(a) the fully logical model

(b) a relational fully physical model that is logically equivalent

Figure 15
Example based on Chen 1976. Note the presence of cascaded identifiers.