get-roles [Function]


Purpose

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

Syntax

get-roles concept

Arguments

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

Value

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

Remarks

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.

Examples

(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