Class 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
    • Constructor Summary

      Constructors 
      Constructor Description
      TaxonomyUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      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<openllet.aterm.ATermAppl>> getSuperExplanations​(Taxonomy<openllet.aterm.ATermAppl> t, openllet.aterm.ATermAppl sub, openllet.aterm.ATermAppl sup)  
      static <TClass,​TInd>
      java.util.Set<java.util.Set<TClass>>
      getTypes​(Taxonomy<TClass> t, TInd ind, boolean directOnly)
      Get classes of which the _individual is an instance (based on the _current state of the taxonomy)
      static boolean isType​(Taxonomy<openllet.aterm.ATermAppl> t, openllet.aterm.ATermAppl ind, openllet.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
    • Constructor Detail

      • TaxonomyUtils

        public TaxonomyUtils()
    • Method Detail

      • getSuperExplanations

        public static java.util.Set<java.util.Set<openllet.aterm.ATermAppl>> getSuperExplanations​(Taxonomy<openllet.aterm.ATermAppl> t,
                                                                                                  openllet.aterm.ATermAppl sub,
                                                                                                  openllet.aterm.ATermAppl sup)
        Parameters:
        t - is a taxonomy
        sub - classe
        sup - classe
        Returns:
        if only I know.
      • 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)
      • getTypes

        public static <TClass,​TInd> java.util.Set<java.util.Set<TClass>> getTypes​(Taxonomy<TClass> t,
                                                                                        TInd 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<openllet.aterm.ATermAppl> t,
                                     openllet.aterm.ATermAppl ind,
                                     openllet.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