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
Tue Oct 12 09:28:11 PDT 2010


Hello,
I trace the error and I find the error in this line:
InferredGenerator.add(new InferredClassAssertionAxiomGenerator());
when I replced with this line:
InferredGenerator.add(new InferredPropertyAssertionGenerator());
it worked without error, but when I open the protege, the object properties are 
not saved correctly.
for example, each individual will have its object properties and linked to the 
other individuals by TopObjectProperty like individual x and y, and x has 
TopObjectProperty is y and vise versa.
when i classify from the protege interface, it inferred the properties 
correctly, but using api i think there is some problem.

On 10/10/2010 07:06 AM, Soha Said wrote:
> 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/20101012/fa5e9f6c/attachment.html>


More information about the protege-discussion mailing list