Set<OWLAxiom> extract(@Nonnull Set<OWLAxiom> subOnt,
@Nonnull Set<OWLEntity> signature,
@Nonnull LocalityClass localityClass, boolean verbose) {
HashSet<OWLAxiom> mod = new HashSet<>();
HashSet<OWLAxiom> q2 = new HashSet<>(subOnt);
SyntacticLocalityEvaluator sle = new SyntacticLocalityEvaluator(
localityClass);
boolean change = true;
int loopNumber = 0;
while (change) {
change = false;
loopNumber++;
if (verbose) {
LOGGER.info(" Loop {}", loopNumber);
}
HashSet<OWLAxiom> q2remove = new HashSet<>();
for (OWLAxiom ax : q2) {
if (!sle.isLocal(ax, signature)) {
if (verbose) {
LOGGER.info(" Non-local axiom: {}",
minusOntologyURI(ax.toString()));
}
mod.add(ax);