Knowledge Base Integrity, Knowledge Nodes and Dependencies

knowledge nodes - sentence model graph  - dependency graph - knowledge integritysuspension of records

See also: sentence derivation

General topics: Pro/3 home page  -  documentation overview - What is Pro3?

 

It is important to distinguish between two types of dependencies in the knowledge base:

  • referential dependencies within elements of the sentence model, and between the sentence model and sentences, rules and functions ("syntactical dependencies)

  • logical dependencies which determine the inference strategy (the sequencing of knowledge (sentence) derivations ("semantical dependencies")

Pro/3 analyzes and tracks these two types of dependencies in two acyclic graphs - referential dependencies in the sentence model graph (SM-graph for short) and logical dependencies in the knowledge dependency graph (DP-graph for short). There is also a third graph which is a "lower-level" version of the knowledge dependency graph called the derivation graph (DR-graph for short). The edges of these graphs are known as knowledge nodes or simply nodes.

The edges of the graphs are represented as sentences in the knowledge base, corresponding to the following three sentences types:

  • node is referred to by node (SM-graph)

  • node determines node (DP-graph)

  • node derives node (DR-graph)

The node entity type node has two data elements node type (an integer) and node name (a string). The sentences representing the graphs are referred to constantly by Pro/3, and they are performance reason stored in RAM cache which mirrors the sentences in the KB.

Knowledge nodes

The many elements of structural and application knowledge are referred to as knowledge nodes:

NODE TYPE

NODE TYPE

NODE NAME

0 ANNOTATION (no name)
1 PREDICATE TYPE - SENTENCE GROUP Predicate type
2 SENTENCE TYPE Predicate type  | Entity type [ | Entity type ]
3 SENTENCE RULE CHAIN | REALM | SENTNO | SUBNO
4 FUNCTION (GENERIC) Function
5 OPEN SENTENCE TYPE Predicate type  | Entity type |_  or   Predicate type  |_| Entity type
11 DERIVED SENTENCES OF A GIVEN TYPE Predicate type  | Entity type [ | Entity type ]
12 ENTERED SENTENCES OF A GIVEN TYPE Predicate type  | Entity type [ | Entity type ]
13 DATA ELEMENT TYPE Data element type
14 ENTITY TYPE Entity type
15 INEXACT RULE DEFINITION Inexact rule
16 INEXACT RULE DECLARATION Inexact rule
17 FUNCTION DECLARATION Function
19 FUNCTION DEFINITION Function
21 REALM REALM
22 DATABASE DATABASE ID
24 SEGMENT SEGMENT
25 SERIES INPUT FACILITY Inexact rule (which is the basis of the series)
26 CLUSTER INPUT FACILITY location rule | prompt
27 TABLE LAYOUT Predicate type  | Entity type [ | Entity type ]
28 KB QUERY menu id
29 KB QUERY CLUSTER menu id
30 KB QUERY MENU menu id
31 KB QUERY PARAMETER name
All relevant names are IF-format. * cluster facility   ** series facility

Sentence model graph

Knowledge nodes are represented in the graphs by their node type and node name. An edge in the graph represents the directed dependency (node type,node name) ---> (node type,node name). The directed relationship is known The first node is known as the determinant, while the second is known as the dependent. The table under shows the types of direct dependencies in the sentence model graph.

 
                                         SENTENCE MODEL GRAPH
DETERMINANT DEPENDENT
any knowledge node except annotation 0 - ANNOTATION
1 - PREDICATE TYPE 11 - DERIVED SENTENCE TYPE including the predicate type

do.

12 - ENTERED SENTENCE TYPE including the predicate type
do. 25 - SERIES INPUT FACILITY referring to the predicate type
do. 27 - TABLE LAYOUT for the sentence type

do.

28 - KB QUERY including the predicate type
13 - DATA ELEMENT TYPE 14 - ENTITY TYPE referring to the data element type
do. 1 - PREDICATE TYPE referring to the data element type
do. 17 - FUNCTION DECLARATION using the data element type as formal parameter 
do. 16 - INEXACT RULE DECLARATION using the data element type as formal parameter

do.

25 - SERIES INPUT FACILITY using the data element type as formal parameter

do.

26 - CLUSTER INPUT FACILITY using the data element type as formal parameter
14 - ENTITY TYPE 11 - DERIVED SENTENCE TYPE including the entity type

do.

12 - ENTERED SENTENCE TYPE including the entity type
do. 25 - SERIES INPUT FACILITY referring to the predicate type
do. 27 - TABLE LAYOUT for the sentence type

do.

28 - KB QUERY including the entity type
16 - INEXACT RULE DECLARATION 15 - INEXACT RULE DEFINITION

do.

25 - SERIES INPUT FACILITY referring to the rule

do.

26 - CLUSTER INPUT FACILITY including the rule
17 - FUNCTION DECLARATION 19 - FUNCTION DEFINITION

do.

28 - KB QUERY calling the function
28 - KB QUERY 29 - KB CLUSTER QUERY includes query

do.

30 - KB MENU includes query

do.

31 - KB QUERY PARAMETER used in query
29 - KB CLUSTER QUERY 30 - KB MENU includes query
30 - KB MENU 30 - KB MENU includes query

There are also indirect sentence model dependencies found in the dependency graph (under).

INDIRECT SENTENCE MODEL DEPENDENCY TYPES (FOUND IN THE DEPENDENCY GRAPH)
DETERMINANT DEPENDENT

 11 - DERIVED SENTENCE TYPE via 2 - SENTENCE TYPE

3 - SENTENCE RULE referring to the sentence type
do. 19 - FUNCTION DEFINITION referring to the sentence type
do. 15 - INEXACT RULE DEFINITION referring to the sentence type
do. 27 - TABLE LAYOUT for the sentence type

 12 - ENTERED SENTENCE TYPE via 2 - SENTENCE TYPE

3 - SENTENCE RULE referring to the sentence type
do. 19 - FUNCTION DEFINITION referring to the sentence type
do. 15 - INEXACT RULE DEFINITION referring to the sentence type

16 - INEXACT RULE DECLARATION via 15 - INEXACT RULE DEFINITION

3 - SENTENCE RULE with call to the inexact rule
do. 15 - INEXACT RULE  DEFINITION with call to the inexact rule

17 - FUNCTION DECLARATION via 19 - FUNCTION DEFINITION

3 - SENTENCE RULE with call to the function
do. 15 - INEXACT RULE DEFINITION with call to the function
do. 19 - FUNCTION DEFINITION with call to the function

Knowledge Dependency Graph

KNOWLEDGE DEPENDENCY GRAPH

DETERMINANT

DEPENDENT

1 - SENTENCE GROUP 3 - SENTENCE RULE using the sentence group*
2 - SENTENCE TYPE 3 - SENTENCE RULE using the sentence type in the condition
     " 19 - FUNCTION DEFINITION referring to the sentence type
     " 15 - INEXACT RULE DEFINITION referring to the sentence type
3 - SENTENCE RULE 2 - SENTENCE TYPE concluded by the sentence rule
     " 5 - OPEN SENTENCE TYPE concluded by the sentence rule
     " 1 - SENTENCE GROUP* concluded by the sentence rule
15 - INEXACT RULE DEFINITION 3 - SENTENCE RULE calling the inexact rule
     " 15 - INEXACT RULE DEFINITION calling the inexact rule
19 - FUNCTION DEFINITION 3 - SENTENCE RULE calling the function
     " 19 - FUNCTION DEFINITION calling the function
     " 15 - INEXACT RULE DEFINITION calling the function
5 - OPEN SENTENCE TYPE 3 - SENTENCE RULE using the open binary sentence type (with one open entity type argument)
  * the sentence group is used directly (not indirectly via a sentence type)

Knowledge Integrity

Pro/3 analyzes referential dependencies in and between structural knowledge and application knowledge in the KB, for the purpose of preventing inconsistencies and invalid references. In the simplest case, if a data element type is deleted, then all entity types defined with this data element type, and indirectly, all sentences involving entities of this type would become inconsistent. Referential dependencies form a directed acyclic graph referred to as the sentence model graph. Like any other factual knowledge in Pro/3, the dependencies are represented as sentences in the KB. The following NL format is used:

Example:

the node with node - type 13 and node - name amount is referred to by the node with node - type 14 and node - name cash flow !

This sentence states that knowledge node cash flow (type 14 - an entity type) is a dependent of knowledge node amount (type 13 - a data element type).

The sentence model graph and the dependency graph are loaded into a cache data structure upon opening of the KB. Changes in the graphs during processing, are only reflected in this data structure while interacting with Pro/3 (i.e. they are not reflected in the KB). The graphs are stored in the KB upon closing.

QUERYING THE GRAPHS

Queries only consider knowledge in the KB. This means that queries involving the graphs (such as the standard Pro/3 knowledge dependency queries), will not reflect changes which have taken place after the KB was opened. To compensate for this potential problem, a command to update the graph knowledge in the KB has been included the KB-menu. This command can then be used prior to running such queries.

PREVENTING INCONSISTENCIES

Potential inconsistencies resulting from delete or update actions, are prevented by forced deletions (or suspensions) of all direct and indirect dependents.  

The process of determining a node's dependents (with respect to referential integrity), starts with looking at the sentence model graph and then combining the finding in this graph with looking at the dependency graph. Pro/3  will always present a list of dependent knowledge for deletion whenever a delete or an update of a node is attempted:

The list includes direct as well as indirect dependents of the changed or deleted knowledge node.

Suspension of records

It is often desirable not to delete the dependent knowledge nodes (to avoid having to re-enter e.g. a sentence rule) - it is better to mark them as suspended for subsequent review and change, to once again make them consistent with other knowledge nodes. The options to suspend is available for sentence rules, function definitions and inexact rules. Dependent facts, whether entered or derived, cannot be suspended (i.e. they must be deleted). All suspended records can be viewed in the Suspended Records-window.

The suspended state should be looked upon as temporary, and suspended records should as soon as possible be re-instated as (non-suspended) records (or deleted). Processing queries or deriving sentences could give unexpected results with suspended records present. Suspended records are never considered by the inference engine, however they are included in some windows:

Suspended sentence rules are shown in the Sentence Rules-window. The rule editor will try to update the rule where possible when opened by the Rule Editor.

Suspended inexact rules are listed in the Certainty Rules-window preceded by an asterisk. Updating the inexact rule may or may not work depending on the presence of integrity problems (i.e. the integrity issues which generated the suspension originally). The suspension will be removed if the update succeeds. If errors, then try to update the inexact rule (first) using the Record-window. An error message will be displayed if a suspended inexact rule is encountered during inferences (i.e. processing of queries/derivations). 

Suspended function definitions are shown in the Function-window preceded by an asterisk. Updating the function may or may not work depending on the presence of integrity problems (i.e. the integrity issues which generated the suspension originally). The suspension will be removed if the update succeeds. If errors, then try to update the function (first) using the Record-window. Suspended functions will NOT be detected during inferences (i.e. processing of queries/derivations). A call to a suspended function will simply fail.

The Suspended Records-window has a button to remove the suspensions of selected or all suspended records. These buttons are especially useful for removing suspensions which do not require any changes to the suspended records (note that a suspended record is potentially inconsistent only). Sometimes the removal-action has to be repeated several times by closing and re-opening the window (the number of suspended records will always decrease each time).

Ignoring potential integrity issues

You can choose to ignore the potential integrity issue if you understand what they are and how they eventually can be resolved. Note that the displayed list of affected knowledge nodes include direct as well as indirect depend knowledge. Choosing to ignore the integrity issues will only affect the direct dependents since by leaving these unchanged, the indirect dependents will not have any issues.