|
GATE Version 3.1-2270 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgate.creole.ontology.OntologyResourceImpl
gate.creole.ontology.PropertyImpl
public class PropertyImpl
This class provides implementations for methods common to all types of ontological properties.
Field Summary | |
---|---|
protected Set |
directDomain
The set of domain restrictions (i.e. |
protected Set |
directRange
The set of range restrictions (i.e. |
protected Set |
domain
The set of domain restrictions (i.e. |
protected boolean |
functional
|
protected boolean |
inverseFunctional
|
protected Set |
range
The set of range restrictions (i.e. |
protected Set |
samePropertiesSet
|
protected Set |
subPropertiesSet
|
protected Set |
subPropertiesTransitiveClosure
|
protected Set |
superPropertiesSet
|
protected Set |
superPropertiesTransitiveClosure
|
Fields inherited from class gate.creole.ontology.OntologyResourceImpl |
---|
comment, instanceProperties, name, ontology, taxonomy, uri |
Fields inherited from interface gate.creole.ontology.OntologyConstants |
---|
DIRECT_CLOSURE, TRANSITIVE_CLOSURE |
Constructor Summary | |
---|---|
PropertyImpl(String name,
String comment,
OClass aDomainClass,
Object aRangeType,
Ontology ontology)
|
|
PropertyImpl(String name,
String comment,
Set domain,
Set range,
Ontology ontology)
Creates a property. |
Method Summary | |
---|---|
void |
addSubProperty(Property property)
Add a SuperPropertyOf relation between the given property and this. |
void |
addSuperProperty(Property property)
Adds a SubPropertyOf relation between the given property and this. |
protected void |
calculateSubPropertiesClosure()
|
protected void |
calculateSuperPropertiesClosure()
|
Set |
getDomain()
Returns the set of domain classes for this property. |
String |
getName()
Gets resource name. |
Set |
getRange()
Returns the set of range classes for this property. |
Set |
getSamePropertyAs()
Returns a set of all KBProperty instances that are in SamePropertyAs relation with this property. |
Set |
getSubProperties(byte closure)
Gets the set of sub-properties for this property. |
Set |
getSuperProperties(byte closure)
Gets the set of super-properties for this property. |
String |
getURI()
Gets the URI of the resource. |
boolean |
isFunctional()
Answers whether this property is a functional property. |
boolean |
isInverseFunctional()
Answers whether this property is an inverse functional property. |
boolean |
isValidDomain(OntologyResource resource)
Checks whether a provided value can be a domain value for this property. |
boolean |
isValidRange(Object value)
Checks whether a provided instance can be a range value for this property. |
protected void |
recalculateDomain()
Notifies this property that it should recalculate the range set (because the range of a super-property has changed). |
protected void |
recalculateRange()
Notifies this property that it should recalculate the range set (because the range of a super-property has changed). |
void |
removeSubProperty(Property property)
Removes a SuperPropertyOf relation between the given property and this. |
void |
removeSuperProperty(Property property)
Removes a SubPropertyOf relation between the given property and this. |
void |
setFunctional(boolean functional)
Sets the functional property flag on this property. |
void |
setInverseFunctional(boolean inverseFunctional)
Sets the inverse functional property flag on this property. |
void |
setSamePropertyAs(Property theProperty)
Add a samePropertyAs relation between the two properties. |
void |
setURI(String theURI)
Sets the URI of the resource. |
String |
toString()
|
Methods inherited from class gate.creole.ontology.OntologyResourceImpl |
---|
addPropertyValue, getComment, getOntology, getPropertyValue, getPropertyValues, getSetPropertiesNames, getTaxonomy, removePropertyValue, removePropertyValues, setComment, setName, setOntology |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface gate.creole.ontology.OntologyResource |
---|
addPropertyValue, getComment, getOntology, getPropertyValues, getSetPropertiesNames, getTaxonomy, removePropertyValue, removePropertyValues, setComment, setName |
Field Detail |
---|
protected Set domain
OClass
objects} for this
property. This is composed from the directDomain
plus all the
domain restrictions from the super-properties. Once calculated this value
is cached.
protected Set directDomain
OClass
objects} set as domain
directly for this property.
protected Set range
OClass
or Class
objects) for this property. This is composed from the directRange
plus all the range restrictions from the super-properties. Once calculated
this value is cached.
protected Set directRange
OClass
or Class
objects) set as range directly for this property.
protected Set samePropertiesSet
protected Set superPropertiesSet
protected Set subPropertiesSet
protected Set superPropertiesTransitiveClosure
protected Set subPropertiesTransitiveClosure
protected boolean functional
protected boolean inverseFunctional
Constructor Detail |
---|
public PropertyImpl(String name, String comment, Set domain, Set range, Ontology ontology)
name
- the name of the propertydomain
- the ontology class representing the domain for this property.range
- a set containing range restrictions. These can either be
OClass
or Class
objects depending on the types of
the values that are permitted.ontology
- the ontology this property is defined in.public PropertyImpl(String name, String comment, OClass aDomainClass, Object aRangeType, Ontology ontology)
Method Detail |
---|
public String getName()
OntologyResource
getName
in interface OntologyResource
getName
in class OntologyResourceImpl
public String getURI()
OntologyResource
getURI
in interface OntologyResource
getURI
in class OntologyResourceImpl
public void setURI(String theURI)
OntologyResource
setURI
in interface OntologyResource
setURI
in class OntologyResourceImpl
theURI
- The URI to set.public void setSamePropertyAs(Property theProperty)
Property
setSamePropertyAs
in interface Property
public Set getSamePropertyAs()
Property
getSamePropertyAs
in interface Property
Set
value.public void addSuperProperty(Property property)
Property
addSuperProperty
in interface Property
protected void recalculateDomain()
protected void recalculateRange()
public void removeSuperProperty(Property property)
Property
removeSuperProperty
in interface Property
public void addSubProperty(Property property)
addSubProperty
in interface Property
property
- public void removeSubProperty(Property property)
Property
removeSubProperty
in interface Property
public Set getDomain()
getDomain
in interface Property
public Set getRange()
getRange
in interface Property
OClass
or Class
objects.public boolean isFunctional()
Property
isFunctional
in interface Property
public boolean isInverseFunctional()
Property
isInverseFunctional
in interface Property
public void setFunctional(boolean functional)
Property
setFunctional
in interface Property
functional
- true iff the property should be marked as functional.public void setInverseFunctional(boolean inverseFunctional)
Property
setInverseFunctional
in interface Property
inverseFunctional
- true iff the property should be marked as inverse
functional.public boolean isValidDomain(OntologyResource resource)
OInstance
then, in order to be a valid domain value
it needs to be a member of all the classes defined as members of
the domain of this property. The domain of this property is defined
recursively based on its super-properties as well. For any other types of
values it returns true.
isValidDomain
in interface Property
instance
- the instance to be checked.
public boolean isValidRange(Object value)
isValidRange
in interface Property
instance
- the instance to be checked.
public String toString()
toString
in class Object
public Set getSuperProperties(byte closure)
getSuperProperties
in interface Property
{@link
- OntologyConstants#DIRECT_CLOSURE}
for direct super-properties only or
OntologyConstants.TRANSITIVE_CLOSURE
for all the
super-properties.
Property
values.protected void calculateSuperPropertiesClosure()
public Set getSubProperties(byte closure)
getSubProperties
in interface Property
{@link
- OntologyConstants#DIRECT_CLOSURE}
for direct sub-properties only or
OntologyConstants.TRANSITIVE_CLOSURE
for all the
sub-properties.
Property
values.protected void calculateSubPropertiesClosure()
|
GATE Version 3.1-2270 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |