/** * add axiom AX to the non-local set with top-locality value TOP * * @param ax axiom * @param top top or bottom */ private void checkNonLocal(AxiomWrapper ax, boolean top) { emptySig.setLocality(top); checker.setSignatureValue(emptySig); if (!checker.local(ax.getAxiom())) { if (top) { topNonLocal.add(ax); } else { bottomNonLocal.add(ax); } } }
/** * add axiom AX to the non-local set with top-locality value TOP * * @param ax axiom * @param top top or bottom */ private void checkNonLocal(AxiomWrapper ax, boolean top) { emptySig.setLocality(top); checker.setSignatureValue(emptySig); if (!checker.local(ax.getAxiom())) { if (top) { topNonLocal.add(ax); } else { bottomNonLocal.add(ax); } } }
/** * add axiom AX to the non-local set with top-locality value TOP * * @param ax axiom * @param top top or bottom */ private void checkNonLocal(AxiomWrapper ax, boolean top) { emptySig.setLocality(top); checker.setSignatureValue(emptySig); if (!checker.local(ax.getAxiom())) { if (top) { topNonLocal.add(ax); } else { bottomNonLocal.add(ax); } } }
/** * add axiom AX to the non-local set with top-locality value TOP * * @param ax axiom * @param top top or bottom */ private void checkNonLocal(AxiomWrapper ax, boolean top) { emptySig.setLocality(top); checker.setSignatureValue(emptySig); if (!checker.local(ax.getAxiom())) { if (top) { topNonLocal.add(ax); } else { bottomNonLocal.add(ax); } } }
/** * extract module wrt SIGNATURE and TYPE from the set of axioms * * @param axioms axiom * @param signature signature * @param type type */ public void extract(List<AxiomWrapper> axioms, Signature signature, ModuleType type) { boolean topLocality = type == ModuleType.TOP; sig = new Signature(signature.getSignature().stream()); checker.setSignatureValue(sig); sig.setLocality(topLocality); extractModule(axioms); if (type != ModuleType.STAR) { return; } // here there is a star: do the cycle until stabilization int size; do { size = module.size(); List<AxiomWrapper> oldModule = new ArrayList<>(module); topLocality = !topLocality; sig = new Signature(signature.getSignature().stream()); checker.setSignatureValue(sig); sig.setLocality(topLocality); extractModule(oldModule); } while (size != module.size()); }
/** * extract module wrt SIGNATURE and TYPE from the set of axioms * * @param axioms axiom * @param signature signature * @param type type */ public void extract(List<AxiomWrapper> axioms, Signature signature, ModuleType type) { boolean topLocality = type == ModuleType.TOP; sig = new Signature(signature.getSignature().stream()); checker.setSignatureValue(sig); sig.setLocality(topLocality); extractModule(axioms); if (type != ModuleType.STAR) { return; } // here there is a star: do the cycle until stabilization int size; do { size = module.size(); List<AxiomWrapper> oldModule = new ArrayList<>(module); topLocality = !topLocality; sig = new Signature(signature.getSignature().stream()); checker.setSignatureValue(sig); sig.setLocality(topLocality); extractModule(oldModule); } while (size != module.size()); }
/** * extract module wrt SIGNATURE and TYPE from the set of axioms * * @param axioms axiom * @param signature signature * @param type type */ public void extract(List<AxiomWrapper> axioms, Signature signature, ModuleType type) { boolean topLocality = type == ModuleType.TOP; sig = new Signature(signature.getSignature().stream()); checker.setSignatureValue(sig); sig.setLocality(topLocality); extractModule(axioms); if (type != ModuleType.STAR) { return; } // here there is a star: do the cycle until stabilization int size; do { size = module.size(); List<AxiomWrapper> oldModule = new ArrayList<>(module); topLocality = !topLocality; sig = new Signature(signature.getSignature().stream()); checker.setSignatureValue(sig); sig.setLocality(topLocality); extractModule(oldModule); } while (size != module.size()); }
/** * extract module wrt SIGNATURE and TYPE from the set of axioms * * @param axioms axiom * @param signature signature * @param type type */ public void extract(List<AxiomWrapper> axioms, Signature signature, ModuleType type) { boolean topLocality = type == ModuleType.TOP; sig = new Signature(signature.getSignature().stream()); checker.setSignatureValue(sig); sig.setLocality(topLocality); extractModule(axioms); if (type != ModuleType.STAR) { return; } // here there is a star: do the cycle until stabilization int size; do { size = module.size(); List<AxiomWrapper> oldModule = new ArrayList<>(module); topLocality = !topLocality; sig = new Signature(signature.getSignature().stream()); checker.setSignatureValue(sig); sig.setLocality(topLocality); extractModule(oldModule); } while (size != module.size()); }
/** * @param signature the signature to use * @param moduletype the module type * @return a set of axioms that corresponds to the atom with the id INDEX */ public Set<OWLAxiom> getNonLocal(Stream<OWLEntity> signature, ModuleType moduletype) { // init signature Signature sig = new Signature(signature); sig.setLocality(false); // do check modularizer.getLocalityChecker().setSignatureValue(sig); Set<OWLAxiom> result = new HashSet<>(); for (AxiomWrapper p : axioms) { if (!modularizer.getLocalityChecker().local(p.getAxiom())) { result.add(p.getAxiom()); } } return result; }
/** * @param signature the signature to use * @param moduletype the module type * @return a set of axioms that corresponds to the atom with the id INDEX */ public Set<OWLAxiom> getNonLocal(Stream<OWLEntity> signature, ModuleType moduletype) { // init signature Signature sig = new Signature(signature); sig.setLocality(false); // do check modularizer.getLocalityChecker().setSignatureValue(sig); Set<OWLAxiom> result = new HashSet<>(); for (AxiomWrapper p : axioms) { if (!modularizer.getLocalityChecker().local(p.getAxiom())) { result.add(p.getAxiom()); } } return result; }
/** * @param signature the signature to use * @param moduletype the module type * @return a set of axioms that corresponds to the atom with the id INDEX */ public Set<OWLAxiom> getNonLocal(Stream<OWLEntity> signature, ModuleType moduletype) { // init signature Signature sig = new Signature(signature); sig.setLocality(false); // do check modularizer.getLocalityChecker().setSignatureValue(sig); Set<OWLAxiom> result = new HashSet<>(); for (AxiomWrapper p : axioms) { if (!modularizer.getLocalityChecker().local(p.getAxiom())) { result.add(p.getAxiom()); } } return result; }
/** * @param signature the signature to use * @param moduletype the module type * @return a set of axioms that corresponds to the atom with the id INDEX */ public Set<OWLAxiom> getNonLocal(Stream<OWLEntity> signature, ModuleType moduletype) { // init signature Signature sig = new Signature(signature); sig.setLocality(false); // do check modularizer.getLocalityChecker().setSignatureValue(sig); Set<OWLAxiom> result = new HashSet<>(); for (AxiomWrapper p : axioms) { if (!modularizer.getLocalityChecker().local(p.getAxiom())) { result.add(p.getAxiom()); } } return result; }
/** * @param signature * signature * @param useSemantic * useSemantic * @param type * type * @param r * reasoner * @return a set of axioms that corresponds to the atom with the id INDEX */ @PortedFrom(file = "Kernel.h", name = "getNonLocal") public Set<AxiomWrapper> getNonLocal(List<Expression> signature, boolean useSemantic, ModuleType type, OWLReasoner r) { // init signature Signature sig = new Signature(); sig.setLocality(type == ModuleType.TOP); signature.stream().filter(p -> p instanceof NamedEntity).map(p -> ((NamedEntity) p).getEntity()).forEach( sig::add); // do check LocalityChecker lc = getModExtractor(useSemantic, r).getModularizer().getLocalityChecker(); lc.setSignatureValue(sig); result.clear(); add(result, getOntology().getAxioms().stream().filter(p -> !lc.local(p.getAxiom()))); return result; }
LocalityChecker lc = getModExtractor(false, null).getModularizer().getLocalityChecker(); for (Map.Entry<OWLEntity, Signature> p : name2Sig.entrySet()) { lc.setSignatureValue(p.getValue()); for (AxiomWrapper notProcessed : ontology.getAxioms()) { if (!lc.local(notProcessed.getAxiom())) {