/** * 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( MultiValueMap<OWLEntity, OWLEntity> modules, OutputStream outputStream ) throws IOException { PrintWriter pw = new PrintWriter( outputStream ); for ( Entry<OWLEntity, Set<OWLEntity>> entry : modules.entrySet() ) { OWLEntity entity = entry.getKey(); Set<OWLEntity> module = entry.getValue(); pw.println( getModuleBegin( entity ) ); for( OWLEntity member : module ) { pw.println( getModuleMember( member ) ); } pw.println( getModuleEnd() ); } pw.flush(); }
void verify() { for( Map.Entry<OWLObjectProperty, Set<OWLObjectPropertyAxiom>> entry : compositePropertyAxioms .entrySet() ) { OWLObjectProperty nonSimpleProperty = entry.getKey(); if( !simpleProperties.contains( nonSimpleProperty ) ) continue; Set<OWLObjectPropertyAxiom> axioms = entry.getValue(); for( OWLObjectPropertyAxiom axiom : axioms ) addUnsupportedAxiom( axiom ); ATermAppl name = ATermUtils.makeTermAppl( nonSimpleProperty.getIRI().toString() ); Role role = kb.getRBox().getRole( name ); role.removeSubRoleChains(); } }
private Bool checkDisjointPropertyClash(CachedNode root1, CachedNode root2) { MultiValueMap<ATermAppl, Role> neighbors1 = collectNeighbors( root1 ); if( neighbors1.isEmpty() ) return null; MultiValueMap<ATermAppl, Role> neighbors2 = collectNeighbors( root2 ); if( neighbors2.isEmpty() ) return null; for( Entry<ATermAppl, Set<Role>> e : neighbors1.entrySet() ) { ATermAppl commonNeighbor = e.getKey(); Set<Role> roles1 = e.getValue(); Set<Role> roles2 = neighbors2.get( commonNeighbor ); if( roles2 == null ) continue; if( checkDisjointProperties( roles1, roles2 ) ) return Bool.UNKNOWN; } return null; }
void verify() { for( Map.Entry<OWLObjectProperty, Set<OWLObjectPropertyAxiom>> entry : compositePropertyAxioms .entrySet() ) { OWLObjectProperty nonSimpleProperty = entry.getKey(); if( !simpleProperties.contains( nonSimpleProperty ) ) { continue; } Set<OWLObjectPropertyAxiom> axioms = entry.getValue(); for( OWLObjectPropertyAxiom axiom : axioms ) { addUnsupportedAxiom( axiom ); } ATermAppl name = ATermUtils.makeTermAppl( nonSimpleProperty.getIRI().toString() ); Role role = kb.getRBox().getRole( name ); role.removeSubRoleChains(); } }
private Bool checkDisjointPropertyClash(CachedNode root1, CachedNode root2) { MultiValueMap<ATermAppl, Role> neighbors1 = collectNeighbors( root1 ); if( neighbors1.isEmpty() ) return null; MultiValueMap<ATermAppl, Role> neighbors2 = collectNeighbors( root2 ); if( neighbors2.isEmpty() ) return null; for( Entry<ATermAppl, Set<Role>> e : neighbors1.entrySet() ) { ATermAppl commonNeighbor = e.getKey(); Set<Role> roles1 = e.getValue(); Set<Role> roles2 = neighbors2.get( commonNeighbor ); if( roles2 == null ) continue; if( checkDisjointProperties( roles1, roles2 ) ) return Bool.UNKNOWN; } return null; }
private void processQueue() { int startingSize = queue.size(); while( !queue.isEmpty() ) { int processed = startingSize - queue.size(); if( monitor.getProgress() < processed ) monitor.setProgress( processed ); MultiValueMap<ConceptInfo, Trigger> localQueue = queue; queue = new MultiValueMap<ConceptInfo, Trigger>(); for (Entry<ConceptInfo, Set<Trigger>> entry : localQueue.entrySet()) { ConceptInfo ci = entry.getKey(); for (Trigger trigger : entry.getValue()) { processTrigger(ci, trigger); } } } }
private void processQueue() { int startingSize = queue.size(); while( !queue.isEmpty() ) { int processed = startingSize - queue.size(); if( monitor.getProgress() < processed ) monitor.setProgress( processed ); MultiValueMap<ConceptInfo, Trigger> localQueue = queue; queue = new MultiValueMap<ConceptInfo, Trigger>(); for (Entry<ConceptInfo, Set<Trigger>> entry : localQueue.entrySet()) { ConceptInfo ci = entry.getKey(); for (Trigger trigger : entry.getValue()) { processTrigger(ci, trigger); } } } }
public Taxonomy<ATermAppl> build(MultiValueMap<ATermAppl, ATermAppl> subsumers) { this.subsumers = subsumers; taxonomy = new Taxonomy<ATermAppl>( null, ATermUtils.TOP, ATermUtils.BOTTOM ); for( ATermAppl subsumer : subsumers.get( ATermUtils.TOP ) ) { if( ATermUtils.isPrimitive( subsumer ) ) taxonomy.addEquivalentNode( subsumer, taxonomy.getTop() ); } for( Entry<ATermAppl, Set<ATermAppl>> entry : subsumers.entrySet() ) { ATermAppl c = entry.getKey(); if( ATermUtils.isPrimitive( c ) ) { if( entry.getValue().contains( ATermUtils.BOTTOM ) ) { taxonomy.addEquivalentNode( c, taxonomy.getBottom() ); } else { add( c ); } } } return taxonomy; }
public Taxonomy<ATermAppl> build(MultiValueMap<ATermAppl, ATermAppl> subsumers) { this.subsumers = subsumers; taxonomy = new Taxonomy<ATermAppl>( null, ATermUtils.TOP, ATermUtils.BOTTOM ); for( ATermAppl subsumer : subsumers.get( ATermUtils.TOP ) ) { if( ATermUtils.isPrimitive( subsumer ) ) taxonomy.addEquivalentNode( subsumer, taxonomy.getTop() ); } for( Entry<ATermAppl, Set<ATermAppl>> entry : subsumers.entrySet() ) { ATermAppl c = entry.getKey(); if( ATermUtils.isPrimitive( c ) ) { if( entry.getValue().contains( ATermUtils.BOTTOM ) ) { taxonomy.addEquivalentNode( c, taxonomy.getBottom() ); } else { add( c ); } } } return taxonomy; }
for (Entry<ATermAppl, Set<ConceptInfo>> entry : CollectionUtils.makeList(pred.getPredecessors().entrySet())) { ATermAppl predProp = entry.getKey(); for (ATermAppl supProp : roleChains.getAllSuperRoles(predProp, p)) { for (Entry<ATermAppl, Set<ConceptInfo>> entry : CollectionUtils.makeList(succ.getSuccessors().entrySet())) { ATermAppl succProp = entry.getKey(); for (ATermAppl supProp : roleChains.getAllSuperRoles(p, succProp)) {
for (Entry<ATermAppl, Set<ConceptInfo>> entry : CollectionUtils.makeList(pred.getPredecessors().entrySet())) { ATermAppl predProp = entry.getKey(); for (ATermAppl supProp : roleChains.getAllSuperRoles(predProp, p)) { for (Entry<ATermAppl, Set<ConceptInfo>> entry : CollectionUtils.makeList(succ.getSuccessors().entrySet())) { ATermAppl succProp = entry.getKey(); for (ATermAppl supProp : roleChains.getAllSuperRoles(p, succProp)) {
for( Entry<ATermAppl, Set<ConceptInfo>> e : sub.getPredecessors().entrySet() ) { ATermAppl prop = e.getKey(); if( MATERIALIZE_SUPER_PROPERTIES ) {
for( Map.Entry<ATermAppl, Set<ConceptInfo>> e : ci.getPredecessors().entrySet() ) { ATermAppl prop = e.getKey(); for( ConceptInfo pred: e.getValue() ) {
for( Entry<ATermAppl, Set<ConceptInfo>> e : sub.getPredecessors().entrySet() ) { ATermAppl prop = e.getKey(); if( MATERIALIZE_SUPER_PROPERTIES ) {
for( Map.Entry<ATermAppl, Set<ConceptInfo>> e : ci.getPredecessors().entrySet() ) { ATermAppl prop = e.getKey(); for( ConceptInfo pred: e.getValue() ) {
for (Entry<ATermAppl, Set<ConceptInfo>> entry : ci.getPredecessors().entrySet()) { ATermAppl predProp = entry.getKey(); for (ConceptInfo pred : entry.getValue()) { for (Entry<ATermAppl, Set<ConceptInfo>> entry : qi.getSuccessors().entrySet()) { ATermAppl succProp = entry.getKey(); for (ConceptInfo succ : entry.getValue()) {
for (Entry<ATermAppl, Set<ConceptInfo>> entry : ci.getPredecessors().entrySet()) { ATermAppl predProp = entry.getKey(); for (ConceptInfo pred : entry.getValue()) { for (Entry<ATermAppl, Set<ConceptInfo>> entry : qi.getSuccessors().entrySet()) { ATermAppl succProp = entry.getKey(); for (ConceptInfo succ : entry.getValue()) {