get-matching-instances [Function]


Purpose

The get-matching-instances function returns all instances that (1) satisfy each member of a specified list of concepts, and (2) have role fillers matching each member of a specified list of role/fillers pairs.

Syntax

get-matching-instances concepts roleFillers

Arguments

The concepts argument is a (possibly empty) list of concepts, or names of concepts, which must be satisfied.

The roleFillers argument is a list of role/fillers pairs which must be matched. Each pair is a list containing (1) a relation or relation name, and (2) one or more instances, instance identifiers, or constants.

Value

This function returns a list of matching instances.

Remarks

Loom may use the first member of concepts as an instance generator, so the ordering of concepts is significant. For best performance, the first concept should be the one with the lowest estimated number of instances.

If no appropriate role indices exist, and if concepts is null, Loom issues a warning that it must scan the entire knowledge base to generate instances that might have the specified role fillers.

Examples

(tellm (:about Joe Famous Writer  
               (wife Sue) (:filled-by kids-ages 3 4 5))) 
(get-matching-instances  
    '(Famous Writer) '((wife Sue) (kids-ages 3 4 5))) ==> (|I|JOE) 
(get-matching-instances  
    '(Famous) '((wife Sue) (kids-ages 3) (kids-ages 5))) ==> (|I|JOE) 
(get-matching-instances 
    `(,(fc Writer)) `((,(fr wife) ,(fi Sue)))) ==> (|I|JOE)

See Also

Last modified: Jun 1 1995