|
GATE Version 3.1-2270 |
|||||||||
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
com.ontotext.gate.ontology.OntologyImpl
public class OntologyImpl
An Ontology Implementation Class
Field Summary | |
---|---|
protected Set |
instances
|
protected Map |
instancesByName
|
protected Set |
propertyDefinitionSet
|
Fields inherited from class com.ontotext.gate.ontology.TaxonomyImpl |
---|
DIRECT_CLOSURE, lastGeneratedId, modified, nullBuffers, TRANSITIVE_CLOSURE |
Fields inherited from class gate.creole.AbstractLanguageResource |
---|
dataStore, lrPersistentId |
Fields inherited from class gate.util.AbstractFeatureBearer |
---|
features |
Constructor Summary | |
---|---|
OntologyImpl()
|
Method Summary | |
---|---|
DatatypeProperty |
addDatatypeProperty(String name,
String comment,
OClass domain,
Class range)
Creates a new Datatype property in this ontology where the domain consists of a single OClass . |
DatatypeProperty |
addDatatypeProperty(String name,
String comment,
Set domain,
Class range)
Create a DatatypeProperty with the given domain and range. |
void |
addInstance(OInstance theInstance)
Adds a preconstructed instance to the ontology. |
OInstance |
addInstance(String name,
OClass theClass)
Adds an instance to the ontology. |
ObjectProperty |
addObjectProperty(String name,
String comment,
OClass domain,
OClass range)
Creates a new object property (a property that takes instances as values). |
ObjectProperty |
addObjectProperty(String name,
String comment,
Set domain,
Set range)
Creates a new object property (a property that takes instances as values). |
Property |
addProperty(String name,
String comment,
OClass domain,
Class range)
Creates a new generic property that is neither datatype or object property. |
Property |
addProperty(String name,
String comment,
Set domain,
Set range)
Creates a new generic property that is neither datatype or object property. |
protected void |
addPropertyDefinition(Property theProperty)
|
SymmetricProperty |
addSymmetricProperty(String name,
String comment,
OClass domain,
OClass range)
Creates a new symmetric property. |
SymmetricProperty |
addSymmetricProperty(String name,
String comment,
Set domain,
Set range)
Creates a new symmetric property (an object property that is symmetric). |
TransitiveProperty |
addTransitiveProperty(String name,
String comment,
OClass domain,
OClass range)
Creates a new transitive property. |
TransitiveProperty |
addTransitiveProperty(String name,
String comment,
Set domain,
Set range)
Creates a new transitive property (an object property that is transitive). |
TClass |
createClass(String aName,
String aComment)
Creates a new OClass and returns it. |
Set |
getDirectInstances(OClass aClass)
Gets all instances in the ontology, which belong to the given class only. |
OInstance |
getInstanceByName(String aName)
Gets the instance with the given name. |
Set |
getInstances()
Gets all instances in the ontology. |
Set |
getInstances(OClass aClass)
Gets all instances in the ontology, which belong to this class, including instances of sub-classes. |
Property |
getPropertyDefinitionByName(String name)
Returns the property definition for a given property. |
Set |
getPropertyDefinitions()
Gets the set of all known property definitions in this ontology. |
static void |
reduceToMostSpecificClasses(Set classSet)
Eliminates the more general classes from a set, keeping only the most specific ones. |
void |
removeInstance(OInstance theInstance)
Removes the instance from the ontology. |
Methods inherited from class com.ontotext.gate.ontology.TaxonomyImpl |
---|
addClass, addObjectModificationListener, containsClassByName, equals, fireObjectModificationEvent, getClassByName, getClasses, getClasses, getComment, getDefaultNameSpace, getId, getLabel, getOntology, getTaxonomicDistance, getTopClasses, getURL, getVersion, init, isDirectSubClassOf, isModified, isSubClassOf, load, reinfer, removeClass, setComment, setDefaultNameSpace, setId, setLabel, setModified, setURL, setVersion, store, 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.creole.ontology.Taxonomy |
---|
addClass, containsClassByName, equals, getClassByName, getClasses, getClasses, getComment, getDefaultNameSpace, getId, getLabel, getTaxonomicDistance, getTopClasses, getURL, getVersion, isDirectSubClassOf, isModified, isSubClassOf, load, removeClass, setComment, setDefaultNameSpace, setId, setLabel, setModified, 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 |
Field Detail |
---|
protected Map instancesByName
protected Set instances
protected Set propertyDefinitionSet
Constructor Detail |
---|
public OntologyImpl()
Method Detail |
---|
public OInstance addInstance(String name, OClass theClass)
Ontology
addInstance
in interface Ontology
name
- the name for the new instancetheClass
- the class to which the instance belongs
public void addInstance(OInstance theInstance)
Ontology
addInstance
in interface Ontology
public void removeInstance(OInstance theInstance)
Ontology
removeInstance
in interface Ontology
theInstance
- to be removedpublic Set getInstances()
Ontology
getInstances
in interface Ontology
Set
of OInstance objectspublic Set getInstances(OClass aClass)
Ontology
getInstances
in interface Ontology
aClass
- the class of the instances
Set
of OInstance objectspublic Set getDirectInstances(OClass aClass)
Ontology
getDirectInstances
in interface Ontology
aClass
- the class of the instances
Set
of OInstance objectspublic OInstance getInstanceByName(String aName)
Ontology
getInstanceByName
in interface Ontology
aName
- the instance name
public TClass createClass(String aName, String aComment)
Taxonomy
createClass
in interface Taxonomy
createClass
in class TaxonomyImpl
aName
- the name of this classaComment
- the comment of this class
public DatatypeProperty addDatatypeProperty(String name, String comment, Set domain, Class range)
Ontology
addDatatypeProperty
in interface Ontology
name
- the name for the new property.comment
- the comment for the new property.domain
- the set of ontology classes (i.e. OClass
objects} that
constitutes the range for the new property. The property only
applies to instances that belong to all classes included
in its domain. An empty set means that the property applies to
instances of any class.range
- the Class
specifying the types of Java objects that this
property has as values.
public DatatypeProperty addDatatypeProperty(String name, String comment, OClass domain, Class range)
Ontology
OClass
.
addDatatypeProperty
in interface Ontology
name
- the name for the new property.comment
- the comment for the new property.domain
- the OClass
to which this property applies.range
- the Class
specifying the types of Java objects that this
property has as values.
public Property addProperty(String name, String comment, Set domain, Set range)
Ontology
addProperty
in interface Ontology
name
- the name for the new property.comment
- the comment for the new property.domain
- the set of ontology classes (i.e. OClass
objects} that
constitutes the range for the new property. The property only
applies to instances that belong to all classes included
in its domain. An empty set means that the property applies to
instances of any class.range
- the set of ontology classes (i.e. OClass
objects} that
constitutes the range for the new property.
public Property addProperty(String name, String comment, OClass domain, Class range)
Ontology
addProperty
in interface Ontology
name
- the name for the new property.comment
- the comment for the new property.domain
- the OClass
defining the type of instances this property
can apply to.range
- Java Class
defining the type of values this proeprty can
take.
public ObjectProperty addObjectProperty(String name, String comment, Set domain, Set range)
Ontology
addObjectProperty
in interface Ontology
name
- the name for the new property.comment
- the comment for the new property.domain
- the set of ontology classes (i.e. OClass
objects} that
constitutes the range for the new property. The property only
applies to instances that belong to all classes included
in its domain. An empty set means that the property applies to
instances of any class.range
- the set of ontology classes (i.e. OClass
objects} that
constitutes the range for the new property.
public ObjectProperty addObjectProperty(String name, String comment, OClass domain, OClass range)
Ontology
addObjectProperty
in interface Ontology
name
- the name for the new property.comment
- the comment for the new property.domain
- the OClass
to which this property applies.range
- the OClass
specifying the types of instances that this
property can take as values.
public SymmetricProperty addSymmetricProperty(String name, String comment, Set domain, Set range)
Ontology
addSymmetricProperty
in interface Ontology
name
- the name for the new property.comment
- the comment for the new property.domain
- the set of ontology classes (i.e. OClass
objects} that
constitutes the range for the new property. The property only
applies to instances that belong to all classes included
in its domain. An empty set means that the property applies to
instances of any class.range
- the set of ontology classes (i.e. OClass
objects} that
constitutes the range for the new property.
public SymmetricProperty addSymmetricProperty(String name, String comment, OClass domain, OClass range)
Ontology
addSymmetricProperty
in interface Ontology
name
- the name for the new property.comment
- the comment for the new property.domain
- the OClass
to which this property applies.range
- the OClass
specifying the types of instances that this
property can take as values.
public TransitiveProperty addTransitiveProperty(String name, String comment, Set domain, Set range)
Ontology
addTransitiveProperty
in interface Ontology
name
- the name for the new property.comment
- the comment for the new property.domain
- the set of ontology classes (i.e. OClass
objects} that
constitutes the range for the new property. The property only
applies to instances that belong to all classes included
in its domain. An empty set means that the property applies to
instances of any class.range
- the set of ontology classes (i.e. OClass
objects} that
constitutes the range for the new property.
public TransitiveProperty addTransitiveProperty(String name, String comment, OClass domain, OClass range)
Ontology
addTransitiveProperty
in interface Ontology
name
- the name for the new property.comment
- the comment for the new property.domain
- the OClass
to which this property applies.range
- the OClass
specifying the types of instances that this
property can take as values.
protected void addPropertyDefinition(Property theProperty)
public Set getPropertyDefinitions()
Ontology
getPropertyDefinitions
in interface Ontology
Set
of Property
objects.public Property getPropertyDefinitionByName(String name)
Ontology
getPropertyDefinitionByName
in interface Ontology
name
- the name for which the definition is sought.
Property
object.public static void reduceToMostSpecificClasses(Set classSet)
classSet
- a set of OClass
objects.
|
GATE Version 3.1-2270 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |