Skip to Content
Author's profile photo Tobias Trapp

Modelling Rulesets Using Ontologies

Many decision services are classifications: a certain case (think of an insurance claim) has to classified by looking at the facts related to this case. The processing of this case consist of a chain of classifications:

  • at first we have to find out the claim type – think of an accident for example
  • then we have to find out the subtype  – think of an staircase accident
  • then we have to find out whether this could be a distinctive feature and its type – think of a potential fraud case for example
  • if the result of a classification is a distinctive feature it is likely that automatic processing has to be stopped and we have to find a person in charge who does a manual control, so we have to assign it to a working sets which is a classification, too.

So classifications are, besides calculations, an important type of decision service which occurs quite in automatic processes and especially in data driven IT systems. Therefore business experts define classifications as business rules which can be implemented using BRFplus for example. As blueprint I use ontologies, a tool from knowledge management that describe conceptual models using description logic. I will use an open source tool for creating ontologies and test an inference using an open source reasoner. If you have experience with so called semantic technology you can use them to analyze, structure and document decision service that compute classifications. With some more effort you can check consistency of your models.

Ontologies as Blueprints for Decision Services

The idea is very simple. Ontologies are artifacts which are used to model knowledge domains: concepts as formal definitions and entities that are realizations or materialization of those concepts. Knowledge workers dealing with very complex domains use them to formalize theories – think of classification of diseases, genes etc. with open standards like OWL. Moreover you can compute inferences and check models using open source tools. If you are a familiar with ontologies and tools like Protégé you will able to formalize your domain model, get a deeper understand, visualize it and even can check it. This formal description could be a specification for a BRFplus implementation where a classification could be developed by one or more functions or a few rulesets. So you can use the ontology can be used a blueprint for a BRFplus implementation.

A Simple Example

In the following I will show you a simple example. The domain model consists of:

  • incidents – that is the class if objects that have to be classified
  • as the result of the specification there are subclasses
  • a certain subclass StaircaseAccident is a special incident that has the information (given by the claim holder) that it is indeed an accident where a staircase is involved
  • then we define a rule that says that an information about a slippery staircase is sufficient for a staircase accident
  • after that we define an incident having information about a slippery staircase and the reasoned will confirm the inference that it is a staircase accident as expected

This is done in a few seconds using Protégé ontology editor. At first I’m creating a concept of an Incident and a special accident where stairs are involved:


The concept is called “class” which means that elements (called individuals) can belong to it. If we want to perform a classification we will test whether a certain element belongs to the class – in our case staircase accident. But to do this we need some logical conditions which are defined in the following.

Therefore I define an information – in our case it is a statement of a claims holder which is the fundament of a classification in our case. We define two special types of information: the first says that we have a general accident on a staircase and the second one say that the staircase was slippery:


We define this information as a so called datatype property that assigns a value (“yes”, “no”, “nor information”) to this incident:


This is used to define a class: a StaircaseAccident is an incident where we have the additional information that the staircase was involved using above define datatype property:


Now we add the following rule to the ontology: if there is the information, that if the staircase was slippery we assume that the information is about a staircase accident:


This could be done using OWL but here I use the feature that an OWL ontology can be enhanced using SWRL rules.

No we define a concrete claim as an incident (member of Incident class) having a information about slippery staircase:


Now I switch on the reasoner (HermiT supports SWRL inferences) in Protégé that computes above defined classification as an inference: the member Claim was by definition an Incident but because of above defined data type property and a SWRL rule a memeber of StaircaseAccident class.


This inference is a very simple example but I blogged about more complicated inference in blogs of my “Enter Semantic” series. Unfortunately they have been scrambled after SCN migration and it is very difficult to restore them because in many examples using XML and URIs. Even if SCN team corrects them it will take much time for proofreading the corrections. But if there people who are interested in my old blogs I could spend some time on checking them.

Reasoners can do a lot more by evaluating logical conditions: they can test whether a class is a proper subclass or superclass of another class, they can calculate whether classes are disjoint and test logical consistency of an ontology. But I will come back to that topic in a future blog. This is in fact a very interesting topics because sometimes domain experts experts disagree in their conclusion and with ontologies you can formalize the differences.

Strengths and Weaknesses of the Approach

