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.
-
ontTrace
- show trace when loading onts?
-
OntManager()
- Constructs a new ontology manager with only the base ontology
loaded.
-
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.
-
getDefaultPrefix(String, String)
- Given an ontology id and version number, returns the default prefix
for it.
-
getDefaultUrl(String, String)
- Given an ontology id and version number, returns the default URL
for it.
-
getElement(String, String, String)
- Given an ontology id and version, and the name of an element in the
ontology, returns the corresponding SHOE element.
-
getElement(Unique_Elt)
- Given a SHOE element id, returns the corresponding SHOE element.
-
getKnownOntologies()
- Returns an enumeration of strings, where each is a label of an
ontology known to the system.
-
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.
-
getOntology(String, String)
- Retrieve an ontology based only on its id and version number.
-
getOntology(String, String, String)
- Retrieve an ontology based on its label and a suggested location.
-
getOntology(Use_Ontology)
- Returns the ontology that is described in the specified Use-Ontology
object.
-
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.
-
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.
-
loadOntProxyInputStream(InputStream)
- Loads a set of ontology proxies from an input stream.
-
putParentsInHashTable(Hashtable, Unique_Elt)
- Given a hashtable and a id of a Def_Category, adds each parent of
the category to the hashtable.
-
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.
-
setDefaultPrefix(String, String, String)
- Sets the default prefix for the given ontology id and version number
to the value specified by prefix.
-
setDefaultUrl(String, String, String)
- Sets the default url for the given ontology id and version number
to the value specified by url.
-
setOntProxy(String, String, String)
- Sets up a proxy URL to use when retrieving a particular ontology.
-
storeOntology(Ontology)
- Given an ontology, create a new record for it and stores it
in the index.
ontTrace
protected boolean ontTrace
- show trace when loading onts?
OntManager
public OntManager()
- Constructs a new ontology manager with only the base ontology
loaded.
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.
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.
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.
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.
getOntology
public Ontology getOntology(String id,
String version,
String url)
- Retrieve an ontology based on its label and a suggested location.
getOntology
public Ontology getOntology(Use_Ontology uont)
- Returns the ontology that is described in the specified Use-Ontology
object.
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.
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)
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)
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.
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.
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.
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.
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.
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.
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.
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.
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.
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