Entity Modelling

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

Data Modelling Examples

Personal Computer Example

In the following example based on the personal computer all files and folders are shown as having ‘name’ and ‘date modified’ attributes. In addition files, but not folders, have ‘size’ and ‘content’ attributes:

Figure 32
Model of a Personal Computer.

Chemical Elements

In any given situation, getting to the right blend of entity types, attributes and relationships may be an iterative process as demonstrated in this next example in we explore two entries for chemical elements from a scientific dictionary1:

oxygen (Chem.). A nonmetalic element, symbol O, at. no. 8, r.a.m. 15.994, valency 2. It is a colourless, odourless gas which supports combustion and is essential for the respiration of most forms of life. M.p. -218 ℃ , b.p.-183 ℃ , density 1.42904 g/dm 3 at s.t.p., formula O 2 . An unstable form is ozone, O 3 . Oxygen is the most abundant element, etc.
chlorine (Chem.). Element, symbol Cl, at.no. 17, r.a.m. 35.453, valencies 1-,3+, 5+, 7+, m.p. -101 ℃ , b.p. -34.6 ℃ . The second halogen, chlorine is a geenish yellow gas, with an irritating smell etc.

From these entries, and with some expansion of abbreviations, I first surmise that each element has a name, a symbol, an atomic number, a relative atomic mass, one or more valencies, a melting point, a boiling point, and, optionally maybe, a density. I am left unsure whether all elements have a formulae, or whether they may have forms which may have formulae which is probably closer to the truth. I provisionally model this situation on an entity model diagram like so:

Reading the entry for sulphur, I find this preliminary model to be inadequate:

sulphur (Chem.). A nonmetalic element occurring in several allotropic forms. Symbol S, at. no. 16, r.a.m. 32.06, valencies 2,4,6. Rhombic( α -) sulphur is a lemon yellow powder; m.p. 112.8 ℃ , rel. d. 2.07. Monoclinic ( β -) sulphur has a deeper colour than the rhombic form; m.p. 119 ℃ , rel.d. 1.96, b.p. 444.6C. Chemically, sulphur resembles oxygen etc.
Reading this third entry, I learn that different forms of sulphur have different melting points and that my provisional model has miss-positioned the ‘melting point’ attribute; it turns out that chemical elements, in and by themsleves, cannot be attributed melting points. After a little further research I learn that these forms taken by chemical elements are, technically speaking, allotropes and that it is these that have melting-points, boiling points and densities. I reach this model:

In tabular form the dictionary entries for oxygen, chlorine and sulphur can be structured like this2 :

name symbol atomic no r.a.m. valency allotrope
name m.p. b.p. rel.den.
oxygen O 8 15.994
dioxygen -218 -183 ??
Ozone ??? ??? ???
chlorine Cl 17 35.453
Dichlorine -101 -34.6 ??
suplhur S 16 32.06
Rhombic 112.8 ??? 2.07
Monoclinic 119 444.6 1.96

In this table:

  • the columns correspond to attributes — each column heading is the name of an attribute,
  • the rows correspond to subject entities,
  • each cell presents the value of an attribute of a subject entity,
  • some rows have other rows inside them representing the parts of subject entities i.e. the compositional substructure.
The overall structure of each row, considered as a messages, we will represent by these message structure definitions:
element => name,
atom no,
relative atomic mass,
valency => number
allotrope => name,

1 Chambers Dictionary of Science and Technology, 1974, ISBN 0 550 13202 3
2 The dictionary has in fact such a table as an appendix but only contains a single allotrope for each element.