What is the difference between an Ontology and a Business Rule?

This is a question we often get. In this article we will explain both concepts, and show you how they are interrelated. In short, an Ontology defines the structure and meaning of the type of things (entities) within a domain, whereas Business Rules define or constrain the behavior of those things.

Before we will go into the details, let’s first try to define both topics.

What is an Ontology?

An Ontology is: a model that defines the type of things (entities) that exist in a domain, the properties (attributes) that can be used to describe them, and the relationships between those things. An Ontology is quite static and abstract by nature. For instance, an Ontology does not contain actual data about instances of entities. That is where the term Knowledge Graph comes into play. When you build a data set containing actual instances of the type of things defined in an Ontology, you end up with a Knowledge Graph! But a Knowledge Graph only passively stores data; when data is added there is no reaction to be expected, and the structure of the Ontology is not actively guaranteed. This is where Business Rules come in the picture.

What is a Business Rule?

A Business Rule is: a definition of the behavior of the type of things (entities) in a domain that is expected or prohibited under specified conditions. So a Business Rule is more dynamic by nature, but still quite abstract. If you don’t have a system that automatically executes the Business Rules for you, still nothing happens when you enter data into your Knowledge Graph. So we need to add a Business Rule Engine that can add dynamic behavior, and guarantee that the data of our domain follows the structure as defined in our Ontology.

Combining an Ontology with Business Rules

Hapsah is an Ontology driven Knowledge Graph and Business Rule Engine in one. So you can define both an Ontology and a set of Business Rules for a domain.

Define your Ontology

Defining your Ontology in Hapsah is done in three steps:

  • Nouns: Create a vocabulary of nouns that define the type of things (entities) and their properties (attributes)
  • Verbs: Add verbs to your vocabulary that define the relationships between those things
  • Statements: Write short sentences that connect things (Subject nouns) via relationships (verbs) with other things or their properties (Object nouns)

Define your Business Rules

Writing a Business Rule in Hapsah is done in four steps:

  • What: Select the things (entities) that are relevant to that Business Rule
  • When: Define in which condition those entities should be for the Business Rule to be executed
  • Do: Specify which operations (e.g. calculations) need to be performed when the Business Rule is executed without changing any data yet
  • Then: Describe the actions that need to be executed that change data in the domain (e.g. create a new entity, or change an existing entity)

If you are interested in more detailed explanations, we have tutorials for each of the steps mentioned above: https://www.hapsah.org/tutorials/

We also have a Quick start tutorial, Hello world style: https://www.hapsah.org/hello-world/