get-matching-instances [Function]


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.


get-matching-instances concepts roleFillers


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.


This function returns a list of matching instances.


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.


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

See Also

Last modified: Jun 1 1995