com.att.gs.codip.ograph.imp
Class OntologyManagerImp

java.lang.Object
  |
  +--com.att.gs.codip.ograph.imp.OntologyManagerImp
All Implemented Interfaces:
OntologyManager

public class OntologyManagerImp
extends java.lang.Object
implements OntologyManager

Ontology Manager


Constructor Summary
OntologyManagerImp()
           
OntologyManagerImp(java.lang.String theID)
           
OntologyManagerImp(java.lang.String theID, java.lang.String anOntoType)
          Creators and Initializers
 
Method Summary
 void addAlias(java.lang.String anAlias, OGOntology theOntology)
          Adds an alias for the supplied ontology.
 void addFacts(java.lang.Object theOntoURI, java.lang.Object theFactsURI)
          Not in public interface.
 void addOntology(OGOntology theOntology)
          Adds the provided ontology to the managed collection.
 void addParameter(java.lang.String theURI, java.lang.String aParameter, java.lang.Object aValue)
          Adds or replaces an ontology parameter.
 java.util.Iterator aliases()
          Provides an iterator over all aliases known by this manager.
 java.util.Iterator aliases(OGOntology theOntology)
          Provides an iterator over all aliases for the spefcified ontology that are known by this manager.
 boolean containsAlias(java.lang.String anAlias)
          Checks for the existence of an alias in this manager.
 boolean containsOntology(java.lang.Object theID)
          Checks for the existence of an ontology in the mananged colleciton whose ID matches the provided ID.
 OGOntology createOntology()
          Creates a new instance of an ontology with a generated unique URI.
 OGOntology createOntology(java.lang.String theURI)
          Loads or creates an ontology by URI.
 OGOntology createOntology(java.lang.String theURI, boolean forceReload)
          If forceReload is true will (re)load the ontology from the URI even if an existing instance is found.
 OGOntology getDAML()
          Getter method for the default core ontology provided by the ontology manager.
 java.lang.String getID()
          Getter method for the ID of this ontology manager.
 OGOntology getOntology(java.lang.Object theID)
          Looks for an ontology in the managed colleciton whose URI matches the provided URI.
 OGOntology getOWL()
          Getter method for the default core OWL ontology provided by the ontology manager.
 java.util.Map getParameters(java.lang.String theURI)
          Returns an ontology's parameter map.
 OGOntology getRDFS()
           
 java.lang.String getVersionInfo()
          Simple Access Methods.
 OGOntology getXSD()
          Getter method for the default core XML Schema Datatype ontology provided by the ontology manager.
 java.lang.String getXSLT()
          Getter method for the XSL Transform file URI.
protected  java.lang.String getXSLT(java.lang.String theURI)
           
 java.lang.String lookupAlias(java.lang.String anAlias)
          Looks up the URI of an alias in this manager.
 OGOntology lookupOntology(java.lang.Object theID)
          Looks for an existing instance the specified Ontology by ID.
 OGOntology lookupOntology(java.lang.Object theURI, boolean pCreate)
          Looks for, and possibilly loads, the specified Ontology by URI.
 java.lang.Object lookupParameter(java.lang.String theURI, java.lang.String aParameter)
          Looks up and returns an ontology's parameter value.
 void morphOntology(OGOntology theOntology, java.lang.String theURI)
          Morphs the provided ontology & updates the managed collection.
 java.util.Iterator ontologies()
          Provides a iterator for the ALL of the managed ontologies.
 void removeAlias(java.lang.String anAlias)
          Removes the supplied alias.
 void removeOntology(OGOntology theOntology)
          Removes the provided ontology from the managed collection.
 void removeParameter(java.lang.String theURI, java.lang.String aParameter)
          Removes an ontology's parameter.
 void setApplyToImports(boolean pTransform)
           
 void setXSLT(java.lang.String theXSLT)
          Setter method for the XSL Transform file URI.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OntologyManagerImp

public OntologyManagerImp(java.lang.String theID,
                          java.lang.String anOntoType)
Creators and Initializers


OntologyManagerImp

public OntologyManagerImp(java.lang.String theID)

OntologyManagerImp

public OntologyManagerImp()
Method Detail

getVersionInfo

public java.lang.String getVersionInfo()
Simple Access Methods.

Specified by:
getVersionInfo in interface OntologyManager
Returns:
The version information String.

getID

public java.lang.String getID()
Description copied from interface: OntologyManager
Getter method for the ID of this ontology manager. The ID is immutable after creation.

Specified by:
getID in interface OntologyManager
Returns:
The ID String.

getRDFS

public OGOntology getRDFS()

getDAML

