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.
get-subrelations relationOrConcept &key direct-p
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.
This function returns a list of relations, or a list of concepts.
(defconcept Child :is-primitive Person)
(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)
Last modified: Jun 1 1995