|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectgate.util.AbstractFeatureBearer
gate.creole.AbstractResource
gate.creole.AbstractLanguageResource
com.ontotext.gate.ontology.TaxonomyImpl
An Ontology Implementation Class
| Field Summary | |
private Set |
classes
|
private Map |
classesByName
|
private String |
comment
|
static byte |
DIRECT_CLOSURE
denotes a direct closure(no transitivity) |
private String |
id
|
private String |
label
|
protected long |
lastGeneratedId
|
private static Set |
listeners
Object Modification Listeners |
protected boolean |
modified
Whether the ontology has been modified after loading. |
private String |
name
|
protected boolean |
nullBuffers
Whether the ontology has been modified switches to true when null-ing and reinfering the subclasses and super classes and tops |
private String |
sourceURI
|
private Set |
tops
|
static byte |
TRANSITIVE_CLOSURE
denotes atransitive closure |
private URL |
url
|
private String |
version
|
| Fields inherited from class gate.creole.AbstractLanguageResource |
dataStore, lrPersistentId |
| Fields inherited from class gate.creole.AbstractResource |
|
| Fields inherited from class gate.util.AbstractFeatureBearer |
features |
| Constructor Summary | |
TaxonomyImpl()
|
|
| Method Summary | |
void |
addClass(TClass theClass)
Adds a class to the ontology. |
static void |
addObjectModificationListener(ObjectModificationListener listener)
Adds an object modification listener. |
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. |
private void |
determineTops()
|
boolean |
equals(Object o)
Compares the id,uri and url of the ontology. |
protected static void |
fireObjectModificationEvent(Object source)
Fires an object modification event. |
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 |
getId()
Gets the id of this ontology. |
String |
getLabel()
Retrieves the label of the ontology |
Taxonomy |
getOntology(URL someUrl)
Gets taxonomy by URL. |
String |
getSourceURI()
Gets the source URI. |
int |
getTaxonomicDistance(TClass class1,
TClass class2)
calculates the taxonomic distance between two classes. |
Set |
getTopClasses()
Gets the top classes. |
URL |
getURL()
Gets the url of this ontology |
String |
getVersion()
Gets the version of this ontology. |
Resource |
init()
Initialises this resource, and returns it. |
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. |
protected void |
reinfer()
Called when the ontology has been modified to re-infer all sub/super classes, tops, etc. |
void |
removeClass(TClass theClass)
note: if a class is deleted and there aresome subclasses of this class which lack any other super classes : then they become top classes. |
void |
setComment(String theComment)
Sets the comment of this 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 |
setSourceURI(String theURI)
Sets the URI of the ontology |
void |
setURL(URL aUrl)
Set the url of this ontology |
void |
setVersion(String theVersion)
Sets version to this ontology. |
void |
store()
Stores this ontology. |
String |
toString()
|
| Methods inherited from class gate.creole.AbstractLanguageResource |
cleanup, getDataStore, getLRPersistenceId, getParent, setDataStore, setLRPersistenceId, setParent, sync |
| Methods inherited from class gate.creole.AbstractResource |
checkParameterValues, getBeanInfo, getName, getParameterValue, getParameterValue, removeResourceListeners, setName, setParameterValue, setParameterValue, setParameterValues, setParameterValues, setResourceListeners |
| Methods inherited from class gate.util.AbstractFeatureBearer |
getFeatures, setFeatures |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface gate.LanguageResource |
getDataStore, getLRPersistenceId, getParent, setDataStore, setLRPersistenceId, setParent, sync |
| Methods inherited from interface gate.Resource |
cleanup, getParameterValue, setParameterValue, setParameterValues |
| Methods inherited from interface gate.util.FeatureBearer |
getFeatures, setFeatures |
| Methods inherited from interface gate.util.NameBearer |
getName, setName |
| Field Detail |
public static final byte DIRECT_CLOSURE
public static final byte TRANSITIVE_CLOSURE
private static Set listeners
private String label
private URL url
private String sourceURI
private String version
private String id
private String comment
private Map classesByName
private Set classes
private Set tops
private String name
protected long lastGeneratedId
protected boolean nullBuffers
protected boolean modified
| Constructor Detail |
public TaxonomyImpl()
| Method Detail |
public static void addObjectModificationListener(ObjectModificationListener listener)
listener - listener to be added.protected static void fireObjectModificationEvent(Object source)
public Taxonomy getOntology(URL someUrl)
throws ResourceInstantiationException
Taxonomy
getOntology in interface TaxonomysomeUrl - the url of the taxonomy
ResourceInstantiationException - if something gets wrong with the loading
public Resource init()
throws ResourceInstantiationException
init in interface Resourceinit in class AbstractResourceResourceInstantiationExceptionpublic URL getURL()
Taxonomy
getURL in interface Taxonomypublic void setURL(URL aUrl)
Taxonomy
setURL in interface TaxonomyaUrl - the url to be setpublic void setLabel(String theLabel)
setLabel in interface TaxonomytheLabel - the label to be setpublic String getLabel()
getLabel in interface Taxonomy
public void load()
throws ResourceInstantiationException
Taxonomy
load in interface TaxonomyResourceInstantiationException
public void store()
throws ResourceInstantiationException
Taxonomy
store in interface TaxonomyResourceInstantiationExceptionpublic void setSourceURI(String theURI)
Taxonomy
setSourceURI in interface TaxonomytheURI - the URI to be setpublic String getSourceURI()
Taxonomy
getSourceURI in interface Taxonomypublic void setVersion(String theVersion)
Taxonomy
setVersion in interface TaxonomytheVersion - the version to be setpublic String getVersion()
Taxonomy
getVersion in interface Taxonomypublic String getId()
Taxonomy
getId in interface Taxonomypublic void setId(String theID)
Taxonomy
setId in interface TaxonomytheID - the id to be setpublic String getComment()
Taxonomy
getComment in interface Taxonomypublic void setComment(String theComment)
Taxonomy
setComment in interface TaxonomytheComment - the comment to be set
public TClass createClass(String aName,
String aComment)
Taxonomy
createClass in interface TaxonomyaName - the name of this classaComment - the comment of this class
public void removeClass(TClass theClass)
removeClass in interface TaxonomytheClass - the class to be removedpublic void addClass(TClass theClass)
Taxonomy
addClass in interface TaxonomytheClass - the class to be addedpublic TClass getClassByName(String theName)
Taxonomy
getClassByName in interface TaxonomytheName - the name of the class
public boolean containsClassByName(String theName)
Taxonomy
containsClassByName in interface TaxonomytheName - name of a class
public Set getClasses()
Taxonomy
getClasses in interface Taxonomypublic Iterator getClasses(Comparator comp)
Taxonomy
getClasses in interface Taxonomycomp - a comparator defining the order of iterating the classes
private void determineTops()
public Set getTopClasses()
Taxonomy
getTopClasses in interface Taxonomy
public int getTaxonomicDistance(TClass class1,
TClass class2)
getTaxonomicDistance in interface Taxonomyclass1 - the first classclass2 - the second class
public boolean equals(Object o)
equals in interface Taxonomyo - another ontology to compare with
public String toString()
protected void reinfer()
public void setModified(boolean isModified)
Taxonomy
setModified in interface TaxonomyisModified - sets this param as a value of
the modified property of the ontologypublic boolean isModified()
Taxonomy
isModified in interface TaxonomyisModified in class AbstractLanguageResource
public boolean isSubClassOf(String cls1,
String cls2)
throws NoSuchClosureTypeException
isSubClassOf in interface Taxonomycls1 - the first classcls2 - the second class
NoSuchClosureTypeException
public boolean isDirectSubClassOf(String cls1,
String cls2)
throws NoSuchClosureTypeException
isDirectSubClassOf in interface Taxonomycls1 - the first classcls2 - the second class
NoSuchClosureTypeException
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||