/** * A method that gets the imports of a given ontology. * * @param ont The ontology whose (transitive) imports are to be retrieved. * @param result A place to store the result - the transitive closure of the imports will be * stored in this result set. * @return modified result */ private Set<OWLOntology> getImports(OWLOntology ont, Set<OWLOntology> result) { readLock.lock(); try { directImports(ont).filter(result::add).forEach(o -> getImports(o, result)); return result; } finally { readLock.unlock(); } }
/** * A method that gets the imports of a given ontology. * * @param ont The ontology whose (transitive) imports are to be retrieved. * @param result A place to store the result - the transitive closure of the imports will be * stored in this result set. * @return modified result */ private Set<OWLOntology> getImports(OWLOntology ont, Set<OWLOntology> result) { readLock.lock(); try { directImports(ont).filter(result::add).forEach(o -> getImports(o, result)); return result; } finally { readLock.unlock(); } }
/** * A method that gets the imports of a given ontology. * * @param ont The ontology whose (transitive) imports are to be retrieved. * @param result A place to store the result - the transitive closure of the imports will be * stored in this result set. * @return modified result */ private Set<OWLOntology> getImports(OWLOntology ont, Set<OWLOntology> result) { readLock.lock(); try { directImports(ont).filter(result::add).forEach(o -> getImports(o, result)); return result; } finally { readLock.unlock(); } }
/** * A method that gets the imports of a given ontology. * * @param ont The ontology whose (transitive) imports are to be retrieved. * @param result A place to store the result - the transitive closure of the imports will be * stored in this result set. * @return modified result */ private Set<OWLOntology> getImports(OWLOntology ont, Set<OWLOntology> result) { readLock.lock(); try { directImports(ont).filter(result::add).forEach(o -> getImports(o, result)); return result; } finally { readLock.unlock(); } }
/** * A recursive method that gets the reflexive transitive closure of the ontologies that are * imported by this ontology. * * @param ontology The ontology whose reflexive transitive closure is to be retrieved * @param ontologies a place to store the result * @return modified ontologies */ private Set<OWLOntology> getImportsClosure(OWLOntology ontology, Set<OWLOntology> ontologies) { readLock.lock(); try { ontologies.add(ontology); directImports(ontology).filter(o -> !ontologies.contains(o)) .forEach(o -> getImportsClosure(o, ontologies)); return ontologies; } finally { readLock.unlock(); } }
/** * A recursive method that gets the reflexive transitive closure of the ontologies that are * imported by this ontology. * * @param ontology The ontology whose reflexive transitive closure is to be retrieved * @param ontologies a place to store the result * @return modified ontologies */ private Set<OWLOntology> getImportsClosure(OWLOntology ontology, Set<OWLOntology> ontologies) { readLock.lock(); try { ontologies.add(ontology); directImports(ontology).filter(o -> !ontologies.contains(o)) .forEach(o -> getImportsClosure(o, ontologies)); return ontologies; } finally { readLock.unlock(); } }
/** * A recursive method that gets the reflexive transitive closure of the ontologies that are * imported by this ontology. * * @param ontology The ontology whose reflexive transitive closure is to be retrieved * @param ontologies a place to store the result * @return modified ontologies */ private Set<OWLOntology> getImportsClosure(OWLOntology ontology, Set<OWLOntology> ontologies) { readLock.lock(); try { ontologies.add(ontology); directImports(ontology).filter(o -> !ontologies.contains(o)) .forEach(o -> getImportsClosure(o, ontologies)); return ontologies; } finally { readLock.unlock(); } }
/** * A recursive method that gets the reflexive transitive closure of the ontologies that are * imported by this ontology. * * @param ontology The ontology whose reflexive transitive closure is to be retrieved * @param ontologies a place to store the result * @return modified ontologies */ private Set<OWLOntology> getImportsClosure(OWLOntology ontology, Set<OWLOntology> ontologies) { readLock.lock(); try { ontologies.add(ontology); directImports(ontology).filter(o -> !ontologies.contains(o)) .forEach(o -> getImportsClosure(o, ontologies)); return ontologies; } finally { readLock.unlock(); } }