/** * Get the entities referenced in this axiom * * @param axiom * @return */ protected Set<OWLEntity> getSignature(OWLAxiom axiom) { return axiomEntities.get( axiom ); }
/** * Return the axioms which references this entity * * @param entity * @return */ public Set<OWLAxiom> getAxioms(OWLEntity entity) { Set<OWLAxiom> axioms = entityAxioms.get( entity ); if( axioms == null ) axioms = Collections.emptySet(); return axioms; }
public boolean contains( K key, V value ) { Set<V> values = get( key ); if (values == null) { return false; } return values.contains(value); }
public boolean contains( K key, V value ) { Set<V> values = get( key ); if (values == null) return false; return values.contains(value); }
public Set<ATermAppl> getABoxAssertions(AssertionType assertionType) { Set<ATermAppl> assertions = aboxAssertions.get( assertionType ); if( assertions == null ) return Collections.emptySet(); else return Collections.unmodifiableSet( assertions ); }
public Set<ATermAppl> getABoxAssertions(AssertionType assertionType) { Set<ATermAppl> assertions = aboxAssertions.get( assertionType ); if( assertions == null ) return Collections.emptySet(); else return Collections.unmodifiableSet( assertions ); }
public boolean remove(Object key, Object value) { boolean removed = false; Set<V> values = get( key ); if( values != null ) { removed = values.remove( value ); if( values.isEmpty() ) { super.remove( key ); } } return removed; }
public Set<ATermAppl> getAllSuperRoles(ATermAppl r1, ATermAppl r2) { MultiValueMap<ATermAppl, ATermAppl> innerMap = m_BinaryRoleInclusions.get(r1); if (innerMap == null) return Collections.emptySet(); Set<ATermAppl> superRoles = innerMap.get(r2); if (superRoles == null) return Collections.emptySet(); return superRoles; }
public Set<ATermAppl> getAllSuperRoles(ATermAppl r1, ATermAppl r2) { MultiValueMap<ATermAppl, ATermAppl> innerMap = m_BinaryRoleInclusions.get(r1); if (innerMap == null) return Collections.emptySet(); Set<ATermAppl> superRoles = innerMap.get(r2); if (superRoles == null) return Collections.emptySet(); return superRoles; }
public boolean addAll(K key, Collection<? extends V> collection) { Set<V> values = get( key ); if( values == null ) { values = new HashSet<V>(); super.put( key, values ); } return values.addAll( collection ); }
public boolean add( K key, V value ) { Set<V> values = get( key ); if( values == null ) { values = new HashSet<V>(); super.put( key, values ); } return values.add( value ); }
public boolean add( K key, V value ) { Set<V> values = get( key ); if( values == null ) { values = new HashSet<V>(); super.put( key, values ); } return values.add( value ); }
public boolean addAll(K key, Collection<? extends V> collection) { Set<V> values = get( key ); if( values == null ) { values = new HashSet<V>(); super.put( key, values ); } return values.addAll( collection ); }
public boolean remove( K key, V value ) { boolean removed = false; Set<V> values = get( key ); if( values != null ) { removed = values.remove( value ); if( values.isEmpty() ) super.remove( key ); } return removed; }
public OWLOntology getModule(OWLEntity entity) { return getModuleFromSignature( modules.get( entity ) ); }
private TaxonomyNode<ATermAppl> add(ATermAppl c) { TaxonomyNode<ATermAppl> node = taxonomy.getNode( c ); if( node == null ) { Set<ATermAppl> equivalents = CollectionUtils.makeSet(); Set<TaxonomyNode<ATermAppl>> subsumerNodes = CollectionUtils.makeSet(); for( ATermAppl subsumer : subsumers.get( c ) ) { if( c.equals( subsumer ) || !ATermUtils.isPrimitive( subsumer ) ) continue; if( subsumers.get( subsumer ).contains( c ) ) { equivalents.add( subsumer ); } else { TaxonomyNode<ATermAppl> supNode = add( subsumer ); subsumerNodes.add( supNode ); } } node = add( c, subsumerNodes ); for( ATermAppl eq : equivalents ) { taxonomy.addEquivalentNode( eq, node ); } } return node; }
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 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; }
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; }