org.mindswap.pellet.utils
Class TaxonomyUtils

java.lang.Object
  extended by org.mindswap.pellet.utils.TaxonomyUtils

public class TaxonomyUtils
extends java.lang.Object

Title: TaxonomyUtils

Description: Utilities for manipulating taxonomy data structure

Copyright: Copyright (c) 2007

Company: Clark & Parsia, LLC.

Author:
Mike Smith

Field Summary
static java.lang.Object INSTANCES_KEY
           
static java.lang.Object SUPER_EXPLANATION_KEY
           
 
Constructor Summary
TaxonomyUtils()
           
 
Method Summary
static boolean addSuperExplanation(Taxonomy<aterm.ATermAppl> t, aterm.ATermAppl sub, aterm.ATermAppl sup, java.util.Set<aterm.ATermAppl> explanation)
           
static void clearAllInstances(Taxonomy<?> t)
           
static void clearSuperExplanation(Taxonomy<aterm.ATermAppl> t, aterm.ATermAppl c)
           
static
<T,I> java.util.Set<I>
getAllInstances(Taxonomy<T> t, T c)
          Retrieve all instances of a class (based on the current state of the taxonomy)
static
<T,I> java.util.Set<I>
getDirectInstances(Taxonomy<T> t, T c)
          Retrieve direct instances of a class (based on current state of the taxonomy)
static java.util.Set<java.util.Set<aterm.ATermAppl>> getSuperExplanations(Taxonomy<aterm.ATermAppl> t, aterm.ATermAppl sub, aterm.ATermAppl sup)
           
static
<T> java.util.Set<java.util.Set<T>>
getTypes(Taxonomy<T> t, java.lang.Object ind, boolean directOnly)
          Get classes of which the individual is an instance (based on the current state of the taxonomy)
static boolean isType(Taxonomy<aterm.ATermAppl> t, aterm.ATermAppl ind, aterm.ATermAppl c)
          Determine if an individual is an instance of a class (based on the current state of the taxonomy)
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INSTANCES_KEY

public static final java.lang.Object INSTANCES_KEY

SUPER_EXPLANATION_KEY

public static final java.lang.Object SUPER_EXPLANATION_KEY
Constructor Detail

TaxonomyUtils

public TaxonomyUtils()
Method Detail

addSuperExplanation

public static boolean addSuperExplanation(Taxonomy<aterm.ATermAppl> t,
                                          aterm.ATermAppl sub,
                                          aterm.ATermAppl sup,
                                          java.util.Set<aterm.ATermAppl> explanation)

clearSuperExplanation

public static void clearSuperExplanation(Taxonomy<aterm.ATermAppl> t,
                                         aterm.ATermAppl c)

clearAllInstances

public static void clearAllInstances(Taxonomy<?> t)

getAllInstances

public static <T,I> java.util.Set<I> getAllInstances(Taxonomy<T> t,
                                                     T c)
Retrieve all instances of a class (based on the current state of the taxonomy)

Parameters:
t - the taxonomy
c - the class
Returns:
a set of all individuals that are instances of the class

getDirectInstances

public static <T,I> java.util.Set<I> getDirectInstances(Taxonomy<T> t,
                                                        T c)
Retrieve direct instances of a class (based on current state of the taxonomy)

Parameters:
t - the taxonomy
c - the class
Returns:
a set of individuals that are instances of c and not instances of any class d where subClassOf(d,c)

getSuperExplanations

public static java.util.Set<java.util.Set<aterm.ATermAppl>> getSuperExplanations(Taxonomy<aterm.ATermAppl> t,
                                                                                 aterm.ATermAppl sub,
                                                                                 aterm.ATermAppl sup)

getTypes

public static <T> java.util.Set<java.util.Set<T>> getTypes(Taxonomy<T> t,
                                                           java.lang.Object ind,
                                                           boolean directOnly)
Get classes of which the individual is an instance (based on the current state of the taxonomy)

Parameters:
t - the taxonomy
ind - the individual
directOnly - true if only most specific classes are desired, false if all classes are desired
Returns:
a set of sets of classes where each inner set is a collection of equivalent classes

isType

public static boolean isType(Taxonomy<aterm.ATermAppl> t,
                             aterm.ATermAppl ind,
                             aterm.ATermAppl c)
Determine if an individual is an instance of a class (based on the current state of the taxonomy)

Parameters:
t - the taxonomy
ind - the individual
c - the class
Returns:
a boolean true if instanceOf(ind,c), false else


Copyright © 2004 Evren Sirin. All Rights Reserved.