public OGOntology getDAML()
Description copied from interface: OntologyManager
Getter method for the default core ontology provided by the ontology manager. It is a static singleton instance.

Specified by:
getDAML in interface OntologyManager
Returns:
The instance of the ontology.

getOWL

public OGOntology getOWL()
Description copied from interface: OntologyManager
Getter method for the default core OWL ontology provided by the ontology manager. It is a static singleton instance.

Specified by:
getOWL in interface OntologyManager
Returns:
The instance of the ontology.

getXSD

public OGOntology getXSD()
Description copied from interface: OntologyManager
Getter method for the default core XML Schema Datatype ontology provided by the ontology manager. It is a static singleton instance.

Specified by:
getXSD in interface OntologyManager
Returns:
The instance of the XSD ontology.

getXSLT

public java.lang.String getXSLT()
Description copied from interface: OntologyManager
Getter method for the XSL Transform file URI. The transform is applied to ontology files by the ontology manager before the ontology is parsed. A null string indicates no transform. The default is no transform.

Specified by:
getXSLT in interface OntologyManager
Returns:
The XSL file URI, or null for no transform.

getXSLT

protected java.lang.String getXSLT(java.lang.String theURI)

setXSLT

public void setXSLT(java.lang.String theXSLT)
Description copied from interface: OntologyManager
Setter method for the XSL Transform file URI. The transform is applied to ontology files by the ontology manager before the ontology is parsed. A null string indicates no transform. The default is no transform.

Specified by:
setXSLT in interface OntologyManager

setApplyToImports

public void setApplyToImports(boolean pTransform)
Specified by:
setApplyToImports in interface OntologyManager

lookupOntology

public OGOntology lookupOntology(java.lang.Object theID)
Description copied from interface: OntologyManager
Looks for an existing instance the specified Ontology by ID. The ID can be either a URI or an alias. First the manged collection is searched by URI. If a matching ontology is found it is returned. Then the colleciotn is search by alias. Again, if a matchin ontology is found it is return.

Specified by:
lookupOntology in interface OntologyManager
Parameters:
theID - The ID of the sought ontology.
Returns:
The matching ontology if found, otherwise returns void.

lookupOntology

public OGOntology lookupOntology(java.lang.Object theURI,
                                 boolean pCreate)
Description copied from interface: OntologyManager
Looks for, and possibilly loads, the specified Ontology by URI. Searches for the onlology whose URI matches the provided URI. Will atempt to load a new instance with the appropriate URI if none exists. Aliases are used however, the URI must be a valid URL for the ontology to be created.

Specified by:
lookupOntology in interface OntologyManager
Parameters:
pCreate - true causes a new instance to be created if no existing match is found.
Returns:
The matching Ontology if found or created, otherwise returns void.

createOntology

public OGOntology createOntology()
Description copied from interface: OntologyManager
Creates a new instance of an ontology with a generated unique URI. The created ontology is empty. It is identified by a unique URI.

Specified by:
createOntology in interface OntologyManager
Returns:
The Ontology if created, otherwise returns null.

createOntology

public OGOntology createOntology(java.lang.String theURI)
Description copied from interface: OntologyManager
Loads or creates an ontology by URI. Searches first for an onlology whose ID matches the provided URI, if no match is found a new instance is created and/or loaded. If a match is found, null is returned. Note that the URI must be a valid URL for the ontology to be loaded.

Specified by:
createOntology in interface OntologyManager
Parameters:
theURI - The URI of the new ontology.
Returns:
The matching ontology if loaded or created, otherwise returns null.

createOntology

public OGOntology createOntology(java.lang.String theURI,
                                 boolean forceReload)
Description copied from interface: OntologyManager
If forceReload is true will (re)load the ontology from the URI even if an existing instance is found. Otherwise, behaves identically to createOntology(String theURI);

Specified by:
createOntology in interface OntologyManager
Parameters:
forceReload - If true forces the ontology to be reload from the URI.
Returns:
The matching ontology if found or created, otherwise returns void.

addFacts

public void addFacts(java.lang.Object theOntoURI,
                     java.lang.Object theFactsURI)
Not in public interface.


addOntology

public void addOntology(OGOntology theOntology)
Description copied from interface: OntologyManager
Adds the provided ontology to the managed collection. The provided ontology instance is added only if there is not a currently managed instance with the same URI.

Specified by:
addOntology in interface OntologyManager
Parameters:
theOntology - The ontology instance to add to the collection.

morphOntology

public void morphOntology(OGOntology theOntology,
                          java.lang.String theURI)
Description copied from interface: OntologyManager
Morphs the provided ontology & updates the managed collection. When the ontology is morphed any references to the old URI should be updated to the new URI.

