get-roles [Function]


The get-roles function gets the local and inherited roles of a specified concept.


get-roles concept


The concept argument is a concept, or the name of a concept.


The get-roles function returns a list of the role objects attached to concept.


The printed representation of a role object is a list containing the role's relation, its minimum and maximum number of fillers, and the type (value-restriction) of the fillers.

The accessor relation can be used to get the relation which a retrieved role restricts.

The accessor concept can be used to get the concept to which a retrieved role is attached.


(defconcept B 
    :is (:and (:all r A) (:exactly 3 r) (:filled-by r Joe Fred))) 
(defconcept C 
    :is-primitive B 
    :implies (:and (:some s A) (:at-most 2 s)) 
    :defaults (:filled-by s Sue)) 
(get-roles 'B) ==> (|ROLE|(R 3 3 A)) 
(get-roles (fc C)) ==> (|ROLE|(R 3 3 A) |ROLE|(S 1 2 NIL)) 
(setq role (first (get-roles (fc C)))) 
(relation role) ==> |R|R 
(concept role) ==> |C|C

See Also

Last modified: Jun 1 1995