/** * Saves the information about modules from ModuleExtractor to an output stream as an ontology of modules annotated with URIs of the OWL entities that * belong to the respective modules. * * @param modules the modules to be saved * @param outputStream the output stream where the _data should be saved * @throws IOException if an error should occur during the save process */ public static void saveModules(final MultiValueMap<OWLEntity, OWLEntity> modules, final OutputStream outputStream) { final PrintWriter pw = new PrintWriter(outputStream); for (final Entry<OWLEntity, Set<OWLEntity>> entry : modules.entrySet()) { final OWLEntity entity = entry.getKey(); final Set<OWLEntity> module = entry.getValue(); pw.println(getModuleBegin(entity)); for (final OWLEntity member : module) pw.println(getModuleMember(member)); pw.println(getModuleEnd()); } pw.flush(); }
/** * Saves the information about modules from ModuleExtractor to an output stream as an ontology of modules annotated with URIs of the OWL entities that * belong to the respective modules. * * @param modules the modules to be saved * @param outputStream the output stream where the _data should be saved * @throws IOException if an error should occur during the save process */ public static void saveModules(final MultiValueMap<OWLEntity, OWLEntity> modules, final OutputStream outputStream) { final PrintWriter pw = new PrintWriter(outputStream); for (final Entry<OWLEntity, Set<OWLEntity>> entry : modules.entrySet()) { final OWLEntity entity = entry.getKey(); final Set<OWLEntity> module = entry.getValue(); pw.println(getModuleBegin(entity)); for (final OWLEntity member : module) pw.println(getModuleMember(member)); pw.println(getModuleEnd()); } pw.flush(); }
public void verify() { for (final Map.Entry<OWLObjectProperty, Set<OWLObjectPropertyAxiom>> entry : _compositePropertyAxioms.entrySet()) { final OWLObjectProperty nonSimpleProperty = entry.getKey(); if (!_simpleProperties.contains(nonSimpleProperty)) continue; final Set<OWLObjectPropertyAxiom> axioms = entry.getValue(); for (final OWLObjectPropertyAxiom axiom : axioms) addUnsupportedAxiom(axiom); final ATermAppl name = ATermUtils.makeTermAppl(nonSimpleProperty.getIRI().toString()); final Role role = _kb.getRBox().getRole(name); role.removeSubRoleChains(); } }
public void verify() { for (final Map.Entry<OWLObjectProperty, Set<OWLObjectPropertyAxiom>> entry : _compositePropertyAxioms.entrySet()) { final OWLObjectProperty nonSimpleProperty = entry.getKey(); if (!_simpleProperties.contains(nonSimpleProperty)) continue; final Set<OWLObjectPropertyAxiom> axioms = entry.getValue(); for (final OWLObjectPropertyAxiom axiom : axioms) addUnsupportedAxiom(axiom); final ATermAppl name = ATermUtils.makeTermAppl(nonSimpleProperty.getIRI().toString()); final Role role = _kb.getRBox().getRole(name); role.removeSubRoleChains(); } }
public void verify() { for (final Map.Entry<OWLObjectProperty, Set<OWLObjectPropertyAxiom>> entry : _compositePropertyAxioms.entrySet()) { final OWLObjectProperty nonSimpleProperty = entry.getKey(); if (!_simpleProperties.contains(nonSimpleProperty)) continue; final Set<OWLObjectPropertyAxiom> axioms = entry.getValue(); for (final OWLObjectPropertyAxiom axiom : axioms) addUnsupportedAxiom(axiom); final ATermAppl name = ATermUtils.makeTermAppl(nonSimpleProperty.getIRI().toString()); final Role role = _kb.getRBox().getRole(name); role.removeSubRoleChains(); } }
private static Bool checkDisjointPropertyClash(final CachedNode root1, final CachedNode root2) { final MultiValueMap<ATermAppl, Role> neighbors1 = collectNeighbors(root1); if (neighbors1.isEmpty()) return null; final MultiValueMap<ATermAppl, Role> neighbors2 = collectNeighbors(root2); if (neighbors2.isEmpty()) return null; for (final Entry<ATermAppl, Set<Role>> e : neighbors1.entrySet()) { final ATermAppl commonNeighbor = e.getKey(); final Set<Role> roles1 = e.getValue(); final Set<Role> roles2 = neighbors2.get(commonNeighbor); if (roles2 == null) continue; if (checkDisjointProperties(roles1, roles2)) return Bool.UNKNOWN; } return null; }
private static Bool checkDisjointPropertyClash(final CachedNode root1, final CachedNode root2) { final MultiValueMap<ATermAppl, Role> neighbors1 = collectNeighbors(root1); if (neighbors1.isEmpty()) return null; final MultiValueMap<ATermAppl, Role> neighbors2 = collectNeighbors(root2); if (neighbors2.isEmpty()) return null; for (final Entry<ATermAppl, Set<Role>> e : neighbors1.entrySet()) { final ATermAppl commonNeighbor = e.getKey(); final Set<Role> roles1 = e.getValue(); final Set<Role> roles2 = neighbors2.get(commonNeighbor); if (roles2 == null) continue; if (checkDisjointProperties(roles1, roles2)) return Bool.UNKNOWN; } return null; }
public Taxonomy<ATermAppl> build(final MultiValueMap<ATermAppl, ATermAppl> subsumers) { _subsumers = subsumers; _taxonomyImpl = new TaxonomyImpl<>(null, ATermUtils.TOP, ATermUtils.BOTTOM); for (final ATermAppl subsumer : subsumers.get(ATermUtils.TOP)) if (ATermUtils.isPrimitive(subsumer)) _taxonomyImpl.addEquivalentNode(subsumer, _taxonomyImpl.getTop()); for (final Entry<ATermAppl, Set<ATermAppl>> entry : subsumers.entrySet()) { final ATermAppl c = entry.getKey(); if (ATermUtils.isPrimitive(c)) if (entry.getValue().contains(ATermUtils.BOTTOM)) _taxonomyImpl.addEquivalentNode(c, _taxonomyImpl.getBottomNode()); else add(c); } return _taxonomyImpl; }
public Taxonomy<ATermAppl> build(final MultiValueMap<ATermAppl, ATermAppl> subsumers) { _subsumers = subsumers; _taxonomyImpl = new TaxonomyImpl<>(null, ATermUtils.TOP, ATermUtils.BOTTOM); for (final ATermAppl subsumer : subsumers.get(ATermUtils.TOP)) if (ATermUtils.isPrimitive(subsumer)) _taxonomyImpl.addEquivalentNode(subsumer, _taxonomyImpl.getTop()); for (final Entry<ATermAppl, Set<ATermAppl>> entry : subsumers.entrySet()) { final ATermAppl c = entry.getKey(); if (ATermUtils.isPrimitive(c)) if (entry.getValue().contains(ATermUtils.BOTTOM)) _taxonomyImpl.addEquivalentNode(c, _taxonomyImpl.getBottomNode()); else add(c); } return _taxonomyImpl; }
for (final Entry<ATermAppl, Set<ConceptInfo>> e : sub.getPredecessors().entrySet())
for (final Entry<ATermAppl, Set<ConceptInfo>> e : sub.getPredecessors().entrySet())