Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NullPointerException during the creation of an ELK reasoner #7

Closed
GoogleCodeExporter opened this issue Oct 16, 2015 · 2 comments
Closed

Comments

@GoogleCodeExporter
Copy link

The current ELK (0.3.0) throws an NPE during the creation of the reasoner for 
one of our ontologies.

This happens in Protege and using plain Java. I have attached a sample project 
which demonstrates this. Just execute the main in the only class in this 
project.

Alternatively load the following URL in Protege (tested with 4.1 and 
4.2-beta-278):
http://purl.obolibrary.org/obo/go/extensions/x-chemical-importer.owl

The Protege error message is the following:

java.util.NoSuchElementException
    at java.util.HashMap$HashIterator.nextEntry(HashMap.java:796)
    at java.util.HashMap$KeyIterator.next(HashMap.java:828)
    at org.semanticweb.elk.owlapi.OwlOntologyLoader$1.load(OwlOntologyLoader.java:125)
    at org.semanticweb.elk.reasoner.stages.OntologyLoadingStage.execute(OntologyLoadingStage.java:71)
    at org.semanticweb.elk.reasoner.stages.LoggingStageExecutor.complete(LoggingStageExecutor.java:56)
    at org.semanticweb.elk.reasoner.stages.AbstractReasonerState.loadOntology(AbstractReasonerState.java:265)
    at org.semanticweb.elk.owlapi.ElkReasoner.<init>(ElkReasoner.java:153)
    at org.semanticweb.elk.owlapi.ElkReasoner.<init>(ElkReasoner.java:168)
    at org.semanticweb.elk.owlapi.ElkReasonerFactory.createElkReasoner(ElkReasonerFactory.java:104)
    at org.semanticweb.elk.owlapi.ElkReasonerFactory.createReasoner(ElkReasonerFactory.java:83)
    at org.protege.editor.owl.model.inference.ReasonerUtilities.createReasoner(ReasonerUtilities.java:21)
    at org.protege.editor.owl.model.inference.OWLReasonerManagerImpl$ClassificationRunner.ensureRunningReasonerInitialized(OWLReasonerManagerImpl.java:401)
    at org.protege.editor.owl.model.inference.OWLReasonerManagerImpl$ClassificationRunner.run(OWLReasonerManagerImpl.java:354)
    at java.lang.Thread.run(Thread.java:680)

Judging from the code in the implementation, there might be an 'else' missing 
in org.semanticweb.elk.owlapi.OwlOntologyLoader. The ontology is an importer 
and has no axioms itself, maybe this breaks some of the assumptions in the 
loader.

We are looking very much forward to using the new ELK, but this is quite the 
show stopper for us. This did not happen in ELK 0.2.0.

Thank you for considering.

Original issue reported on code.google.com by HDie...@lbl.gov on 3 Aug 2012 at 6:12

Attachments:

@GoogleCodeExporter
Copy link
Author

Many thanks for a detailed bug report!

The issue should now have been fixed in the trunk. The cause of the exception 
was that in the  OwlOntologyLoader the status of the newly created iterator 
over the imported axioms has not been checked on emptiness (using hasNext()). 
The fix is just 1 line of code. I was working for me with your ontology.

Until the next release, you can download use the latest nightly build of ELK :

http://code.google.com/p/elk-reasoner/wiki/GettingElk

Cheers,

Yevgeny

Original comment by ykazako...@gmail.com on 3 Aug 2012 at 11:18

  • Changed state: Verified

@GoogleCodeExporter
Copy link
Author

Thanks. The nightly build works.

Original comment by HDie...@lbl.gov on 6 Aug 2012 at 5:55

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant