Package openllet.core.taxonomy
Class TaxonomyUtils
- java.lang.Object
-
- openllet.core.taxonomy.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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
TaxonomyUtils.TaxonomyKey
-
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)
-
-
-
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 taxonomysub
- classesup
- 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 taxonomyc
- 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 taxonomyc
- the class- Returns:
- a set of individuals that are instances of
c
and not instances of any classd
wheresubClassOf(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 taxonomyind
- the _individualdirectOnly
-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 taxonomyind
- the _individualc
- the class- Returns:
- a boolean
true
ifinstanceOf(ind,c)
,false
else
-
-