/** * get a set of axioms that corresponds to the module of the atom with the id INDEX * * @param index index * @return module at index */ Collection<AxiomWrapper> getAtomModule(int index) { return decomposer.getAOS().get(index).getModule(); }
/** * @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 axioms axioms * @param type type */ public AtomicDecompositionImpl(List<OWLAxiom> axioms, ModuleType type) { this.type = type; decomposer = new Decomposer(AxiomSelector.wrap(axioms), new SyntacticLocalityChecker()); int size = decomposer.getAOS(this.type).size(); atoms = new ArrayList<>(); for (int i = 0; i < size; i++) { final Atom atom = new Atom(asSet(decomposer.getAOS().get(i).getAtomAxioms())); atoms.add(atom); atomIndex.put(atom, i); for (OWLEntity e : atom.getSignature()) { termBasedIndex.put(e, atom); } } for (int i = 0; i < size; i++) { Set<OntologyAtom> dependentIndexes = decomposer.getAOS().get(i).getDependencies(); for (OntologyAtom j : dependentIndexes) { dependencies.put(atoms.get(i), atoms.get(j.getId())); dependents.put(atoms.get(j.getId()), atoms.get(i)); } } }
atomList = new AtomList(); atomList.reduceGraph(); return verifyNotNull(atomList);
/** * @param axioms axioms * @param type type */ public AtomicDecompositionImpl(List<OWLAxiom> axioms, ModuleType type) { this.type = type; decomposer = new Decomposer(AxiomSelector.wrap(axioms), new SyntacticLocalityChecker()); int size = decomposer.getAOS(this.type).size(); atoms = new ArrayList<>(); for (int i = 0; i < size; i++) { final Atom atom = new Atom(asSet(decomposer.getAOS().get(i).getAtomAxioms())); atoms.add(atom); atomIndex.put(atom, i); for (OWLEntity e : atom.getSignature()) { termBasedIndex.put(e, atom); } } for (int i = 0; i < size; i++) { Set<OntologyAtom> dependentIndexes = decomposer.getAOS().get(i).getDependencies(); for (OntologyAtom j : dependentIndexes) { dependencies.put(atoms.get(i), atoms.get(j.getId())); dependents.put(atoms.get(j.getId()), atoms.get(i)); } } }
atomList = new AtomList(); atomList.reduceGraph(); return verifyNotNull(atomList);
/** * @param axioms axioms * @param type type */ public AtomicDecompositionImpl(List<OWLAxiom> axioms, ModuleType type) { this.type = type; decomposer = new Decomposer(AxiomSelector.wrap(axioms), new SyntacticLocalityChecker()); int size = decomposer.getAOS(this.type).size(); atoms = new ArrayList<>(); for (int i = 0; i < size; i++) { final Atom atom = new Atom(asSet(decomposer.getAOS().get(i).getAtomAxioms())); atoms.add(atom); atomIndex.put(atom, i); for (OWLEntity e : atom.getSignature()) { termBasedIndex.put(e, atom); } } for (int i = 0; i < size; i++) { Set<OntologyAtom> dependentIndexes = decomposer.getAOS().get(i).getDependencies(); for (OntologyAtom j : dependentIndexes) { dependencies.put(atoms.get(i), atoms.get(j.getId())); dependents.put(atoms.get(j.getId()), atoms.get(i)); } } }
atomList = new AtomList(); atomList.reduceGraph(); return verifyNotNull(atomList);
/** * get a set of axioms that corresponds to the module of the atom with the id INDEX * * @param index index * @return module at index */ Collection<AxiomWrapper> getAtomModule(int index) { return decomposer.getAOS().get(index).getModule(); }
/** * @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 axioms axioms * @param type type */ public AtomicDecompositionImpl(List<OWLAxiom> axioms, ModuleType type) { this.type = type; decomposer = new Decomposer(AxiomSelector.wrap(axioms), new SyntacticLocalityChecker()); int size = decomposer.getAOS(this.type).size(); atoms = new ArrayList<>(); for (int i = 0; i < size; i++) { final Atom atom = new Atom(asSet(decomposer.getAOS().get(i).getAtomAxioms())); atoms.add(atom); atomIndex.put(atom, i); for (OWLEntity e : atom.getSignature()) { termBasedIndex.put(e, atom); } } for (int i = 0; i < size; i++) { Set<OntologyAtom> dependentIndexes = decomposer.getAOS().get(i).getDependencies(); for (OntologyAtom j : dependentIndexes) { dependencies.put(atoms.get(i), atoms.get(j.getId())); dependents.put(atoms.get(j.getId()), atoms.get(i)); } } }
atomList = new AtomList(); atomList.reduceGraph(); return verifyNotNull(atomList);
/** * get a set of axioms that corresponds to the module of the atom with the id INDEX * * @param index index * @return module at index */ Collection<AxiomWrapper> getAtomModule(int index) { return decomposer.getAOS().get(index).getModule(); }
/** * @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); }
/** * get a set of axioms that corresponds to the module of the atom with the id INDEX * * @param index index * @return module at index */ Collection<AxiomWrapper> getAtomModule(int index) { return decomposer.getAOS().get(index).getModule(); }
/** * @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); }
/** * get a set of atoms on which atom with index INDEX depends * * @param index * index * @return dependent atoms for atom */ @PortedFrom(file = "Kernel.h", name = "getAtomDependents") public Set<OntologyAtom> getAtomDependents(int index) { return ad.getAtomList().get(index).getDependencies(); }
/** * get a set of axioms that corresponds to the atom with the id INDEX * * @param index * index * @return list of axioms for atom */ @PortedFrom(file = "Kernel.h", name = "getAtomAxioms") public List<AxiomWrapper> getAtomAxioms(int index) { return ad.getAtomList().get(index).getAtomAxioms(); }
/** * get a set of axioms that corresponds to the module of the atom with the * id INDEX * * @param index * index * @return module for atom */ @PortedFrom(file = "Kernel.h", name = "getAtomModule") public List<AxiomWrapper> getAtomModule(int index) { return ad.getAtomList().get(index).getModule(); }