Description

Introduction

Knowledge-based Systems

A Knowledge-based System is a so-called Expert-System. It contains a knowledge which usually is only known to experienced persons working in that profession for many years. For example a doctor can make a diagnosis after asking his patient just a few questions. His knowledge (i.e. the symptoms of an injury) allows him to estimate the injury of the patient.
This knowledge is to be put into a software system so it will be able to make the same diagnosis. The process of knowledge acquirement is quite difficult and requires the software developer to work hand in hand with experts on the specific topic.
A Knowledge-based system can also make recommendations, calculate propabilities or make a classification. Within the project we concentrated on the recommendation process which uses the algorithm of Hierachical Classification.

To explain this algorithm we use a simple example: A customer wants to buy a new mobile phone and has to decide for a certain rate. The system replaces the phone vendor who knows about all the rates and their advantages and disadvantages.
First, we have the observations, basic values given by the user (the customer). For example this could be the average amount of hours per month a customer uses his mobile phone to make calls. Lets call this observation talkingHoursPerMonth. Through abstraction we get classes of observations, which divide the observations into groups. An example would be: If talkingHoursPerMonth > 20 then the observation class is extensiveUser.
Now we can make a classification which will give us a category class. This could be rateForExtensiveUsage. Through a hierarchical data structure we can specify the category class until we find a matching category, e.g. rateA.
Figure 1 shows the process of a Hierarchical Classification and the actions performed to get from one state to another. In some cases it's possible to go directly to a category or class, i.e. to take a shortcut (the dashed lines). But this depends on the rules.

General View on a Knowledge-based System
Figure 1: A general View on a Knowledge-based System that is able to perfom Hierachical Classification

Technical Functionality

We decided to base the complete user interaction on AJAX. So once the main page (index.php) is loaded it will never has to be loaded again. If the user refreshes the page it will lose the current content and load the page anew showing an empty content box. All the session data (i.e. his login data) will be remembered.
The page consists of three blocks: The Login Box, the Menu Box and the Content Box. The Menu Box is used to navigate through the page, it will load content via AJAX into the Content Box. The Login Box is used for login and logout functionality.
All needed Java Script and Stylesheet files are included within the index.php. For all the Java Script widgets and the AJAX functionality we used the SPRY framework.

File Structure

Figure 2 shows all PHP files that build the system. The arrows display the way the files are used. "AJAX" indicates that content of the file is loaded via AJAX into a SPRY HTML-Panel while "include" represents a PHP-include.

File Structure Diagram
Figure 2: A diagram displaying the involved PHP files and the way they are accessed

The Database

Entity Relationship Model



ER Diagram
Figure 3: The Entity Relationship Model of the database upon which the whole application is built

The field Conditions within the Rule table contains a logical expression using the IDs of the Condition table. A AND condition is always treated first, there exist no bracketing. So the expression A&&B||C&&D will be treated like it was A&&(B||C)&&D

An examle:
We have three conditions: and a rule with the expression 1&&2||3.
This resolves as follows: A > 12 && B == 10 || C < 1