boolean computeSuperClasses(){
  Set<OwlClass> ancestors=new HashSet<OwlClass>();
  Set<OwlClass> frontier=new HashSet<OwlClass>(superClasses);
  while (!frontier.isEmpty()) {
    Set<OwlClass> next=new HashSet<OwlClass>();
    for (    OwlClass ancestor : frontier) {
      ancestors.add(ancestor);
      next.addAll(ancestor.superClasses);
    }
    next.removeAll(ancestors);
    frontier=next;
  }
  boolean newInfo=!ancestors.equals(superClasses);
  superClasses=ancestors;
  return newInfo;
}

boolean computeSuperClasses ( ) { Set < OwlClass > ancestors = new HashSet < OwlClass > ( ) ; Set < OwlClass > frontier = new HashSet < OwlClass > ( superClasses ) ; while ( ! frontier . isEmpty ( ) ) { Set < OwlClass > next = new HashSet < OwlClass > ( ) ; for ( OwlClass ancestor : frontier ) { ancestors . add ( ancestor ) ; next . addAll ( ancestor . superClasses ) ; } next . removeAll ( ancestors ) ; frontier = next ; } boolean newInfo = ! ancestors . equals ( superClasses ) ; superClasses = ancestors ; return newInfo ; }
apply rl rule scm - sco : subclassof transitivity . follows subclassof chains to compute all the ancestor classes . assumes the hierarchy is small enough that a simple bfs is fine .
