@Override @Deprecated public Set<OWLAxiom> getABoxAxioms(Imports imports) { return withReadLock(() -> delegate.getABoxAxioms(imports)); }
@Override @Deprecated public Set<OWLAxiom> getABoxAxioms(Imports imports) { return withReadLock(() -> delegate.getABoxAxioms(imports)); }
@Override @Deprecated public Set<OWLAxiom> getABoxAxioms(Imports imports) { return withReadLock(() -> delegate.getABoxAxioms(imports)); }
@Override @Deprecated public Set<OWLAxiom> getABoxAxioms(Imports imports) { return withReadLock(() -> delegate.getABoxAxioms(imports)); }
private void filterOntology() throws OWLOntologyCreationException { LogOutput.print("Signature original: " + root_ontology.getSignature(true).size()); LogOutput.print("Class original: " + root_ontology.getClassesInSignature(true).size()); if (!root_ontology.getABoxAxioms(true).isEmpty()) LogOutput.print("This ontology contains assertional axioms"); Set<OWLAxiom> filteredAxioms = new HashSet<OWLAxiom>(); filteredAxioms.addAll(root_ontology.getTBoxAxioms(true)); filteredAxioms.addAll(root_ontology.getRBoxAxioms(true)); ontology = manager.createOntology(filteredAxioms, IRI.create(iri_str_working_ontology)); }
Set<OWLAxiom> tbox = ontology.getTBoxAxioms(imports); Set<OWLAxiom> rbox = ontology.getRBoxAxioms(imports); Set<OWLAxiom> abox = ontology.getABoxAxioms(imports);
public static OWLOntology extractTBox(OWLOntology ontology) throws SemanticIndexException { //Tbox: ontology without the ABox axioms (are in the DB now). try { OWLOntologyManager newManager = OWLManager.createOWLOntologyManager(); // TODO: there is a problem here // removing ABox from the current ontology does not remove it from the closure // so, the ABox assertions of the closure will remain OWLOntology tbox = newManager.copyOntology(ontology, OntologyCopy.SHALLOW); newManager.removeAxioms(tbox, tbox.getABoxAxioms(Imports.EXCLUDED)); return tbox; } catch (OWLOntologyCreationException e) { throw new SemanticIndexException(e.getMessage()); } } }
logger.info("Resource " + resource);//resource = "http://dbpedia.org/resource/The_Man_Who_Wouldn%27t_Die"; module = extractSampleModule(resource); man.addAxioms(reference, module.getABoxAxioms(Imports.INCLUDED)); man.removeAxioms(reference, reference.getAxioms(AxiomType.DATA_PROPERTY_ASSERTION)); boolean isConsistent = reasoner.isConsistent(); man.removeAxioms(reference, module.getABoxAxioms(Imports.INCLUDED));
logger.info("Resource " + resource);//resource = "http://dbpedia.org/resource/The_Man_Who_Wouldn%27t_Die"; module = extractSampleModule(resource);module.getOWLOntologyManager().removeAxioms(module, module.getAxioms(AxiomType.DATA_PROPERTY_ASSERTION)); manager.addAxioms(reference, module.getABoxAxioms(Imports.INCLUDED)); manager.removeAxioms(reference, reference.getAxioms(AxiomType.DATA_PROPERTY_ASSERTION)); boolean isConsistent = reasoner.isConsistent(); man.removeAxioms(reference, module.getABoxAxioms(Imports.INCLUDED));
private boolean containsUnsatisfiableObjectProperty(Set<OWLAxiom> justification){ boolean value = false; OWLReasoner reasoner = null; try { OWLOntology ontology = manager.createOntology(justification); manager.removeAxioms(ontology, ontology.getABoxAxioms(Imports.INCLUDED)); reasoner = PelletReasonerFactory.getInstance().createNonBufferingReasoner(ontology); for(OWLObjectProperty p : ontology.getObjectPropertiesInSignature()){ boolean satisfiable = reasoner.isSatisfiable(factory.getOWLObjectExactCardinality(1, p)); if(!satisfiable){ value = true; break; } } } catch (TimeOutException | OWLOntologyCreationException | ReasonerInterruptedException | InconsistentOntologyException | FreshEntitiesException | ClassExpressionNotInProfileException e) { e.printStackTrace(); } reasoner.dispose(); return value; }
manager.addAxioms(merge, ontology.getABoxAxioms(Imports.INCLUDED)); manager.addAxioms(merge, declarations); manager.saveOntology(merge, file);
manager.addAxioms(merge, ontology.getABoxAxioms(true)); manager.addAxioms(merge, declarations); manager.saveOntology(merge, file);