org.dllearner.core.owl
Class ClassHierarchy

java.lang.Object
  extended by org.dllearner.core.owl.ClassHierarchy

public class ClassHierarchy
extends Object

Represents a subsumption hierarchy (ignoring equivalent concepts).

Author:
Jens Lehmann

Field Summary
static org.apache.log4j.Logger logger
           
 
Constructor Summary
ClassHierarchy(TreeMap<Description,SortedSet<Description>> subsumptionHierarchyUp, TreeMap<Description,SortedSet<Description>> subsumptionHierarchyDown)
          The arguments specify the superclasses and subclasses of each class.
 
Method Summary
 ClassHierarchy clone()
           
 ClassHierarchy cloneAndRestrict(Set<NamedClass> allowedClasses)
          The method computes a new class hierarchy, which is a copy of this one, but only the specified classes are allowed to occur.
 SortedSet<Description> getSiblingClasses(Description description)
          Computes the siblings of the specified descriptions.
 SortedSet<Description> getSubClasses(Description concept)
           
 SortedSet<Description> getSuperClasses(Description concept)
           
 boolean isSubclassOf(NamedClass subClass, NamedClass superClass)
          Implements a subsumption check using the hierarchy (no further reasoning checks are used).
 void thinOutSubsumptionHierarchy()
          This method modifies the subsumption hierarchy such that for each class, there is only a single path to reach it via upward and downward refinement respectively.
 String toString()
           
 String toString(boolean showUpwardHierarchy)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

logger

public static org.apache.log4j.Logger logger
Constructor Detail

ClassHierarchy

public ClassHierarchy(TreeMap<Description,SortedSet<Description>> subsumptionHierarchyUp,
                      TreeMap<Description,SortedSet<Description>> subsumptionHierarchyDown)
The arguments specify the superclasses and subclasses of each class. This is used to build the subsumption hierarchy.

Parameters:
subsumptionHierarchyUp - Contains super classes for each class.
subsumptionHierarchyDown - Contains sub classes for each class.
Method Detail

getSuperClasses

public SortedSet<Description> getSuperClasses(Description concept)

getSubClasses

public SortedSet<Description> getSubClasses(Description concept)

getSiblingClasses

public SortedSet<Description> getSiblingClasses(Description description)
Computes the siblings of the specified descriptions. Siblings are all those classes, which are subclasses of a parent of a class and not equal to the class itself. Note that retrieving siblings is computationally more expensive than descending/ascending the hierarchy as siblings are computed when required and not cached.

Parameters:
description - A named class.
Returns:
A set of named classes, which are siblings of the given class.

thinOutSubsumptionHierarchy

public void thinOutSubsumptionHierarchy()
This method modifies the subsumption hierarchy such that for each class, there is only a single path to reach it via upward and downward refinement respectively.


isSubclassOf

public boolean isSubclassOf(NamedClass subClass,
                            NamedClass superClass)
Implements a subsumption check using the hierarchy (no further reasoning checks are used).

Parameters:
subClass - The (supposedly) more special class.
superClass - The (supposedly) more general class.
Returns:
True if subClass is a subclass of superclass.

toString

public String toString()
Overrides:
toString in class Object

toString

public String toString(boolean showUpwardHierarchy)

clone

public ClassHierarchy clone()
Overrides:
clone in class Object

cloneAndRestrict

public ClassHierarchy cloneAndRestrict(Set<NamedClass> allowedClasses)
The method computes a new class hierarchy, which is a copy of this one, but only the specified classes are allowed to occur. For instance, if we have subclass relationships between 1sYearStudent, Student, and Person, but Student is not allowed, then there a is a subclass relationship between 1stYearStudent and Person. Currently, owl:Thing and owl:Nothing are always allowed for technical reasons.

Parameters:
allowedClasses - The classes, which are allowed to occur in the new class hierarchy.
Returns:
A copy of this hierarchy, which is restricted to a certain set of classes.


SourceForge.net Logo DL-Learner is licenced under the terms of the GNU General Public License.
Copyright © 2007-2011 Jens Lehmann