You can use ontologies to analyze and document complex domain models and classifications. Those models can contain comments and annotations which is very useful as documentation. Moreover you can define axioms to ensure consistency of your domain models with regards to those axioms. But ontologies have also weaknesses:

  • Although you can use data types with ontologies and perform calculations you don’t have the strength of expression and tool support of BRFplus. Even generation of BRFplus artifacts from ontologies can be complicated.
  • You can use Horn-like clauses(SWRL) in an ontology but I don’t think it can be used to exchange rules between BRM systems.But I will come back to ontologies in later entries of my blog and discuss more and even advanced applications in the area of business rules.
  • Features from description logics can be quite confusing if you have no experience with mathematical logic.

But if you have experience with ontologies you have a powerful tool to analyzee, structure and document domain models.

If you want to try out the example above I recommend you to download Protégé and import the attached document as ontology in OWL 2.0 syntax.

Assigned Tags

      You must be Logged on to comment or reply to a post.
      Author's profile photo Former Member
      Former Member

      Thanks for the example, it is very interesting to see semantic technologies applied to classification tasks.

      I wonder if Pellet etc. have any performance issues on large data sets. You mention that the rules developed in OWL+SWRL can be used as a blueprint for BRFplus, but would it be possible to use semantic web tools such as Pellet directly? Or is it usually better to create a model in Protege and then translate it eg. to BRFplus?

      Author's profile photo Tobias Trapp
      Tobias Trapp
      Blog Post Author

      I had promising performance results using Pellet directly (but only in private prototypes) but this approach has the drawback that you have to create a model and transfer it from the SAP backend to an external system which is painful in mass processes. But Pellet hat many great features like conjunctive queries and –most important- data type reasoning. I learned that bridging different data types is most important since otherwise there is the danger that you will find classifications for non-defined input sets and get wrong results.

      And this is the challenge: Since your ontology usually won’t have an SAP compliant type system, I don’t think automatic transformation from OWL to BRFplus  will be easy. The reason is that SAP systems are highly configurable and most entities (think of claims types, subtypes and so on) are defined using customizing. So you will have to generate an ontology representing the type system, then create your classification on top of it and generate a BRFplus ruleset from it.

      This is possible but in most cases it will be quite heavyweight approach. In contrast I was using OWL to scetch my domain as a concept model for classification services and if my understanding of the real world domain is good, I’ll switch to BRFplus and creating a ruleset side by side.

      So I think there are two possible directions for research:

      • generation of SAP artifacts (customizing, rulesets) using ontologies – where the “SAP type system” will be a challenge
      • how to use ontologies for specification and maintenance (but not generation) of decision services

      Best Regards,

      Author's profile photo Carsten Ziegler
      Carsten Ziegler

      First, thanks once again for this interesting blog.

      I have met customers that work (or worked) with ontologies and respective tools. Some problems can be observed in almost all cases:

      • effort significantly higher than expected
      • ontologies have a tendency to grow and grow and grow
      • mismatch with SAP typesystem and data model
      • growing disconnect between ontology and SAP with subsequent conflict "need to change SAP to follow ontology" <> "not possible/acceptable"

      Personally, I do not have much of experience. However, I think that tools like Decision First Modeler may be an interesting alternative in the specification phase.

      Author's profile photo Tobias Trapp
      Tobias Trapp
      Blog Post Author

      Hi Carsten,

      you are absolutely right about the problems. There are two reasons why I'm trying this out at the moment: at first I have some experience to export the SAP type system to a "basis" ontology and to perform reasoning with the entities - and I blogged about it on SCN before. But the problem is that most domain experts don't have a deep understanding of SAP data models. And so I took the chance to muse about a good connection between description logic and set of rules, but I am well aware that this is a research project.

      But there is a second reason: I tried to download Decision First Modeler and had to fill out a registration before the download a trial version for evaluation. At the end of the registration process there was a message that I would be contacted via email and now I'm still waiting for it and gave it up finally. Perhaps I'll try it again next year.

      Best Regards,


      Author's profile photo Former Member
      Former Member


      Sorry to hear you did not get the emails. Contact me - - and we will get the information re-sent to you. I see you in the sign up log so you have an account, perhaps the emails ended up in your SPAM folder.


      Author's profile photo Tobias Trapp
      Tobias Trapp
      Blog Post Author

      Thank you for your offer, I just sent you an email.

      Best Regards,