gate.creole
Class ProtegeProjectName

java.lang.Object
  |
  +--gate.util.AbstractFeatureBearer
        |
        +--gate.creole.AbstractResource
              |
              +--gate.creole.AbstractLanguageResource
                    |
                    +--gate.creole.ProtegeProjectName
All Implemented Interfaces:
FeatureBearer, LanguageResource, NameBearer, Ontology, ProtegeProject, Resource, Serializable

public class ProtegeProjectName
extends AbstractLanguageResource
implements ProtegeProject, Ontology

Dummy Protege LR. Just keep the Protege project file name

See Also:
Serialized Form

Constructor Summary
ProtegeProjectName()
           
 
Method Summary
 void addClass(OClass theClass)
          Adds a class to the ontology.
 boolean containsClassByName(String theName)
          Checks if the ontology contains a class with the given name.
 OClass createClass(String aName, String aComment)
          Creates a new OClass and returns it.
 boolean equals(Object o)
          Checks the equality of two ontologies.
 OClass 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.
 edu.stanford.smi.protege.model.KnowledgeBase getKnowledgeBase()
           
 String getLabel()
          Gets the label.
 Ontology getOntology(URL someUrl)
          Gets ontology by URL.
 URL getProjectName()
           
 String getSourceURI()
          Gets the source URI.
 int getTaxonomicDistance(OClass class1, OClass 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 isModified()
          Checks the modified flag.
 void load()
          Loads this ontology.
 void removeClass(OClass theClass)
          Removes a class from this ontology.
 void setComment(String theComment)
          Sets the comment of this ontology.
 void setId(String theId)
          Sets the id of this ontology.
 void setKnowledgeBase(edu.stanford.smi.protege.model.KnowledgeBase base)
           
 void setLabel(String label)
          Sets the label of the ontology.
 void setModified(boolean isModified)
          Sets the modified flag.
 void setProjectName(URL name)
           
 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 setViewResource(ProtegeWrapper visual)
           
 void store()
          Stores this ontology.
 
Methods inherited from class gate.creole.AbstractLanguageResource
cleanup, getDataStore, getLRPersistenceId, getParent, setDataStore, setLRPersistenceId, setParent, sync
 
Methods inherited from class gate.creole.AbstractResource
checkParameterValues, getName, getParameterValue, getParameterValue, init, removeResourceListeners, setName, setParameterValue, setParameterValue, setParameterValues, setParameterValues, setResourceListeners
 
Methods inherited from class gate.util.AbstractFeatureBearer
getFeatures, setFeatures
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
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
 

Constructor Detail

ProtegeProjectName

public ProtegeProjectName()
Method Detail

setProjectName

public void setProjectName(URL name)

getProjectName

public URL getProjectName()

setViewResource

public void setViewResource(ProtegeWrapper visual)

setKnowledgeBase

public void setKnowledgeBase(edu.stanford.smi.protege.model.KnowledgeBase base)

getKnowledgeBase

public edu.stanford.smi.protege.model.KnowledgeBase getKnowledgeBase()

getOntology

public Ontology getOntology(URL someUrl)
                     throws ResourceInstantiationException
Description copied from interface: Ontology
Gets ontology by URL. The ontology will be searched first among the LRs and afterwards loaded by the URL if not found
Specified by:
getOntology in interface Ontology
Following copied from interface: gate.creole.ontology.Ontology
Parameters:
someUrl - the url of the ontology
Returns:
the retrieved or loaded ontology
Throws:
ResourceInstantiationException - if something gets wrong with the loading

getLabel

public String getLabel()
Description copied from interface: Ontology
Gets the label.
Specified by:
getLabel in interface Ontology
Following copied from interface: gate.creole.ontology.Ontology
Returns:
the label of the ontology

setLabel

public void setLabel(String label)
Description copied from interface: Ontology
Sets the label of the ontology.
Specified by:
setLabel in interface Ontology
Following copied from interface: gate.creole.ontology.Ontology
Parameters:
theLabel - the label to be set

getURL

public URL getURL()
Description copied from interface: Ontology
Gets the url of this ontology
Specified by:
getURL in interface Ontology
Following copied from interface: gate.creole.ontology.Ontology
Returns:
the url of this ontology

setURL

public void setURL(URL aUrl)
Description copied from interface: Ontology
Set the url of this ontology
Specified by:
setURL in interface Ontology
Following copied from interface: gate.creole.ontology.Ontology
Parameters:
aUrl - the url to be set

setSourceURI

public void setSourceURI(String theURI)
Description copied from interface: Ontology
Sets the URI of the ontology
Specified by:
setSourceURI in interface Ontology
Following copied from interface: gate.creole.ontology.Ontology
Parameters:
theURI - the URI to be set

getSourceURI

public String getSourceURI()
Description copied from interface: Ontology
Gets the source URI.
Specified by:
getSourceURI in interface Ontology
Following copied from interface: gate.creole.ontology.Ontology
Returns:
the URI of this ontology

setVersion

public void setVersion(String theVersion)
Description copied from interface: Ontology
Sets version to this ontology.
Specified by:
setVersion in interface Ontology
Following copied from interface: gate.creole.ontology.Ontology
Parameters:
theVersion - the version to be set

getVersion

public String getVersion()
Description copied from interface: Ontology
Gets the version of this ontology.
Specified by:
getVersion in interface Ontology
Following copied from interface: gate.creole.ontology.Ontology
Returns:
the version of this ontology

load

public void load()
          throws ResourceInstantiationException
Description copied from interface: Ontology
Loads this ontology. According to different storages - different implementations are expected. Should take care of the modifiedAfterLoading member
Specified by:
load in interface Ontology

store

public void store()
           throws ResourceInstantiationException
Description copied from interface: Ontology
Stores this ontology. According to different storages - different implementations are expected. Should take care of the modifiedAfterLoading member
Specified by:
store in interface Ontology

getId

public String getId()
Description copied from interface: Ontology
Gets the id of this ontology.
Specified by:
getId in interface Ontology
Following copied from interface: gate.creole.ontology.Ontology
Returns:
the id of this ontology

setId

public void setId(String theId)
Description copied from interface: Ontology
Sets the id of this ontology.
Specified by:
setId in interface Ontology
Following copied from interface: gate.creole.ontology.Ontology
Parameters:
theId - the id to be set

getComment

public String getComment()
Description copied from interface: Ontology
Gets the comment of this ontology.
Specified by:
getComment in interface Ontology
Following copied from interface: gate.creole.ontology.Ontology
Returns:
the comment of this ontology

setComment

public void setComment(String theComment)
Description copied from interface: Ontology
Sets the comment of this ontology.
Specified by:
setComment in interface Ontology
Following copied from interface: gate.creole.ontology.Ontology
Parameters:
theComment - the comment to be set

createClass

public OClass createClass(String aName,
                          String aComment)
Description copied from interface: Ontology
Creates a new OClass and returns it.
Specified by:
createClass in interface Ontology
Following copied from interface: gate.creole.ontology.Ontology
Parameters:
aName - the name of this class
aComment - the comment of this class
Returns:
the newly created class

removeClass

public void removeClass(OClass theClass)
Description copied from interface: Ontology
Removes a class from this ontology.
Specified by:
removeClass in interface Ontology
Following copied from interface: gate.creole.ontology.Ontology
Parameters:
theClass - the class to be removed

addClass

public void addClass(OClass theClass)
Description copied from interface: Ontology
Adds a class to the ontology.
Specified by:
addClass in interface Ontology
Following copied from interface: gate.creole.ontology.Ontology
Parameters:
theClass - the class to be added

getClassByName

public OClass getClassByName(String theName)
Description copied from interface: Ontology
Retrieves a class by its name.
Specified by:
getClassByName in interface Ontology
Following copied from interface: gate.creole.ontology.Ontology
Parameters:
theName - the name of the class
Returns:
the class matching the name or null if no matches.

containsClassByName

public boolean containsClassByName(String theName)
Description copied from interface: Ontology
Checks if the ontology contains a class with the given name.
Specified by:
containsClassByName in interface Ontology
Following copied from interface: gate.creole.ontology.Ontology
Parameters:
theName - name of a class
Returns:
true if the ontology contains a class with the name specified

getClasses

public Set getClasses()
Description copied from interface: Ontology
Retrieves all classes as a set.
Specified by:
getClasses in interface Ontology
Following copied from interface: gate.creole.ontology.Ontology
Returns:
set of all the classes in this ontology

getClasses

public Iterator getClasses(Comparator comp)
Description copied from interface: Ontology
Retireves an iterator over the classes, ordered according to the comparator.
Specified by:
getClasses in interface Ontology
Following copied from interface: gate.creole.ontology.Ontology
Parameters:
comp - a comparator defining the order of iterating the classes
Returns:
an iterator over the classes

getTopClasses

public Set getTopClasses()
Description copied from interface: Ontology
Gets the top classes.
Specified by:
getTopClasses in interface Ontology
Following copied from interface: gate.creole.ontology.Ontology
Returns:
set of the top classes of this ontology

getTaxonomicDistance

public int getTaxonomicDistance(OClass class1,
                                OClass class2)
Description copied from interface: Ontology
Gets the taxonomic distance between 2 classes.
Specified by:
getTaxonomicDistance in interface Ontology
Following copied from interface: gate.creole.ontology.Ontology
Parameters:
class1 - the first class
class2 - the second class
Returns:
the taxonomic distance between the 2 classes

equals

public boolean equals(Object o)
Description copied from interface: Ontology
Checks the equality of two ontologies.
Specified by:
equals in interface Ontology
Overrides:
equals in class Object
Following copied from interface: gate.creole.ontology.Ontology
Parameters:
o - the other ontology
Returns:
true if the ontologies are considered equal, otherwise - false.

setModified

public void setModified(boolean isModified)
Description copied from interface: Ontology
Sets the modified flag.
Specified by:
setModified in interface Ontology
Following copied from interface: gate.creole.ontology.Ontology
Parameters:
isModified - sets this param as a value of the modified property of the ontology

isModified

public boolean isModified()
Description copied from interface: Ontology
Checks the modified flag.
Specified by:
isModified in interface LanguageResource
Overrides:
isModified in class AbstractLanguageResource
Following copied from interface: gate.creole.ontology.Ontology
Returns:
whether the ontology has been modified after the loading