All Packages Class Hierarchy This Package Previous Next Index
Class SHOE.Ontology
java.lang.Object
|
+----SHOE.SHOE_Obj
|
+----SHOE.Ontology
- public class Ontology
- extends SHOE_Obj
A SHOE ontology. Methods are provided to read the ontology from a
SHOE document, to write it back out, and to manipulate an intermediate
data structure.
-
parseErrs
-
-
Ontology(SGML_Tag)
- Creates a new ontology and initializes it using the information
provided in the given SGML tag.
-
Ontology(String, String)
- Creates a new ontology with the given id and version number.
-
Ontology(String, String, Vector, String, Vector)
- Creates a new ontology with the given id, version number,
set of versions it is backward-compatible with, description,
and set of instances that make declarations for it.
-
addElement(SHOE_Obj)
- Adds the definition of an ontology element to the ontology.
-
addInference(Def_Inference)
- Add an inference rule to the ontology.
-
addUseOnt(Use_Ontology)
- Adds a Use-Ontology to the ontology.
-
getBackCompatString()
- Return the string that consists of a whitespace separated list of
versions with which this ontology is backward compatible.
-
getDeclaratorsString()
- Return the string that consists of a whitespace separated list of
the instances that make special declarations for this ontology.
-
getDescription()
- Return the description of the ontology.
-
getElement(String)
- Returns the ontology object (i.e., Def_Category, Def_Relation,
Def_Const, Def_Type, or Def_Rename) that has the given name.
-
getElements()
- Returns an enumeration of the ontology elements in an arbitrary
order.
-
getId()
- Returns the id of the ontology.
-
getInferenceRules()
- Returns the inference rules stated for the ontology.
-
getKey()
- Returns a unique identifier for the ontology.
-
getLabeledCategoryTreeLists(OntManager)
- Returns the set of category hierarchies defined in the ontology
as an enumeration.
-
getLabeledDescendantTree(SHOE_Obj, OntManager)
- Returns a tree of the the category hierarchy rooted at the chosen
Def-Category, where each node has a label representing the local
name of the category as well as the category object.
-
getOntLabel()
- Returns a label suitable for identifying the ontology to a
human reader.
-
getParseErrors()
- Retrieves error messages for this ontology and concatenate into a
single string.
-
getRelations()
- Returns an enumeration of all DEF_RELATIONs in the ontology
-
getSortedElements()
- Returns an enumeration of the ontology elements in sorted order.
-
getTopLevelCategories()
- Returns the set of Def-Categories and Def-Renames of Def-Categories
that constitute the most abstract categories defined in the ontology.
-
getURL()
- Returns the URL that has been assigned to this ontology.
-
getUseOnt(String)
- Given a prefix, returns the Use-Ontology statement which
identifies the ontology referenced by the prefix.
-
getUseOnts()
- Returns an enumeration of the Use_Ontology objects which represent
the ontologies included in this ontology.
-
getUseOntTreeList(OntManager)
- Returns the set of use ontologies that occur within the ontology.
-
getVersion()
- Returns the version number of the ontology.
-
getVersionsCompatibleWith()
- Return an array of version numbers with which this version is
backward compatible.
-
hasParseErrors()
- Returns true if errors when encountered while parsing the
ontology.
-
makeKey(String, String)
- Creates a unique key for an ontology from its id and version
number.
-
printSGML(PrintStream)
- Writes the ontology and its components to the given print
stream in SGML format.
-
readSubTags(HTML_Tokenizer)
- Reads and processes the tokens from an HTML_Tokenizer until
a closing ontology tag is encountered.
-
setURL(String)
- Sets the URL where the ontology was retrieved from.
-
toString()
- Returns a string consisting of the corresponding open tag for
the ontology.
-
validate(SHOE_Obj, OntManager)
- Checks the ontology for reference errors.
parseErrs
protected Vector parseErrs
Ontology
public Ontology(String id,
String version)
- Creates a new ontology with the given id and version number.
Ontology
public Ontology(String id,
String version,
Vector back_compatible,
String description,
Vector declarators)
- Creates a new ontology with the given id, version number,
set of versions it is backward-compatible with, description,
and set of instances that make declarations for it.
Ontology
public Ontology(SGML_Tag sgmltag)
- Creates a new ontology and initializes it using the information
provided in the given SGML tag.
makeKey
public static String makeKey(String id,
String version)
- Creates a unique key for an ontology from its id and version
number. Currently, this key is the concatenation of the version and
the id. The version is used first to ensure it is used in
the standard string hashing function.
getKey
public String getKey()
- Returns a unique identifier for the ontology.
- Overrides:
- getKey in class SHOE_Obj
getId
public String getId()
- Returns the id of the ontology.
getVersion
public String getVersion()
- Returns the version number of the ontology.
getOntLabel
public String getOntLabel()
- Returns a label suitable for identifying the ontology to a
human reader.
getDescription
public String getDescription()
- Return the description of the ontology.
getVersionsCompatibleWith
public String[] getVersionsCompatibleWith()
- Return an array of version numbers with which this version is
backward compatible.
getBackCompatString
public String getBackCompatString()
- Return the string that consists of a whitespace separated list of
versions with which this ontology is backward compatible.
getDeclaratorsString
public String getDeclaratorsString()
- Return the string that consists of a whitespace separated list of
the instances that make special declarations for this ontology.
getUseOnts
public Enumeration getUseOnts()
- Returns an enumeration of the Use_Ontology objects which represent
the ontologies included in this ontology.
getElements
public Enumeration getElements()
- Returns an enumeration of the ontology elements in an arbitrary
order.
getSortedElements
public Enumeration getSortedElements()
- Returns an enumeration of the ontology elements in sorted order.
getRelations
public Enumeration getRelations()
- Returns an enumeration of all DEF_RELATIONs in the ontology
getInferenceRules
public Vector getInferenceRules()
- Returns the inference rules stated for the ontology.
getUseOntTreeList
public Vector getUseOntTreeList(OntManager ontman)
- Returns the set of use ontologies that occur within the ontology.
Each use ontology is the root of a tree where children in the
tree represent use ontologies that occur in the ontology referenced
by the parent use ontology. Each node consists of a Use-Ontology
object and a label that is the prefix chain to reach that object.
getLabeledCategoryTreeLists
public Enumeration getLabeledCategoryTreeLists(OntManager ontman)
- Returns the set of category hierarchies defined in the ontology
as an enumeration. Each hierarchy is a tree with nodes that consist
of the local name as a label and the original Def_Category as a
user object.
getLabeledDescendantTree
public DefaultTreeModel getLabeledDescendantTree(SHOE_Obj obj,
OntManager ontman)
- Returns a tree of the the category hierarchy rooted at the chosen
Def-Category, where each node has a label representing the local
name of the category as well as the category object. The children
are stored in sorted order by key.
getURL
public String getURL()
- Returns the URL that has been assigned to this ontology. This
method is used in error handling to help identify the file involved.
setURL
protected void setURL(String url)
- Sets the URL where the ontology was retrieved from.
getUseOnt
public Use_Ontology getUseOnt(String prefix)
- Given a prefix, returns the Use-Ontology statement which
identifies the ontology referenced by the prefix.
getElement
public SHOE_Obj getElement(String name)
- Returns the ontology object (i.e., Def_Category, Def_Relation,
Def_Const, Def_Type, or Def_Rename) that has the given name.
addUseOnt
public void addUseOnt(Use_Ontology uont) throws DupeKeyException
- Adds a Use-Ontology to the ontology. If the prefix to be
assigned to referenced ontology is already in used, then an
exception is thrown.
addElement
public void addElement(SHOE_Obj obj) throws DupeKeyException
- Adds the definition of an ontology element to the ontology.
If the name of the element is already used by another object
in the ontology, an exception is thrown.
addInference
public void addInference(Def_Inference inf)
- Add an inference rule to the ontology.
readSubTags
public Vector readSubTags(HTML_Tokenizer intokens)
- Reads and processes the tokens from an HTML_Tokenizer until
a closing ontology tag is encountered. Parse errors are
permanently stored with the ontology in parseErrs.
- Overrides:
- readSubTags in class SHOE_Obj
validate
public Vector validate(SHOE_Obj parent,
OntManager ontman)
- Checks the ontology for reference errors. These are permanently stored
in the parseErrs vector. Also initializes the set of top-level
categories defined in the ontology.
hasParseErrors
public boolean hasParseErrors()
- Returns true if errors when encountered while parsing the
ontology.
getParseErrors
public String getParseErrors()
- Retrieves error messages for this ontology and concatenate into a
single string.
printSGML
public void printSGML(PrintStream out)
- Writes the ontology and its components to the given print
stream in SGML format.
- Overrides:
- printSGML in class SHOE_Obj
toString
public String toString()
- Returns a string consisting of the corresponding open tag for
the ontology.
- Overrides:
- toString in class Object
getTopLevelCategories
public Enumeration getTopLevelCategories()
- Returns the set of Def-Categories and Def-Renames of Def-Categories
that constitute the most abstract categories defined in the ontology.
This set can be used as root nodes for trees of the category
hierarchy defined by this ontology. This set will be null until
the validate() method has been executed. Returns an enumeration
of SHOE_Obj's.
All Packages Class Hierarchy This Package Previous Next Index