Using Relation Definitions and Relations
A relation definition creates a type of association between items of a first class and items of a second class. A relation is an association of a particular name between two particular items. A relation is an item of the RELATION class.
Note: There is no class within G2 called relation definition. However, this chapter uses the term to differentiate between the item you create to specify the name and properties of a relation (the relation definition) and the association that can exist between items (the relation), based on that definition.
To use relations in your KB, first you create a relation definition, then you use the conclude action to create, remove, or replace relations based on their definition.
For example, you can define the relation the-holding-tank-for to represent an association between two items of the class TANK. Based on this relation definition, you can conclude that one tank is the-holding-tank-for another tank.
By default, relations are transient: they disappear when you reset G2, and are not included in a saved KB. You can create permanent relations in your KB as described in Using Permanent Relations.
You can work with relations programmatically in the following ways:
Copyright © 1997 Gensym Corporation, Inc.