get-subrelations [Function]


Purpose

The get-subrelations function finds all subrelations, or only the direct subrelations, of a given relation. If the argument to get-subrelations is a symbol, and no matching relation can be found, then Loom looks for a matching concept and returns the concept's subconcepts.

Syntax

get-subrelations relationOrConcept &key direct-p

Arguments

The relationOrConcept argument is the relation (or concept), or the name of the relation (or concept), whose subrelations (or subconcepts) are to be found.

If the direct-p argument is t, only the most specific subrelations (or subconcepts) are returned. Otherwise, all subrelations (or subconcepts), including relationOrConcept itself, are returned.

Value

This function returns a list of relations, or a list of concepts.

Examples

(defconcept Person)
(defconcept Child :is-primitive Person) 
(defrelation relative)
(defrelation child :is-primitive relative) 
(defrelation daughter :is-primitive child) 
(get-subrelations 'relative) ==> (|R|RELATIVE |R|CHILD |R|DAUGHTER) 
(get-subrelations (fr relative) :direct-p t) ==> (|R|CHILD) 
(get-subrelations 'Person) ==> (|C|PERSON |C|CHILD)

See Also

Last modified: Jun 1 1995