I want to add some subclasses to a class in a sourceOntology I use this code:
for (OWLClass subclass : targetreasoner.getSubClasses(owlclass, true).getFlattened()) {
OWLSubClassOfAxiom axiom=factory.getOWLSubClassOfAxiom(subclass, sourceOwlclass);
manager.applyChange(new AddAxiom(sourceOntology, axiom));
}
manager.saveOntology(sourceOntology);
Then I got this exception:
Exception in thread "main" java.lang.NoSuchMethodError: org.semanticweb.owlapi.model.OWLOntologyManager.applyChange(Lorg/semanticweb/owlapi/model/OWLOntologyChange;)Lorg/semanticweb/owlapi/model/parameters/ChangeApplied;
I tried different solutions but no one succeeds. I do not know how to solve this exception and save the changes to the ontology.
Any help!!!
I want to add some subclasses to a class in a sourceOntology I use this code: for (OWLClass subclass : targetreasoner.getSubClasses(owlclass, true).getFlattened()) { OWLSubClassOfAxiom axiom=factory.getOWLSubClassOfAxiom(subclass, sourceOwlclass);
manager.applyChange(new AddAxiom(sourceOntology, axiom)); } manager.saveOntology(sourceOntology);
Then I got this exception: Exception in thread "main" java.lang.NoSuchMethodError: org.semanticweb.owlapi.model.OWLOntologyManager.applyChange(Lorg/semanticweb/owlapi/model/OWLOntologyChange;)Lorg/semanticweb/owlapi/model/parameters/ChangeApplied;
I tried different solutions but no one succeeds. I do not know how to solve this exception and save the changes to the ontology. Any help!!!