OpenCyc.org HomepageLoad API Help

E-Mail Comments to: opencyc-doc@cyc.com
Copyright© 1997-2002 Cycorp. All rights reserved.

The Load API Expressions Page allows the user to load a file of SubL forms (e.g., ke-assert, ke-unassert, ke-create, ke-rename, etc.), to be processed by the CYC® Agenda. Forms in the file will be loaded and executed one by one. This is very similar to dropping the forms one at a time into the SubL Interactor. The benefit of using Load API is that an entire file can be loaded at once, thus speeding up the knowledge-entry process.

Loading a File

To load a file for evaluation, enter a filename in the input window (e.g., /foo/bar/bam.text). Then press the [Load File] button. Forms from the file will be loaded and executed one by one until the program either:

These two situations are described in the Understanding the Results section below.

To clear the input window and start over, press the [Clear] button.

Understanding the Results

Results of the load will be printed on the API Load Results page.

The name of the loaded file will be listed, along with a summarization of the results (i.e., whether all operations were processed, or whether an error was encountered which caused the load to halt). If the entire file was loaded successfully, no more information will be listed on this page. If an error was encountered, the error will be listed and explained, and the user will have the option of continuing to load the file. (The offending operation can be included or excluded during continuation; see the Form Number section below for details.)

The Error

If an error caused the load to halt, you'll see a message like:

"An error occurred after processing 3 forms."
Last operation: (KE-CREATE "Collection") Already a constant called Collection
The number returned is the number of successful operations executed before the error occurred. This number does not include the error itself. Thus in the example above, 3 operations were successfully processed before the error.

"Last operation" lists the operation which caused the error, followed by an explanation of why the error occurred. In the example above, creation of the constant #$Collection caused an error because there was already a constant by that name in the KB.

Form Number

The Form Number is the number of operations to skip when continuing with the file load. For example, a Form Number of 17 would cause the program to skip the first 17 forms in the file, and begin by processing the 18th form.

The default value for this window will be the total number of operations processed in the file before the error occurred. So in the example in the Error section above, the default value would be 3. Simply continuing without changing this number or fixing the error will cause the load to stop at the same place again. Thus there are two options:

KE File Name

The KE File Name lists the file to load on the next try. In most cases, this will be the same file as before, and this input window should be left as is. If you do want to load a different file than the previous one, simply change the filename in the input window. In this case, be sure to change the Form Number to 0, to ensure that the new file is loaded from the beginning.

To continue loading the original file (after fixing the error or changing the Form Number), or to load a new file (after changing the KE File Name), press the [Load File] button.

If you change the values in the input windows and wish to reset them to their default values before editing, press the [Reset] button.


Go to Top