Search Mailing List Archives


Limit search to: Subject & Body Subject Author
Sort by: Reverse Sort
Limit to: All This Week Last Week This Month Last Month
Select Date Range     through    

[protege-discussion] Exception in inference api

Soha Said sohaelshafey at yahoo.com
Sun Oct 10 07:06:17 PDT 2010


I used protege 4.1 beta build 209 api, and I have a problem in inference api.
This is the snapshot of code that I used to get inferencing:

OWLOntologyManager ontologymanager=OWLManager.createOWLOntologyManager();
            OWLOntology 
ontology=ontologymanager.loadOntology(IRI.create(OwlUri));
            OWLDataFactory factory=ontologymanager.getOWLDataFactory();
            OWLReasonerFactory reasonerfactory= new Reasoner.ReasonerFactory();
            OWLReasoner 
owlreasoner=reasonerfactory.createNonBufferingReasoner(ontology);
            owlreasoner.precomputeInferences(InferenceType.CLASS_HIERARCHY);
     
List<InferredAxiomGenerator<? extends OWLAxiom>> InferredGenerator = new 
ArrayList<InferredAxiomGenerator<? extends OWLAxiom>>(); 

           InferredGenerator.add(new InferredClassAssertionAxiomGenerator());
           InferredOntologyGenerator ontologygenerator=new 
InferredOntologyGenerator(owlreasoner,InferredGenerator);           
           ontologygenerator.fillOntology(ontologymanager,ontology);       
           ontologymanager.saveOntology(ontology,IRI.create(OwlUri));

but I have an exception in this line: 
ontologygenerator.fillOntology(ontologymanager,ontology);  
this exception says: java.lang.NullPointerException
 I don't know what i should do and what is wrong.

Thanks in advance
Soha Said


      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.stanford.edu/pipermail/protege-discussion/attachments/20101010/8ccbf97e/attachment.html>


More information about the protege-discussion mailing list