The procedure for loading a KB file and a KB snapshot file are essentially the same, except for the options that you might want to specify, as outlined in Selecting Options When Loading a KB File.
Also, after loading a KB snapshot file, you can warmboot your KB. For information on warmbooting, see Warmbooting a KB Snapshot File.
To load a KB file interactively:
Pause or Reset from the Main Menu.
Main Menu > Load KB.
To load a KB file programmatically:
Execute the g2-load-kb system procedure, as described in the G2 System Procedures Reference Manual.
Using the Load KB Dialog
When you load a KB file interactively, G2 displays the Load KB dialog, as shown in the next figure:
![]() |
The first time you use the Load KB dialog, G2 displays in the edit area the current directory of the G2 process. Thereafter, the default directory is the directory pathname most recently specified in a successfully executed
Load KB, Merge KB, or Save KB operation.
To display the contents of a directory:
Enter a pathname in the edit area, including a trailing delimiter character, and select End.
or:
Enter a pathname in the edit area, without a trailing delimiter character, and press Return.
G2 displays a list of subdirectories and KB (or KL) filenames contained in the specified directory. This figure shows how the Load KB dialog displays these lists:
![]() |
At this point, you can select a KB file to load or another subdirectory. If you select a subdirectory, continue following the above procedure until you find the desired KB file.
Note: G2 cannot load an empty file or a file that is not a KB file. If you attempt this, G2 signals an error.
Loading the KB File
To load the specified KB file:
Select End or press Return in the Load KB dialog.
When loading is complete, G2 presents the contents of the loaded KB in the state in which is was saved. For information on what G2 saves in KB files and KB snapshot files, see Saving a KB File.
In addition, G2 does the following:
Initial-value attributes of variables and the values of parameters.
Using Wildcards in Filenames When Loading a KB
You can enter a wildcard in the filename when loading a KB file. G2 displays a list of names that meet the specified criteria.
Note: The wildcard characters work on any G2 operating system from within G2.
For instance, you can enter kb*s.kb to display a list of all KB files in the current directory, whose file names begin with the characters "kb" and end with the characters "s.kb".
You can also use these characters in the text of the argument passed to the
g2-files-in-directory and g2-subdirectories-in-directory system procedures, as described in the G2 System Procedures Reference Manual.
Note: G2 does not expand VMS logical symbols that contain directory names.
Selecting Options When Loading a KB File
You can modify how G2 loads the selected KB file by selecting one or more options on the Load KB dialog. To select a loading option, check its associated box. merge in this KB and merge in this KB and install its system tables pertain only to merging a KB file. You should not select both options in a pair at the same time.
Searching for KB Files
When loading KB files, G2 searches for .kb and .KB files in the specified directory and in the current G2 directory. It also searches for .kl and .KL files in these directories. When loading KB files, you can specify an extension or not.
Note: The use of .KL and .kl files (known as knowledge libraries) is obsolete except for certain libraries supplied by Gensym to assist in localization, as described in Chapter 39, Natural Language Facilities.
When loading a KB file, G2 searches for a file with the following filenames in the following order:
filename.kl.
filename.kb.
filename.kl in the current G2 directory.
filename.kb in the current G2 directory.
G2_HOME environment variable. If no such specification exists, the home directory is the directory from which you launched G2. You can specify an unqualified filename, that is, a filename without an extension. If you specify an unqualified filename:
.kl extension.
.kb extension.