All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class SHOE.OntManager

java.lang.Object
   |
   +----SHOE.OntManager

public class OntManager
extends Object
A layer that caches ontologies so that they do not always have to be re-loaded from the web. The base-ontology is automatically loaded.


Variable Index

 o ontTrace
show trace when loading onts?

Constructor Index

 o OntManager()
Constructs a new ontology manager with only the base ontology loaded.

Method Index

 o getAncestorHashtable(Unique_Elt)
Returns a hashtable consisting of the ids of all categories (including those in other ontologies) of which the input argument is a sub-category.
 o getDefaultPrefix(String, String)
Given an ontology id and version number, returns the default prefix for it.
 o getDefaultUrl(String, String)
Given an ontology id and version number, returns the default URL for it.
 o getElement(String, String, String)
Given an ontology id and version, and the name of an element in the ontology, returns the corresponding SHOE element.
 o getElement(Unique_Elt)
Given a SHOE element id, returns the corresponding SHOE element.
 o getKnownOntologies()
Returns an enumeration of strings, where each is a label of an ontology known to the system.
 o getOntology(String)
Retrieve an ontology based only on its label string (this has a format of "[id], v.[version]").This can only be used if the system has previously loaded the ontology or it knows where to locate it.
 o getOntology(String, String)
Retrieve an ontology based only on its id and version number.
 o getOntology(String, String, String)
Retrieve an ontology based on its label and a suggested location.
 o getOntology(Use_Ontology)
Returns the ontology that is described in the specified Use-Ontology object.
 o getRelsByArgType(Ontology, Unique_Elt, int)
Returns a list of Def-Relations in the ont ontology in which argument position argPos can be legally filled by the category identified by elmt_id.
 o isSubcategoryOf(Unique_Elt, Unique_Elt)
Determines if the category identified by the first element id is a subcategory of the one identified by the second.
 o loadOntProxyInputStream(InputStream)
Loads a set of ontology proxies from an input stream.
 o putParentsInHashTable(Hashtable, Unique_Elt)
Given a hashtable and a id of a Def_Category, adds each parent of the category to the hashtable.
 o resolveName(String, SHOE_Obj)
Given a prefixed name and a reference object in which it appears, follows the prefixes to determine the originating ontology and version for the named object, and uses this to construct and return a unique identifier for it.
 o setDefaultPrefix(String, String, String)
Sets the default prefix for the given ontology id and version number to the value specified by prefix.
 o setDefaultUrl(String, String, String)
Sets the default url for the given ontology id and version number to the value specified by url.
 o setOntProxy(String, String, String)
Sets up a proxy URL to use when retrieving a particular ontology.
 o storeOntology(Ontology)
Given an ontology, create a new record for it and stores it in the index.

Variables

 o ontTrace
 protected boolean ontTrace
show trace when loading onts?

Constructors

 o OntManager
 public OntManager()
Constructs a new ontology manager with only the base ontology loaded.

Methods

 o setOntProxy
 public void setOntProxy(String id,
                         String version,
                         String proxy)
Sets up a proxy URL to use when retrieving a particular ontology. This is particularly useful if the OntManager is being used when there is no internet connection or a mirror site has been set up for the ontology.

 o loadOntProxyInputStream
 public String loadOntProxyInputStream(InputStream inStream)
Loads a set of ontology proxies from an input stream. Each line must be a white-space delimited list of ontology id, version and a proxy URL for retrieving it. If there are any error messages, they are concatenated and returned as a String.

 o getOntology
 public Ontology getOntology(String label)
Retrieve an ontology based only on its label string (this has a format of "[id], v.[version]").This can only be used if the system has previously loaded the ontology or it knows where to locate it.

 o getOntology
 public Ontology getOntology(String id,
                             String version)
Retrieve an ontology based only on its id and version number. This can only be used if the system has previously loaded the ontology or it knows where to locate it.

 o getOntology
 public Ontology getOntology(String id,
                             String version,
                             String url)
Retrieve an ontology based on its label and a suggested location.

 o getOntology
 public Ontology getOntology(Use_Ontology uont)
Returns the ontology that is described in the specified Use-Ontology object.

 o getKnownOntologies
 public Enumeration getKnownOntologies()
Returns an enumeration of strings, where each is a label of an ontology known to the system. Currently, a known ontology is one that has been parsed or has a proxy assigned to it.

 o getElement
 public SHOE_Obj getElement(String ontId,
                            String ontVer,
                            String name)
Given an ontology id and version, and the name of an element in the ontology, returns the corresponding SHOE element. (A element is a Def-Category, Def-Relation, Def-Constant, Def-Rename, or Def-Type)

 o getElement
 public SHOE_Obj getElement(Unique_Elt elmt_id)
Given a SHOE element id, returns the corresponding SHOE element. (A element is a Def-Category, Def-Relation, Def-Constant, Def-Rename, or Def-Type)

 o getDefaultUrl
 public String getDefaultUrl(String id,
                             String version)
Given an ontology id and version number, returns the default URL for it. The default URL is the location where the ontology was opened from, or a location specified by the user.

 o getDefaultPrefix
 public String getDefaultPrefix(String id,
                                String version)
Given an ontology id and version number, returns the default prefix for it. The default prefix is the prefix that was specified by the the user at some earlier point in time.

 o setDefaultUrl
 public void setDefaultUrl(String id,
                           String version,
                           String url)
Sets the default url for the given ontology id and version number to the value specified by url.

 o setDefaultPrefix
 public void setDefaultPrefix(String id,
                              String version,
                              String prefix)
Sets the default prefix for the given ontology id and version number to the value specified by prefix.

 o storeOntology
 public void storeOntology(Ontology ont)
Given an ontology, create a new record for it and stores it in the index. If there is already a record, but the ontology has not been loaded, then updates the record to reflect the loading of the ontology.

 o isSubcategoryOf
 public boolean isSubcategoryOf(Unique_Elt childId,
                                Unique_Elt parId)
Determines if the category identified by the first element id is a subcategory of the one identified by the second. Returns true or false. This routine performs a breadth-first search with the child as the start state and the parent as the goal.

 o resolveName
 public Unique_Elt resolveName(String name,
                               SHOE_Obj refObj) throws SHOEException
Given a prefixed name and a reference object in which it appears, follows the prefixes to determine the originating ontology and version for the named object, and uses this to construct and return a unique identifier for it.

 o getRelsByArgType
 public Vector getRelsByArgType(Ontology ont,
                                Unique_Elt elmt_id,
                                int argPos)
Returns a list of Def-Relations in the ont ontology in which argument position argPos can be legally filled by the category identified by elmt_id.

 o putParentsInHashTable
 public void putParentsInHashTable(Hashtable ancestors,
                                   Unique_Elt catId)
Given a hashtable and a id of a Def_Category, adds each parent of the category to the hashtable. Duplicates are not added. This method supports getAncestorHashtable.

 o getAncestorHashtable
 public Hashtable getAncestorHashtable(Unique_Elt elmt_id)
Returns a hashtable consisting of the ids of all categories (including those in other ontologies) of which the input argument is a sub-category. The input should be a Def_Category, Def_Constant or a rename of one. If the input is a Def_Category, it is included in the results.


All Packages  Class Hierarchy  This Package  Previous  Next  Index