/** * @param sig signature * @param parent parent atom * @return module for given axiom AX; use parent atom's module as a base for the module search */ private Optional<OntologyAtom> buildModule(Signature sig, OntologyAtom parent) { // build a module for a given signature modularizer.extract(parent.getModule(), sig, type); Collection<AxiomWrapper> module = modularizer.getModule(); // if module is empty (empty bottom atom) -- do nothing if (module.isEmpty()) { return Optional.empty(); } // check if the module corresponds to a PARENT one; modules are the same // iff their sizes are the same if (parent != rootAtom && module.size() == parent.getModule().size()) { return Optional.of(parent); } // create new atom with that module assert atomList != null; OntologyAtom atom = atomList.newAtom(); atom.setModule(module); return Optional.of(atom); }
/** * @param sig signature * @param parent parent atom * @return module for given axiom AX; use parent atom's module as a base for the module search */ private Optional<OntologyAtom> buildModule(Signature sig, OntologyAtom parent) { // build a module for a given signature modularizer.extract(parent.getModule(), sig, type); Collection<AxiomWrapper> module = modularizer.getModule(); // if module is empty (empty bottom atom) -- do nothing if (module.isEmpty()) { return Optional.empty(); } // check if the module corresponds to a PARENT one; modules are the same // iff their sizes are the same if (parent != rootAtom && module.size() == parent.getModule().size()) { return Optional.of(parent); } // create new atom with that module assert atomList != null; OntologyAtom atom = atomList.newAtom(); atom.setModule(module); return Optional.of(atom); }
/** * @param sig signature * @param parent parent atom * @return module for given axiom AX; use parent atom's module as a base for the module search */ private Optional<OntologyAtom> buildModule(Signature sig, OntologyAtom parent) { // build a module for a given signature modularizer.extract(parent.getModule(), sig, type); Collection<AxiomWrapper> module = modularizer.getModule(); // if module is empty (empty bottom atom) -- do nothing if (module.isEmpty()) { return Optional.empty(); } // check if the module corresponds to a PARENT one; modules are the same // iff their sizes are the same if (parent != rootAtom && module.size() == parent.getModule().size()) { return Optional.of(parent); } // create new atom with that module assert atomList != null; OntologyAtom atom = atomList.newAtom(); atom.setModule(module); return Optional.of(atom); }
/** * @param sig signature * @param parent parent atom * @return module for given axiom AX; use parent atom's module as a base for the module search */ private Optional<OntologyAtom> buildModule(Signature sig, OntologyAtom parent) { // build a module for a given signature modularizer.extract(parent.getModule(), sig, type); Collection<AxiomWrapper> module = modularizer.getModule(); // if module is empty (empty bottom atom) -- do nothing if (module.isEmpty()) { return Optional.empty(); } // check if the module corresponds to a PARENT one; modules are the same // iff their sizes are the same if (parent != rootAtom && module.size() == parent.getModule().size()) { return Optional.of(parent); } // create new atom with that module assert atomList != null; OntologyAtom atom = atomList.newAtom(); atom.setModule(module); return Optional.of(atom); }
/** * @param signature the signature to use * @param moduletype module type * @param useSemantics true if semantic locality should be used * @return a set of axioms that corresponds to the atom with the id INDEX */ public Collection<AxiomWrapper> getModule(Stream<OWLEntity> signature, boolean useSemantics, ModuleType moduletype) { // init signature Signature sig = new Signature(signature); sig.setLocality(false); modularizer.extract(axioms, sig, moduletype); return modularizer.getModule(); } }
/** * @param signature the signature to use * @param moduletype module type * @param useSemantics true if semantic locality should be used * @return a set of axioms that corresponds to the atom with the id INDEX */ public Collection<AxiomWrapper> getModule(Stream<OWLEntity> signature, boolean useSemantics, ModuleType moduletype) { // init signature Signature sig = new Signature(signature); sig.setLocality(false); modularizer.extract(axioms, sig, moduletype); return modularizer.getModule(); } }
/** * @param signature the signature to use * @param moduletype module type * @param useSemantics true if semantic locality should be used * @return a set of axioms that corresponds to the atom with the id INDEX */ public Collection<AxiomWrapper> getModule(Stream<OWLEntity> signature, boolean useSemantics, ModuleType moduletype) { // init signature Signature sig = new Signature(signature); sig.setLocality(false); modularizer.extract(axioms, sig, moduletype); return modularizer.getModule(); } }
/** * @param signature the signature to use * @param moduletype module type * @param useSemantics true if semantic locality should be used * @return a set of axioms that corresponds to the atom with the id INDEX */ public Collection<AxiomWrapper> getModule(Stream<OWLEntity> signature, boolean useSemantics, ModuleType moduletype) { // init signature Signature sig = new Signature(signature); sig.setLocality(false); modularizer.extract(axioms, sig, moduletype); return modularizer.getModule(); } }
/** * build signature for ENTITY and all dependent entities from toProcess; * look for modules in Module; * * @param entity * entity * @param module * Module * @param toProcess * toProcess */ @PortedFrom(file = "Incremental.cpp", name = "buildSignature") public void buildSignature(OWLEntity entity, Collection<AxiomWrapper> module, Set<OWLEntity> toProcess) { toProcess.remove(entity); setupSig(entity); Collection<AxiomWrapper> newModule = getModExtractor(false, null).getModularizer().getModule(); if (module.size() == newModule.size()) { return; } // smaller module: recurse Signature modSig = getModExtractor(false, null).getModularizer().getSignature(); modSig.getSignature().stream().filter(toProcess::contains).forEach(p -> buildSignature(p, newModule, toProcess)); }