Why put Object-Role Modeling at the heart of a knowledge graph database?
Object-Role Modeling is a form of conceptual modelling that uses natural language constructs.
Object-Role Modeling was invented by Terry Halpin, originally as Niam, as output of Halpin’s PhD thesis awarded in 1989.
In one of Terry Halpin’s latest books, “Object-Role Modeling Workbook”, a proponent of Halpin calls him a “genius” in the foreword. I would not go that far, but there are many good things to be said about Object-Role Modeling. Indeed that is why I have built two Niam/ORM software tools in the last 25 years, the latest being my company’s Boston Object-Role Modeling software.
The wonderful thing about Object-Role Modeling is that it allows you to define data structures and their constraints which can be read/defined in natural language. ORM diagrams are a combination of graphical constructs interwoven with natural language.
Clifford Heath, of www.dataconstellation.com, has gone one step further with what he calls the Constellation Query Language which maps nearly all of ORM2 (Object-Role Modeling v2) to natural language, so that you do not need to use diagrams if you do not want to.
Let us have a look at both ORM and CQL and see why Object-Role Modeling may be useful right at the heart of a knowledge graph database.
The following is a small ORM Diagram. It speaks of persons who have pets and skills. The model itself is quite arbitrary, but we keep it that way for our purpose of demonstrating the language.
The ORM Diagram above reads, in its simplest terms, “for each Person at least one of the following is true, that Person has some pet-AnimalType, that Person is learning some Skill”. Indeed, in Object-Role Modeling software you can generally click on the Exclusive OR Constraint (the circle with the X and dot in it) and the software provides the verbalisation of the constraint:
Perhaps an unusual model, but it demonstrates the mix of graphical symbols and natural language in Object-Role Modeling.
Object-Role Modeling within a knowledge graph database
While diagrams of a model are convenient, many databases have a combination of both a graphical representation of the structure of the database and a means of defining that structure in some form of text based language. E.g. Entity Relationship Diagrams and Structured Query Language (SQL) for relational databases.
Where the text-based verbalisations of an otherwise graphical Object-Role Model/Diagram can be generated from ORM diagrams, the converse is also conceivably true…Object-Role Model Diagrams (and their underlying structure) can be generated from a text-based language.
Indeed, this is the thesis of Clifford Heath’s CQL language. So the diagram above (at least the Exclusive OR Constraint) can be constructed by saying something like:
Each Person occurs at least one time in either Person has pet-AnimalType, Person is learning Skill
NB Heath’s CQL would leave out the “either”.
That is, with Object-Role Modeling at the heart of a database you can define the structure of data within the database, and the constraints over that data, by diagrams or by a controlled natural language.
In 2015 we took some time off to build a rudimentary database with the metamodel of Object-Role Modeling used at the data definition layer of the database. We called that database, Bradford.
The following is a basic example of how you would define the Exclusive Or constraint (above) within a database that supports Object-Role Modeling at its core:
NB With the metamodel of Object-Role Modeling at the core of the data definition layer of the database you can use Code Completion (what Microsoft calls IntelliSense) to help you complete the natural language instructions over the database. That makes life easier, and is what we show in the video.
Within this article, we further demonstrated that controlled natural language operating over the data definition layer of a database can be augmented by the likes of code completion to make life easier when working with the database, all the while in language that it easy to understand.
— — — — — — — —
Copyright notice: Please note that Constellation Query Language is copyright to Clifford Heath and the sample of derived CQL in this article is made under provision of the of License.txt at https://github.com/cjheath/activefacts