Subtypes in Object-Role Modeling (Part 1)

Victor Morgante
8 min readMay 13, 2020

Object-Role Modeling is a type of Fact-Based Modelling.

Object-Role Modeling (ORM) is a form of graphical conceptual modelling where each diagram ranges over the structure of the data model it describes.

The ORM diagram below describes a data model where each Person in our model must be a Child, Teenager or Adult, and regardless of what type of Person they are they must have a first-Name and a last-Name.

Subtypes in Object-Role Modeling

The purple arrows from the Entity Types, Child, Teenager and Adult, represent that they are each a subtype of the Entity Type, Person.

That much is fairly straight forward. It is when we examine the theory behind the standard interpretation of subtypes in Object-Role Modeling that things get interesting, and possibly confusing to the uninitiated.

The original Object-Role Modeling called, Niam, was synthesised as a language under the PhD thesis of Dr Terry Halpin. The thesis aims to lend credibility to the graphical language as one that is not ambiguous in any way, by mapping an isomorphism from Niam diagrams to a language of symbolic logic called KL, or Knowledge Language. KL is a theory of symbolic logic under what is known as Finite Model Theory.

In effect, Dr Halpin’s thesis maps many diagrams of Niam side by side with theorems of KL such that one can comparatively analyse whether an isomorphism exists or not between the languages; much the same as in the picture below taken from our Boston Object-Role Modeling software.

Object-Role Model mapped to theorems of KL (Knowledge Language)

The essence of theories under finite model theory (FMT) is that under their standard interpretation they are not comparable with languages of higher order. FMT theories are ostensibly restricted first order theories restricted to the finite. Theories of FMT are not comparable with higher order theories in a few ways, but a distinguishing feature is that there is no notion of a type hierarchies within a theory of finite order theory.

So if ORM is ostensibly a theory under FMT, how could there possibly be subtypes in Object-Role Modeling if there is no such thing as a type hierarchy in theories under FMT? And why?

Let us start with “why”. Why would you dispense with hierarchies of types in a finite model theory? The reason is that higher order theories, which do support type hierarchies, are known to be inconsistent as proven by Kurt Gödel in his famous Incompleteness Theorems.

If Dr Halpin was to design a conceptual modelling language ranging over data models that govern things like the trajectory of important communications satellites, say, then the language had best be one that did not have an interpretation that was inconsistent, and that could lead to disastrous data errors costing many millions of dollars to rectify.

It was likely this thinking which drove Dr Halpin to choose a theory under finite model theory to describe Niam, the early incarnation of Object-Role Modeling.

So? You are probably asking. “That does not explain why ORM has subtypes when such things are not supposed to exist in finite model theory”.

Too true. How could Dr Halpin have his cake and eat it? After all, it makes a language useful to be able to say that a Child is a subtype of Person. It makes communication and partitioning of a model easy.

Dr Halpin’s trick was to pretend there was no implied hierarchy at all. The trick was/is to pretend that whenever you see a purple subtype line in ORM, what you are actually seeing is an obfuscated Fact Type merely mapping a common, ordinary, everyday relation between Child and Parent. If someone happens to be a Child, by virtue of that relationship to Person objects of that Child bag must have a relationship with first-Name and last-Name. What hierarchy? We achieve things via transitive relationships.

In some Object-Role Modeling software, you can right-click on a purple subset line and elect to see the implied Fact Type between the “subtype” and its “supertype”, thus pretending/asserting they are not types of hierarchy at all. Here is what that looks like (viz the Fact Type at the left of the diagram with Roles marked, ‘Subtype’, and ‘Supertype’).

Implied Fact-Type for a Subtype Relationship in Object-Role Modeling

Once you have convinced yourself that this relationship exists, then you can right-click on the purple subtype line and hide the implied Fact Type.

Probably the best way of thinking of the implied relationship of ostensible subtypes in ORM is to not think of the objects of the relative Entity Types and Value Types as under any hierarchy at all. For example, let us envisage them as marbles on a tabletop, all on the same level and as below:

ORM Subtype viewed alternatively as not under a type regime but flat transitive relations

Viewing a “Child is subtype of Person” as not under a type hierarchy, but rather a relation between object types of equitable conceptualisation, reduces “Child has first-Name because Child is a subtype of Person” to “Child has first-Name by virtue of a transitive relation because of a special subtype relation between Child and Person and Person and first-Name”.

