gate.creole.ontology
Interface KnowledgeBase

All Superinterfaces:
FeatureBearer, LanguageResource, NameBearer, Ontology, Resource, Serializable

public interface KnowledgeBase
extends Ontology


Method Summary
 void addInstance(OInstance theInstance)
          Adds an instance to the knowledge base.
 OInstance addInstance(String name, OClass theClass)
          Adds an instance to the knowledge base.
 List getDirectInstances(OClass theClass)
          Gets all instances in the KB, which belong to the given class only.
 OInstance getInstanceByName(String instanceName)
          Gets the instance with the given name.
 List getInstances()
          Gets all instances in the KB.
 List getInstances(OClass theClass)
          Gets all instances in the KB, which belong to this class, including instances of sub-classes.
 void removeInstance(OInstance theInstance)
          Removes the instance from the knowledge base.
 
Methods inherited from interface gate.creole.ontology.Ontology
addClass, containsClassByName, createClass, equals, getClassByName, getClasses, getClasses, getComment, getId, getLabel, getOntology, getSourceURI, getTaxonomicDistance, getTopClasses, getURL, getVersion, isModified, load, removeClass, setComment, setId, setLabel, setModified, setSourceURI, setURL, setVersion, store
 
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

addInstance

public OInstance addInstance(String name,
                             OClass theClass)
Adds an instance to the knowledge base.

Parameters:
name - the instance name to be added
theClass - the class to be added
Returns:
the OInstance that has been added to the KB

addInstance

public void addInstance(OInstance theInstance)
Adds an instance to the knowledge base.


removeInstance

public void removeInstance(OInstance theInstance)
Removes the instance from the knowledge base.

Parameters:
theInstance - to be removed

getInstances

public List getInstances()
Gets all instances in the KB.

Returns:
List of OInstance objects

getInstances

public List getInstances(OClass theClass)
Gets all instances in the KB, which belong to this class, including instances of sub-classes. If only the instances of the given class are needed, then use getDirectInstances.

Parameters:
theClass - the class of the instances
Returns:
List of OInstance objects

getDirectInstances

public List getDirectInstances(OClass theClass)
Gets all instances in the KB, which belong to the given class only.

Parameters:
theClass - the class of the instances
Returns:
List of OInstance objects

getInstanceByName

public OInstance getInstanceByName(String instanceName)
Gets the instance with the given name.

Returns:
the OInstance object with this name