Knowledge Base
A knowledge base is a named "repository" that stores structured knowledge ". The knowledge base is like the file directory on the hard disk, but the knowledge base structure cannot be nested. Therefore, the Knowledge Unit in the knowledge base has two-layer structure names: Knowledge Base name and Knowledge Unit name.
In a web server program, we may see some actual examples:
header.cookie('session=123456789;remember=the_alamo')cookie.session(123456789)cookie.remember(the_alamo)header.accept_encoding(gzip)header.accept_encoding(deflate)request.path('/my/site.html')request.path_segment(0, my)request.path_segment(1, 'site.html')request.path_segment(-2, my)request.path_segment(-1, 'site.html')
Note that there are three different knowledge bases (both the response Library) named header, cookie, and request, each with some fact statements.
The second part of the knowledge base name is the name of the Knowledge Unit. The knowledge unit can be considered as the type or topic of a fact statement:
- Request:Knowledge Base name.
- Request. path_segment:
- The name of a knowledge unit or fact topic.
- Request. path_segment (-1, 'site.html '):
- A detailed statement about the theme request. path_segments of a knowledge unit.
Usage of Knowledge Base
In the end, Pyke aims to prove the authenticity of a fact statement. For example, to answer the question: "is a statement true ?". There are several different types of knowledge bases, and their usage is also different:
- As shown in the preceding example, a series of simple fact statements are called the Statement Library.
- They are known facts that can be used to test the authenticity of other statements.
- A rule repository composed of if-then rules.
- Run their if-then rules to determine whether a statement is true.
- A rule repository can contain forward and reverse inference rules.
- It may be necessary to use another knowledge base to determine the authenticity of the statement. Pyke has two countermeasures:
- "Question Bank" refers to the statement that asks the end user.
- A special knowledge base contains some knowledge units for one-time use to do special things. For example, run the underlying system command to check its output data and the exit status.
- This knowledge base only provides an example called special.
Note
The knowledge base name is dedicated. No matter whether it is of the same type or not, each knowledge base must use a separate name.