2007 prototype queries/Part of inference

Here's how I used LSW to compute the inferred part of relations using Pellet for the gene ontology cellular component and biological process ontologies. (there was only 1 part of relation in molecular function)

(defun do-inferred-part-of (source dest) ;; read the KB  (setq *default-kb* (load-kb-jena  source))  ;; loop through all classes c asking for the subclass of (some part_of c)  (time (setq 	 *inferred-part-of*	 (loop for c in (descendants !owl:Thing *default-kb*) for part-of = (descendants (manch (some ! c))                                                   *default-kb*) when part-of collect (cons c part-of)) foo nil)) ;; create a simple ontology with just these part relations and dump it.  (with-ontology inferred-part-of-ont ((annotation-property !)      (loop for c in (loop for i in *inferred-part-of* collect (car i)) collect (class c :partial))      (loop for (whole . parts) in *inferred-part-of* collect (loop for p in parts                collect                  (class p :partial (annotation ! whole))))) (write-rdfxml inferred-part-of-ont dest)))

Generates a bunch of stuff that looks like this:           For cellular component, there are 810 explicit part of relations, and 20000 inferred.