In the second part of this blog series we learn how to create an expert system using ontologies. Ontologies are formal representations of the knowledge by a set of concepts within a domain and the relationships between those concepts.
There are a lot of different technologies to build expert systems. What are the advantages of ontologies? First they are strong doing classifications and this is very useful for error analysis. Let me give the following example: if an application consumes too much memory the AS ABAP can kill the process or throw an exception that can be handled by the application and this can lead to an error message and a controlled exit or just give out a warning. So this memory problem can lead to different reactions of an application: protocols, logs, dumps and so. An automated error analysis will recognize these reactions as a specific error situation which is a memory problem in our case. More abstract it will be perform an error classification. It's not hard to imagine that these error situations ca be modelled as a tree of classes in an tree where each subclass is a specialisation of its parent. And dealing with those classifications is a strength of ontologies.
Another strength of ontologies is extensibility. Our show case (classification of BAL messages) is very simple but a monitoring tool in an heterogeneous system landscape will get information from lots of data sources and each one will use its own vocabulary to describe error situations. But this is nothing to frighten because there techniques to merge different ontologies so we can build bridges between them.
Those extensibility leads to another advantage of ontologies: they rely on open standards which can be used in web based architectures. Ontologies or parts of ontologies can be interchanged as XML messages f.i. as web services.
In the following I will define a ontology that contains an knowledge base together with a set of messages to be classified. In fact such an ontology will be created by an expert system from the data of a wiki as well as AS ABAP. But before we automate the process we have to do it at first manually. Therefore I use a tool called Protégé for expert and do the following:
An ontology can be serialized in XML and this one possible way how to build an expert system: we mash up the input to data into an ontology and use a reasoner to solve a classification problem.
In our domain model I'm creating with Protége there is the concept of an error and a message that corresponds to a BAL message. An error has a set of messages which indicate the problem:
Message has some properties which are strings: a message has a class, a number, a BAL object, a BAL subobject and a type:
An error is modelled as a class with subclasses corresponding to error situations which are defined within the wiki. And this is how we do it: in the following define a special error class corresponding to the example in the last weblog: "Error_in_Transfer_of_FI-CA_Totals_Records_to_General_Ledger".
In
In fact this error is characterized by the existence of two special BAL messages within a protocol:
BAL Object | BAL Subobject | Message Class | Message Number | Type |
FICA | FPG1 | >U | 435 | E |
FICA | FPG1 | F5 | 808 | E |
This fact can be expressed by following logical expression:
So far we defined a domain model and a class respresenting an error situation. By creating similar classes we can encode the knowledge defined in the wiki as an ontology.
The expert system works as follows: we have a set of BAL messages which come from a protocol within AS ABAP. For these messages we define a protocol (as instance of the error class) that contains both messages as a simple example:
When we have a protocol like the one above we want to know whether it fulfils the logical conditions of error situations like "Error_in_Transfer_of_FI-CA_Totals_Records_to_General_Ledger". The expert systems gives those classification back to the user who can have a look at the corresponding wiki pages to get more information about the error situation.
We can use Protégé´s reasoning functionality to ask for a classification. It's not surprising that the message belongs to problem class "Error_in_Transfer_of_FI-CA_Totals_Records_to_General_Ledger":
In this blog we learned
In the next instalment we deal with some pesky technical issues: data extraction from wiki and AS ABAP and the ontology creation.
I you are interested in the ontology we created in this blog entry you can find it here.