GATE
Version 3.1-2270

gate.creole.ontology
Interface Taxonomy

All Superinterfaces:
FeatureBearer, LanguageResource, NameBearer, Resource, Serializable
All Known Subinterfaces:
Ontology
All Known Implementing Classes:
JenaOntologyImpl, OntologyImpl, ProtegeProjectName, TaxonomyImpl

public interface Taxonomy
extends LanguageResource

Defines the interface of an ontology


Method Summary
 void addClass(TClass theClass)
          Adds a class to the ontology.
 boolean containsClassByName(String theName)
          Checks if the ontology contains a class with the given name.
 TClass createClass(String aName, String aComment)
          Creates a new OClass and returns it.
 boolean equals(Object o)
          Checks the equality of two ontologies.
 TClass getClassByName(String theName)
          Retrieves a class by its name.
 Set getClasses()
          Retrieves all classes as a set.
 Iterator getClasses(Comparator comp)
          Retireves an iterator over the classes, ordered according to the comparator.
 String getComment()
          Gets the comment of this ontology.
 String getDefaultNameSpace()
          Gets the default name space for this ontology.
 String getId()
          Gets the id of this ontology.
 String getLabel()
          Gets the label.
 int getTaxonomicDistance(TClass class1, TClass class2)
          Gets the taxonomic distance between 2 classes.
 Set getTopClasses()
          Gets the top classes.
 URL getURL()
          Gets the url of this ontology
 String getVersion()
          Gets the version of this ontology.
 boolean isDirectSubClassOf(String cls1, String cls2)
          Check for subclass relation with direct closure
 boolean isModified()
          Checks the modified flag.
 boolean isSubClassOf(String cls1, String cls2)
          Check for subclass relation with transitive closure
 void load()
          Loads this ontology.
 void removeClass(TClass theClass)
          Removes a class from this ontology.
 void setComment(String theComment)
          Sets the comment of this ontology.
 void setDefaultNameSpace(String theURI)
          Sets the URI of the ontology
 void setId(String theId)
          Sets the id of this ontology.
 void setLabel(String theLabel)
          Sets the label of the ontology.
 void setModified(boolean isModified)
          Sets the modified flag.
 void setURL(URL aUrl)
          Set the url of this ontology
 void setVersion(String theVersion)
          Sets version to this ontology.
 void store()
          Stores this ontology.
 
Methods inherited from interface gate.LanguageResource
getDataStore, getLRPersistenceId, getParent, setDataStore, setLRPersistenceId, setParent, sync
 
Methods inherited from interface gate.Resource
cleanup, getParameterValue, init, setParameterValue, setParameterValues
 
Methods inherited from interface gate.util.FeatureBearer
getFeatures, setFeatures
 
Methods inherited from interface gate.util.NameBearer
getName, setName
 

Method Detail

getLabel

String getLabel()
Gets the label.

Returns:
the label of the ontology

setLabel

void setLabel(String theLabel)
Sets the label of the ontology.

Parameters:
theLabel - the label to be set

getURL

URL getURL()
Gets the url of this ontology

Returns:
the url of this ontology

setURL

void setURL(URL aUrl)
Set the url of this ontology

Parameters:
aUrl - the url to be set

load

void load()
          throws ResourceInstantiationException
Loads this ontology. According to different storages - different implementations are expected. Should take care of the modifiedAfterLoading member

Throws:
ResourceInstantiationException

store

void store()
           throws ResourceInstantiationException
Stores this ontology. According to different storages - different implementations are expected. Should take care of the modifiedAfterLoading member

Throws:
ResourceInstantiationException

setDefaultNameSpace

void setDefaultNameSpace(String theURI)
Sets the URI of the ontology

Parameters:
theURI - the URI to be set

getDefaultNameSpace

String getDefaultNameSpace()
Gets the default name space for this ontology. This value is prepended to local URIs (the ones not containing '#'.

Returns:
a String value.

setVersion

void setVersion(String theVersion)
Sets version to this ontology.

Parameters:
theVersion - the version to be set

getVersion

String getVersion()
Gets the version of this ontology.

Returns:
the version of this ontology

getId

String getId()
Gets the id of this ontology.

Returns:
the id of this ontology

setId

void setId(String theId)
Sets the id of this ontology.

Parameters:
theId - the id to be set

getComment

String getComment()
Gets the comment of this ontology.

Returns:
the comment of this ontology

setComment

void setComment(String theComment)
Sets the comment of this ontology.

Parameters:
theComment - the comment to be set

createClass

TClass createClass(String aName,
                   String aComment)
Creates a new OClass and returns it.

Parameters:
aName - the name of this class
aComment - the comment of this class
Returns:
the newly created class

removeClass

void removeClass(TClass theClass)
Removes a class from this ontology.

Parameters:
theClass - the class to be removed

addClass

void addClass(TClass theClass)
Adds a class to the ontology.

Parameters:
theClass - the class to be added

getClassByName

TClass getClassByName(String theName)
Retrieves a class by its name.

Parameters:
theName - the name of the class
Returns:
the class matching the name or null if no matches.

containsClassByName

boolean containsClassByName(String theName)
Checks if the ontology contains a class with the given name.

Parameters:
theName - name of a class
Returns:
true if the ontology contains a class with the name specified

getClasses

Set getClasses()
Retrieves all classes as a set.

Returns:
set of all the classes in this ontology

getClasses

Iterator getClasses(Comparator comp)
Retireves an iterator over the classes, ordered according to the comparator.

Parameters:
comp - a comparator defining the order of iterating the classes
Returns:
an iterator over the classes

getTopClasses

Set getTopClasses()
Gets the top classes.

Returns:
set of the top classes of this ontology

getTaxonomicDistance

int getTaxonomicDistance(TClass class1,
                         TClass class2)
Gets the taxonomic distance between 2 classes.

Parameters:
class1 - the first class
class2 - the second class
Returns:
the taxonomic distance between the 2 classes

isSubClassOf

boolean isSubClassOf(String cls1,
                     String cls2)
Check for subclass relation with transitive closure

Parameters:
cls1 - the first class
cls2 - the second class

isDirectSubClassOf

boolean isDirectSubClassOf(String cls1,
                           String cls2)
Check for subclass relation with direct closure

Parameters:
cls1 - the first class
cls2 - the second class

equals

boolean equals(Object o)
Checks the equality of two ontologies.

Overrides:
equals in class Object
Parameters:
o - the other ontology
Returns:
true if the ontologies are considered equal, otherwise - false.

setModified

void setModified(boolean isModified)
Sets the modified flag.

Parameters:
isModified - sets this param as a value of the modified property of the ontology

isModified

boolean isModified()
Checks the modified flag.

Specified by:
isModified in interface LanguageResource
Returns:
whether the ontology has been modified after the loading

GATE
Version 3.1-2270