In this way the notion of hierarchy is dispensed with and we envisage the objects of Object-Role Modeling in a manner as acceptable to finite model theory, at least in theory and under a standard interpretation of ORM. While this standard interpretation of Object-Role Modeling is prescribed by Dr Halpin’s thesis, it is certainly not the only interpretation of sentences/diagrams written under the formalised grammar of ORM.

Non-Standard Interpretation of ORM

The most natural way for people to perceive of subtypes is in a Subtype/Supertype hierarchy. That is, of course, why we have such words as subtype and supertype in the first place and both with type suffixes in the words.

So Dr Halpin’s thesis has always had a battle on its hands, to be frank. Why not call the special purple lines Implied Transitive Relationships, or something similar, and not court controversy by thumbing a nose a higher order theories as unsuitable for the purposes of ORM, but all the while using words with type in their name in some sort of implied hierarchy? That is, why use the words subtype and supertype, Entity Type and Value Type at all?

Only Dr Halpin can answer that one. I suspect a combination of indifference to confusion, a rebellious nature and a sincere hope that only those suitably trained in logic would ever bother to question why. Indifference to confusion belies an opportunity for endless discussion about Object-Role Modeling. It makes for good party talk for those interested in logic. Using the suffix type to define something ostensibly synthesised as nothing of the type (pun intended) certainly also provides opportunity to defend a thesis. So let us have an interesting conversation…

Is Dr Halpin’s thesis defensible? Are we duty bound to adopt a standard interpretation of ORM under finite model theory as the only interpretation to the necessary exclusion of all other interpretations? What if we wanted to envisage a hierarchy when we look at subtypes in an ORM diagram? What if our tendencies were toward a higher-order logical interpretation of ORM?

The good news is that you get to choose and do as you please with Object-Role Modeling under non-standard interpretation and Ehrenfeucht Fraisse Games. If a higher order interpretation suits your needs and if you are aware of the consequences of jumping to higher-order logic, you go for it, nobody is going to stop you. Indeed nobody can stop you.

Protagonists of finite model theory argue that because the data objects of our focus under Object-Role Modeling invariably can be envisaged as data stored on a computer hard-drive somewhere, then you are duty bound to consider the functions ranging over that data as limited to the finite. “There is only limited physical room on a hard-drive, so data on that hard drive is necessarily finite in its size”. That is how the theory of finite model theory works at least. The reality is that you, as interpreter of that data, get to conceptualise whether it is under model ranging to the infinite of not. You are a fundamental component of the function of interpretation.

Ehrenfeucht Fraisse Games ensure this, and fall under a broader notion that all of logic is a game. At one time you may choose to view theories of ORM under finite model theory. Another time, you might choose to view the same sentences of ORM as under a higher order logic. In fact, this is the Achilles heel of finite model theory…you cannot control an interpreter, you can only specify a standard interpretation and hope for the best.

Subtypes – To be or not to be?

Quite obviously, to get along with members of the ORM community it pays to acknowledge and respect the standard interpretation of ORM that sees subtype relationships as merely transitive relationships with no hierarchy. You may as well acknowledge the game.

Under the standard interpretation of ORM subtypes are not under a hierarchy at all.

At the same time, however, if you really need to use Ehrenfeucht Fraisse Games for your research or project, then you should ask the ORM community to accept that there are cases under which ORM has valid and useful non-standard interpretations. Invariably all of logic heads towards being studied under games.

For the purists among you, and equally as rebellious as Dr Halpin, you can always point to where Object-Role Modeling v2 is ambiguous under certain circumstances anyway (here), and realise that as a man-made construct ORMv2 suffers the same inconsistencies as Godel exposed of higher-order logic, if you so choose to view ORM diagrams under the lens of Ehrenfeucht Fraisse Games extended to higher order.

That is, subtypes in Object-Role Modeling open the door to interesting conversations in logic, apart from simply allowing you to say a Child is a kind of Person.

NB This article was inspired by one or two papers written by Dr Halpin which explain why Object-Role Modeling must be interpreted under finite-model theory. When I find those again I will link to them here. My deepest feeling is that science and logic only progress if we challenge that word, must, and I feel it is time we opened the door to researchers of higher order logic over Object-Role Models.

— — — — — — — — — — — — — — — —

--

--