save-kb [Function]


Purpose

The save-kb function writes out source definitions for the concepts, relations, instances, and behaviors in a specified knowledge base.

Syntax

save-kb &optional knowledgeBase &key partitions path-name

Arguments

The knowledgeBase argument is the knowledge base to be saved, or a symbol or string which names that knowledge base. If this argument is not supplied to save-kb, it defaults to the current knowledge base.

The partitions argument is a keyword or list of keywords specifying the types of objects to be saved. Available partitions are :concepts, :relations, :instances, and :behaviors. If this argument is not supplied, all partitions are saved.

The path-name argument is a string that specifies the file to be used for saving knowledgeBase. This defaults to the file that was associated with knowledgeBase when that knowledge base was defined. If no file was associated with knowledgeBase, a warning is issued.

Value

The pathname of the saved knowledge base is returned.

Remarks

The output of save-kb reflects the definitions originally supplied by the user. Unlike pc, these definitions are not augmented by inferences made during classification and recognition.

Unless the :suppress-diehard-output feature is set, save-kb prints the name of each saved object on standard output.

Examples

(defkb test-kb nil :path-name "test-kb.lisp") 
(save-kb) ==> "test-kb.lisp" 
(save-kb "TEST-KB" :path-name "dump.lisp") ==> "dump.lisp" 
(save-kb :partitions '(:concepts :relations)) ==> "test-kb.lisp"

See Also

Last modified: Jun 1 1995