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.


Variable Index

 o parseErrs

Constructor Index

 o Ontology(SGML_Tag)
Creates a new ontology and initializes it using the information provided in the given SGML tag.
 o Ontology(String, String)
Creates a new ontology with the given id and version number.
 o 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.

Method Index

 o addElement(SHOE_Obj)
Adds the definition of an ontology element to the ontology.
 o addInference(Def_Inference)
Add an inference rule to the ontology.
 o addUseOnt(Use_Ontology)
Adds a Use-Ontology to the ontology.
 o getBackCompatString()
Return the string that consists of a whitespace separated list of versions with which this ontology is backward compatible.
 o getDeclaratorsString()
Return the string that consists of a whitespace separated list of the instances that make special declarations for this ontology.
 o getDescription()
Return the description of the ontology.
 o getElement(String)
Returns the ontology object (i.e., Def_Category, Def_Relation, Def_Const, Def_Type, or Def_Rename) that has the given name.
 o getElements()
Returns an enumeration of the ontology elements in an arbitrary order.
 o getId()
Returns the id of the ontology.
 o getInferenceRules()
Returns the inference rules stated for the ontology.
 o getKey()
Returns a unique identifier for the ontology.
 o getLabeledCategoryTreeLists(OntManager)
Returns the set of category hierarchies defined in the ontology as an enumeration.
 o 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.
 o getOntLabel()
Returns a label suitable for identifying the ontology to a human reader.
 o getParseErrors()
Retrieves error messages for this ontology and concatenate into a single string.
 o getRelations()
Returns an enumeration of all DEF_RELATIONs in the ontology
 o getSortedElements()
Returns an enumeration of the ontology elements in sorted order.
 o getTopLevelCategories()
Returns the set of Def-Categories and Def-Renames of Def-Categories that constitute the most abstract categories defined in the ontology.
 o getURL()
Returns the URL that has been assigned to this ontology.
 o getUseOnt(String)
Given a prefix, returns the Use-Ontology statement which identifies the ontology referenced by the prefix.
 o getUseOnts()
Returns an enumeration of the Use_Ontology objects which represent the ontologies included in this ontology.
 o getUseOntTreeList(OntManager)
Returns the set of use ontologies that occur within the ontology.
 o getVersion()
Returns the version number of the ontology.
 o getVersionsCompatibleWith()
Return an array of version numbers with which this version is backward compatible.
 o hasParseErrors()
Returns true if errors when encountered while parsing the ontology.
 o makeKey(String, String)
Creates a unique key for an ontology from its id and version number.
 o printSGML(PrintStream)
Writes the ontology and its components to the given print stream in SGML format.
 o readSubTags(HTML_Tokenizer)
Reads and processes the tokens from an HTML_Tokenizer until a closing ontology tag is encountered.
 o setURL(String)
Sets the URL where the ontology was retrieved from.
 o toString()
Returns a string consisting of the corresponding open tag for the ontology.
 o validate(SHOE_Obj, OntManager)
Checks the ontology for reference errors.

Variables

 o parseErrs
 protected Vector parseErrs

Constructors

 o Ontology
 public Ontology(String id,
                 String version)
Creates a new ontology with the given id and version number.

 o 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.

 o Ontology
 public Ontology(SGML_Tag sgmltag)
Creates a new ontology and initializes it using the information provided in the given SGML tag.

Methods

 o 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.

 o getKey
 public String getKey()
Returns a unique identifier for the ontology.

Overrides:
getKey in class SHOE_Obj
 o getId
 public String getId()
Returns the id of the ontology.

 o getVersion
 public String getVersion()
Returns the version number of the ontology.

 o getOntLabel
 public String getOntLabel()
Returns a label suitable for identifying the ontology to a human reader.

 o getDescription
 public String getDescription()
Return the description of the ontology.

 o getVersionsCompatibleWith
 public String[] getVersionsCompatibleWith()
Return an array of version numbers with which this version is backward compatible.

 o getBackCompatString
 public String getBackCompatString()
Return the string that consists of a whitespace separated list of versions with which this ontology is backward compatible.

 o getDeclaratorsString
 public String getDeclaratorsString()
Return the string that consists of a whitespace separated list of the instances that make special declarations for this ontology.

 o getUseOnts
 public Enumeration getUseOnts()
Returns an enumeration of the Use_Ontology objects which represent the ontologies included in this ontology.

 o getElements
 public Enumeration getElements()
Returns an enumeration of the ontology elements in an arbitrary order.

 o getSortedElements
 public Enumeration getSortedElements()
Returns an enumeration of the ontology elements in sorted order.

 o getRelations
 public Enumeration getRelations()
Returns an enumeration of all DEF_RELATIONs in the ontology

 o getInferenceRules
 public Vector getInferenceRules()
Returns the inference rules stated for the ontology.

 o 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.

 o 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.

 o 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.

 o 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.

 o setURL
 protected void setURL(String url)
Sets the URL where the ontology was retrieved from.

 o getUseOnt
 public Use_Ontology getUseOnt(String prefix)
Given a prefix, returns the Use-Ontology statement which identifies the ontology referenced by the prefix.

 o 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.

 o 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.

 o 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.

 o addInference
 public void addInference(Def_Inference inf)
Add an inference rule to the ontology.

 o 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
 o 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.

 o hasParseErrors
 public boolean hasParseErrors()
Returns true if errors when encountered while parsing the ontology.

 o getParseErrors
 public String getParseErrors()
Retrieves error messages for this ontology and concatenate into a single string.

 o 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
 o toString
 public String toString()
Returns a string consisting of the corresponding open tag for the ontology.

Overrides:
toString in class Object
 o 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