Specified by:
morphOntology in interface OntologyManager
Parameters:
theOntology - The ontology to remove from the collection.

removeOntology

public void removeOntology(OGOntology theOntology)
Description copied from interface: OntologyManager
Removes the provided ontology from the managed collection. When the ontology is removed from the managed colleciton, all aliases refering to it and all other interanl reference to it are also removed. The removed ontology may be garbage collected if no other references exist.

Specified by:
removeOntology in interface OntologyManager
Parameters:
theOntology - The ontology to remove from the collection.

getOntology

public OGOntology getOntology(java.lang.Object theID)
Description copied from interface: OntologyManager
Looks for an ontology in the managed colleciton whose URI matches the provided URI. The ontology manager assumes that ontologies are uniquely identified by their URI and therefore maintains a static colletion of ontologies with the URI as key.

Specified by:
getOntology in interface OntologyManager
Parameters:
theID - The URI of the sought ontology.
Returns:
The matching ontology if found, otherwise returns null.

containsOntology

public boolean containsOntology(java.lang.Object theID)
Description copied from interface: OntologyManager
Checks for the existence of an ontology in the mananged colleciton whose ID matches the provided ID.

Specified by:
containsOntology in interface OntologyManager
Parameters:
theID - The ID of the sought ontology.
Returns:
true if the ontology exists in this collection.

ontologies

public java.util.Iterator ontologies()
Description copied from interface: OntologyManager
Provides a iterator for the ALL of the managed ontologies.

Specified by:
ontologies in interface OntologyManager
Returns:
An iterator over all the ontologies.

lookupAlias

public java.lang.String lookupAlias(java.lang.String anAlias)
Description copied from interface: OntologyManager
Looks up the URI of an alias in this manager.

Specified by:
lookupAlias in interface OntologyManager
Parameters:
anAlias - The alias string.
Returns:
The URI of the aliased ontology, or null.

containsAlias

public boolean containsAlias(java.lang.String anAlias)
Description copied from interface: OntologyManager
Checks for the existence of an alias in this manager.

Specified by:
containsAlias in interface OntologyManager
Parameters:
anAlias - The alias string.
Returns:
true if the alias exists.

addAlias

public void addAlias(java.lang.String anAlias,
                     OGOntology theOntology)
Description copied from interface: OntologyManager
Adds an alias for the supplied ontology.

Specified by:
addAlias in interface OntologyManager
Parameters:
anAlias - The alias string.
theOntology - The ontology refered to by the alias string.

removeAlias

public void removeAlias(java.lang.String anAlias)
Description copied from interface: OntologyManager
Removes the supplied alias.

Specified by:
removeAlias in interface OntologyManager
Parameters:
anAlias - The alias string.

aliases

public java.util.Iterator aliases()
Description copied from interface: OntologyManager
Provides an iterator over all aliases known by this manager.

Specified by:
aliases in interface OntologyManager
Returns:
The iterator.

aliases

public java.util.Iterator aliases(OGOntology theOntology)
Description copied from interface: OntologyManager
Provides an iterator over all aliases for the spefcified ontology that are known by this manager.

Specified by:
aliases in interface OntologyManager
Returns:
The iterator.

getParameters

public java.util.Map getParameters(java.lang.String theURI)
Description copied from interface: OntologyManager
Returns an ontology's parameter map.

Specified by:
getParameters in interface OntologyManager
Parameters:
theURI - The URI of the ontology.
Returns:
a Map object containing the parameters for the ontology.

lookupParameter

public java.lang.Object lookupParameter(java.lang.String theURI,
                                        java.lang.String aParameter)
Description copied from interface: OntologyManager
Looks up and returns an ontology's parameter value.

Specified by:
lookupParameter in interface OntologyManager
Parameters:
theURI - The URI of the ontology.
aParameter - The name of the parameter.
Returns:
The value of the parameter for the ontology.

addParameter

public void addParameter(java.lang.String theURI,
                         java.lang.String aParameter,
                         java.lang.Object aValue)
Description copied from interface: OntologyManager
Adds or replaces an ontology parameter.

Specified by:
addParameter in interface OntologyManager
Parameters:
theURI - The URI of the ontology.
aParameter - The name of the parameter to add or update.
aValue - The new value of the parameter.

removeParameter

public void removeParameter(java.lang.String theURI,
                            java.lang.String aParameter)
Description copied from interface: OntologyManager
Removes an ontology's parameter.

Specified by:
removeParameter in interface OntologyManager
Parameters:
theURI - The URI of the ontology.
aParameter - The name of the parameter to remove.


CODIP AT&T Government Solutions, Inc.