[Pellet-users] some problem pellet reasoner performance

sni snirbil at gmail.com
Tue Jan 23 22:40:50 UTC 2007


hi, (sorry for my bad English) I have a little problem with pellet reasoner,
I used to do reasoning with racer and I notice some performance difference
between pellet and racer. actually pellet takes several minutes (seems to be
in a infinite loop) to complete a query that racer does immediately with
DIG.
My model is built adding 3 taxonomies and a content ontology to a
repository, the final model is a quite big but not enough to explain the
time that it takes for reasoning. I have uploaded at this
link<http://ckonte.googlepages.com/model.owl>the entire model at the
time of the query (you need to do put it in the same
path of the program below).
the example query is also relative simple, my program should do
instantaneously more complicated(MORE!) queries.
this is the program that I used for the test (using last pellet nightly
build):



-^-JAVA CODE-^-


 //some useful import

 import java.util.Iterator;

 import org.mindswap.pellet.jena.PelletReasonerFactory;

 import com.hp.hpl.jena.ontology.Individual;
 import com.hp.hpl.jena.ontology.IntersectionClass;
 import com.hp.hpl.jena.ontology.ObjectProperty;
 import com.hp.hpl.jena.ontology.OntClass;
 import com.hp.hpl.jena.ontology.OntModel;
 import com.hp.hpl.jena.ontology.SomeValuesFromRestriction;
 import com.hp.hpl.jena.rdf.model.ModelFactory;
 import com.hp.hpl.jena.rdf.model.RDFList;
 import com.hp.hpl.jena.rdf.model.RDFNode;

 public class Example {
     private OntModel queryModel;
     private OntClass pedag_class = null;
     private OntClass form_class = null;
     private OntClass wil_class = null;

     public Example(){
     }

     public void find(){
        //create the model with pellet.
         queryModel = ModelFactory.createOntologyModel(
PelletReasonerFactory.THE_SPEC);

        //reading the model (check the link above :) place the file in the
project's directory.
        queryModel.read("file:model.owl");

        //setting taxonomies' parameters for the query, Learning_Object stay
for TOP; as you can see the query is very simple.
        pedag_class = queryModel.getOntClass("
http://a.com/LearningObject#Learning_Object");
         form_class = queryModel.getOntClass("http://a.com/ResourceType#Pdf
");
         wil_class = queryModel.getOntClass("
http://a.com/LearningObject#Learning_Object");

         //also the wanted class is TOP .
         OntClass wanted = this.queryModel.getOntClass("
http://www.w3.org/2002/07/owl#Thing");
         RDFList members = null;

         // some operations to build the query.
         ObjectProperty prop = queryModel.getObjectProperty("
http://a.com/Query#HAS_ARGUMENT");
         SomeValuesFromRestriction restr = queryModel.
createSomeValuesFromRestriction(null, prop, wanted);
         RDFList listclass = queryModel.createList(new RDFNode[]{restr,
pedag_class, form_class, wil_class});

        // really do the query.
         IntersectionClass query = queryModel.createIntersectionClass("
http://a.com/Repository#Intersection", listclass);
         Iterator iter = query.listInstances();
         while (iter.hasNext()){
             Individual iQuery = (Individual) iter.next();
            System.out.println(iQuery.toString());
         }

         if(members != null)
             members.removeList();

         listclass.removeList();
         query.remove();
     }




    public static void main(String[] args) {
         Example ex=new Example();
         ex.find();
        System.out.println("OK, query finished, check the time");
     }
 }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.owldl.com/pipermail/pellet-users/attachments/20070123/bc91294d/attachment.htm 


More information about the Pellet-users mailing list