Printer Problems Diagnosis#
This small demo example shows the basic functionality of KnowWE and its corresponding knowledge representations for the formalization of diagnostic knowledge.
We build a knowledge base for deriving the reasons for the faults of an imaginary printer.
Contents
Set-Up#
Annotate Wiki Articles#
Every article containing knowledge of the printer example needs to be tagged in a special manner. We choose the tag name Printer_Demo and we insert the annotation%%Package Printer_Demointo every particular article containing knowledge.
Define the Knowledge Base Center#
In general, the knowledge base can be distributed across many wiki articles (each of them tagged with Printer_Demo). Therefore, we need to define a place where all knowledge elements are collected into a single knowledge base. For this, we use the KnowledgeBase markup in the following manner:%%KnowledgeBase Printer Fault Diagnosis Demo @author: joba @version: 1.0 @uses: Printer_Demo %
By inserting the markup the following center is provided:
Terminology#
In the first step we need to define the terminology of the planned system, i.e., the inputs (user entries) and the outputs (derived solutions).
Solutions#
We define the competence of the knowledge base by enumerating all possible solutions, i.e., faults, for the printer problem. The derivable solutions are as follows:
- Connection problems
- Broken cable
- Cable not connected
- No Wifi connection
- No power supply
- Printing quality problems
- Empty toner
- Dirty toner
We see, that we have structured the solutions into meaningful groups, i.e. connection problems and printing quality problems. More groups can be added easily. The structuring of solutions is especially useful when the knowledge base and the number of solutions, respectively, increases.
The d3web markup of the solution hierarchy is as follows:
%%Solution Connection problems - Broken cable - Cable not connected - No Wifi connection - No power supply Printing quality problems - Empty toner - Dirty toner No solution found %
Please note, that we added the solution No solution found for the case, that the system cannot derive an appropriate solution. When inserting the markup into the wiki article, the following section is shown.
Questions#
To derive the solutions we need to pose appropriate questions to the user. Since, we expect many questions to be included in the knowledge base, we group the questions into meaningful questionnaires.
First, we define an initial questionnaire that tries to identify the problem area of the user and use the following markup:
%%Question Problem specification #1 - Please specify your problem [oc] -- Printer does not print -- Printing with bad quality -- No else %
The annotation #1 specifies, that the questionnaire Problem specification is posed as the initial questionnaire in a dialog session with the user. When inserting the markup into the article, the questions are created.
Each problem area corresponds to a group of solutions. That way, we define a questionnaire for each problem area in order to differentiate the solutions within the problem area.
Problem Area: Connection Problems #
The questions of the problem area connection problems are as follows:
Problem Area: Quality Problems#
The questions of the problem area quality problems are as follows:
For the internal computation of the abstraction questions we define the following rules, by the Rule markup. In the following, we define a rule computing the ratio between the expected toner life (Toner capacity) and the current use (Paper count). Two further rules derive a normal or a low toner usage by using the derived value of the abstraction question Current capacity ratio:
%%Rule IF Toner capacity = KNOWN AND Paper count > 0 THEN Current capacity ratio = (Toner capacity / Paper count) IF Current capacity ratio >= 1.1 THEN Toner usage evaluation = normal IF Current capacity ratio < 1.1 THEN Toner usage evaluation = low %
When inserted into the wiki article, the rules markup looks as follows:
Human-friendly Prompts of Questions/Solutions#
It is reasonable to define short names for questions and solutions because they are often used in the markups. When used in the dialog, however, longer verbalizations may be useful. You can define a longer prompt for questions/solutions by using the Property markup. Moreover, the prompts can be internationalized.
Derivation Knowledge#
After the definition of the terminology we need to define knowledge elements that implement the derivation and dialog behavior of the knowledge base. For that, d3web/KnowWE provides a number of alternatives ranging from scoring rules, decision trees to set-covering models. In this tutorial we show how to implement the derivation knowledge as a DiaFlux flowchart model.