private OWLClass setupDebuggingClass(OWLClassExpression cls) throws OWLException { if (!cls.isAnonymous()) { return (OWLClass) cls; } else { // The class is anonymous, so we need to assign it a name OWLClass curCls = owlOntologyManager.getOWLDataFactory().getOWLClass(createIRI()); Set<OWLClassExpression> operands = new HashSet<OWLClassExpression>(); operands.add(curCls); operands.add(cls); temporaryAxioms.add(owlOntologyManager.getOWLDataFactory().getOWLEquivalentClassesAxiom(operands)); for (OWLAxiom ax : temporaryAxioms) { owlOntologyManager.applyChanges(Arrays.asList(new AddAxiom(getOWLOntology(), ax))); } return curCls; } }
/** * Setup debugging class. * * @param cls the cls * @return the oWL class */ private OWLClass setupDebuggingClass(OWLClassExpression cls) { if (!cls.isAnonymous()) { return (OWLClass) cls; } else { // The class is anonymous, so we need to assign it a name OWLClass curCls = df.getOWLClass(createIRI()); temporaryAxioms.add(df.getOWLEquivalentClassesAxiom(createSet(curCls, cls))); temporaryAxioms.forEach(ax -> man.addAxiom(getOWLOntology(), ax)); return curCls; } }
/** * Setup debugging class. * * @param cls the cls * @return the oWL class */ private OWLClass setupDebuggingClass(OWLClassExpression cls) { if (!cls.isAnonymous()) { return (OWLClass) cls; } else { // The class is anonymous, so we need to assign it a name OWLClass curCls = df.getOWLClass(createIRI()); temporaryAxioms.add(df.getOWLEquivalentClassesAxiom(createSet(curCls, cls))); temporaryAxioms.forEach(ax -> man.addAxiom(getOWLOntology(), ax)); return curCls; } }
/** * Setup debugging class. * * @param cls the cls * @return the oWL class */ private OWLClass setupDebuggingClass(OWLClassExpression cls) { if (!cls.isAnonymous()) { return (OWLClass) cls; } else { // The class is anonymous, so we need to assign it a name OWLClass curCls = df.getOWLClass(createIRI()); temporaryAxioms.add(df.getOWLEquivalentClassesAxiom(createSet(curCls, cls))); temporaryAxioms.forEach(ax -> man.addAxiom(getOWLOntology(), ax)); return curCls; } }
/** * Setup debugging class. * * @param cls the cls * @return the oWL class */ private OWLClass setupDebuggingClass(OWLClassExpression cls) { if (!cls.isAnonymous()) { return (OWLClass) cls; } else { // The class is anonymous, so we need to assign it a name OWLClass curCls = df.getOWLClass(createIRI()); temporaryAxioms.add(df.getOWLEquivalentClassesAxiom(createSet(curCls, cls))); temporaryAxioms.forEach(ax -> man.addAxiom(getOWLOntology(), ax)); return curCls; } }
private void createDebuggingOntology() throws OWLException { //System.out.println("Debugging ontology: " + ontologyCounter); if (debuggingOntology != null) { owlOntologyManager.removeOntology(debuggingOntology); } IRI iri = createIRI(); SimpleIRIMapper mapper = new SimpleIRIMapper(iri, iri); owlOntologyManager.addIRIMapper(mapper); debuggingOntology = owlOntologyManager.createOntology(iri); owlOntologyManager.removeIRIMapper(mapper); List<OWLOntologyChange> changes = new ArrayList<OWLOntologyChange>(); for (OWLAxiom ax : debuggingAxioms) { changes.add(new AddAxiom(debuggingOntology, ax)); } for (OWLAxiom ax : temporaryAxioms) { changes.add(new AddAxiom(debuggingOntology, ax)); } // Ensure the ontology contains the signature of the class which is being debugged OWLDataFactory factory = owlOntologyManager.getOWLDataFactory(); OWLAxiom ax = factory.getOWLSubClassOfAxiom(currentClass, factory.getOWLThing()); changes.add(new AddAxiom(debuggingOntology, ax)); owlOntologyManager.applyChanges(changes); }
private void createDebuggingOntology() { if (debuggingOntology != null) { man.removeOntology(verifyNotNull(debuggingOntology)); } IRI iri = createIRI(); SimpleIRIMapper mapper = new SimpleIRIMapper(iri, iri); man.getIRIMappers().add(mapper); try { debuggingOntology = man.createOntology(iri); } catch (OWLOntologyCreationException e) { throw new OWLRuntimeException(e); } man.getIRIMappers().remove(mapper); List<AddAxiom> changes = new ArrayList<>(); debuggingAxioms.forEach(ax -> changes.add(new AddAxiom(getDebuggingOntology(), ax))); temporaryAxioms.forEach(ax -> changes.add(new AddAxiom(getDebuggingOntology(), ax))); // Ensure the ontology contains the signature of the class which is // being debugged OWLAxiom ax = df.getOWLSubClassOfAxiom(verifyNotNull(currentClass), df.getOWLThing()); changes.add(new AddAxiom(getDebuggingOntology(), ax)); man.applyChanges(changes); }
private void createDebuggingOntology() { if (debuggingOntology != null) { man.removeOntology(verifyNotNull(debuggingOntology)); } IRI iri = createIRI(); SimpleIRIMapper mapper = new SimpleIRIMapper(iri, iri); man.getIRIMappers().add(mapper); try { debuggingOntology = man.createOntology(iri); } catch (OWLOntologyCreationException e) { throw new OWLRuntimeException(e); } man.getIRIMappers().remove(mapper); List<AddAxiom> changes = new ArrayList<>(); debuggingAxioms.forEach(ax -> changes.add(new AddAxiom(getDebuggingOntology(), ax))); temporaryAxioms.forEach(ax -> changes.add(new AddAxiom(getDebuggingOntology(), ax))); // Ensure the ontology contains the signature of the class which is // being debugged OWLAxiom ax = df.getOWLSubClassOfAxiom(verifyNotNull(currentClass), df.getOWLThing()); changes.add(new AddAxiom(getDebuggingOntology(), ax)); man.applyChanges(changes); }
private void createDebuggingOntology() { if (debuggingOntology != null) { man.removeOntology(verifyNotNull(debuggingOntology)); } IRI iri = createIRI(); SimpleIRIMapper mapper = new SimpleIRIMapper(iri, iri); man.getIRIMappers().add(mapper); try { debuggingOntology = man.createOntology(iri); } catch (OWLOntologyCreationException e) { throw new OWLRuntimeException(e); } man.getIRIMappers().remove(mapper); List<AddAxiom> changes = new ArrayList<>(); debuggingAxioms.forEach(ax -> changes.add(new AddAxiom(getDebuggingOntology(), ax))); temporaryAxioms.forEach(ax -> changes.add(new AddAxiom(getDebuggingOntology(), ax))); // Ensure the ontology contains the signature of the class which is // being debugged OWLAxiom ax = df.getOWLSubClassOfAxiom(verifyNotNull(currentClass), df.getOWLThing()); changes.add(new AddAxiom(getDebuggingOntology(), ax)); man.applyChanges(changes); }
private void createDebuggingOntology() { if (debuggingOntology != null) { man.removeOntology(verifyNotNull(debuggingOntology)); } IRI iri = createIRI(); SimpleIRIMapper mapper = new SimpleIRIMapper(iri, iri); man.getIRIMappers().add(mapper); try { debuggingOntology = man.createOntology(iri); } catch (OWLOntologyCreationException e) { throw new OWLRuntimeException(e); } man.getIRIMappers().remove(mapper); List<AddAxiom> changes = new ArrayList<>(); debuggingAxioms.forEach(ax -> changes.add(new AddAxiom(getDebuggingOntology(), ax))); temporaryAxioms.forEach(ax -> changes.add(new AddAxiom(getDebuggingOntology(), ax))); // Ensure the ontology contains the signature of the class which is // being debugged OWLAxiom ax = df.getOWLSubClassOfAxiom(verifyNotNull(currentClass), df.getOWLThing()); changes.add(new AddAxiom(getDebuggingOntology(), ax)); man.applyChanges(changes); }