gate.creole.ontology
Interface OInstance

All Superinterfaces:
OResource

public interface OInstance
extends OResource

OInstance (Ontology Instance) represents an instance in the ontology/knowledge base. The interface provides various methods, including and not limited to, obtain a list of classes the instance belongs to, and various methods to add various property values on it.

Author:
Niraj Aswani, Johann Petrak

Method Summary
 void addDatatypePropertyValue(DatatypeProperty aProperty, Literal value)
          Adds the value for the given Property.
 void addObjectPropertyValue(ObjectProperty aProperty, OInstance value)
          Adds the value for the given property (Object, Symmetric and Transitive).
 void addOClass(OClass theClass)
          Make this individual an instance of another class.
 void addRDFPropertyValue(RDFProperty aProperty, OResource value)
          Deprecated. this throws an exception in the new implementation
 List<Literal> getDatatypePropertyValues(DatatypeProperty aProperty)
          Gets a list of values for the given Property.
 Set<OInstance> getDifferentInstances()
          Returns a set of OInstance objects which are explicitly specified as being different from the current instance.
 List<OInstance> getObjectPropertyValues(ObjectProperty aProperty)
          Gets a list of values for the given Property (Object, Symmetric and Transitive).
 Set<OClass> getOClasses(byte closure)
          Deprecated. 
 Set<OClass> getOClasses(OConstants.Closure closure)
           
 OURI getOURI()
           
 List<OValue> getRDFPropertyOValues(RDFProperty aProperty)
           
 List<OResource> getRDFPropertyValues(RDFProperty aProperty)
          Deprecated.  
 Set<OInstance> getSameInstance()
          Returns a set of OInstance objects which are explicitly specified as being same as the current instance.
 Set<DatatypeProperty> getSetDatatypeProperties()
          This method returns the datatype properties set on this resource.
 Set<ObjectProperty> getSetObjectProperties()
          This method returns the object properties set on this resource.
 Set<RDFProperty> getSetRDFProperties()
          This method returns the RDF properties set on this resource.
 boolean hasDatatypePropertyWithValue(DatatypeProperty aProperty, Literal aValue)
          Checks if the resource has the provided datatype property set on it with the specified value.
 boolean hasObjectPropertyWithValue(ObjectProperty aProperty, OInstance aValue)
          Checks if the resource has the provided object property set on it with the specified value.
 boolean hasRDFPropertyWithValue(RDFProperty aProperty, OResource aResource)
          Deprecated.  
 boolean isDifferentFrom(OInstance theInstance)
          Checks whether the instance is different from the given instance
 boolean isInstanceOf(OClass aClass, byte closure)
          Deprecated. 
 boolean isInstanceOf(OClass aClass, OConstants.Closure closure)
           
 boolean isSameInstanceAs(OInstance theInstance)
          Checks whether the instance is same as the given instance
 void removeDatatypePropertyValue(DatatypeProperty aProperty, Literal value)
          Remove the provided value for the given property.
 void removeDatatypePropertyValues(DatatypeProperty aProperty)
          Removes all property values set for the current property.
 void removeObjectPropertyValue(ObjectProperty aProperty, OInstance value)
          Remove the provided value for the given property (Object, Symmetric and Transitive).
 void removeObjectPropertyValues(ObjectProperty aProperty)
          Removes all property values set for the current property (Object, Symmetric and Transitive).
 void removeRDFPropertyValue(RDFProperty aProperty, OResource value)
          Deprecated.  
 void removeRDFPropertyValues(RDFProperty aProperty)
          Deprecated.  
 void setDifferentFrom(OInstance theInstance)
          Sets the instance being different from the provided instance.
 void setSameInstanceAs(OInstance theIndividual)
          Sets the instance being same as the provided instance.
 
Methods inherited from interface gate.creole.ontology.OResource
addAnnotationPropertyValue, getAllSetProperties, getAnnotationPropertyValues, getComment, getComments, getLabel, getLabels, getName, getONodeID, getOntology, getPropertiesWithResourceAsDomain, getPropertiesWithResourceAsRange, getSetAnnotationProperties, getURI, hasAnnotationPropertyWithValue, removeAnnotationPropertyValue, removeAnnotationPropertyValues, setComment, setLabel, setURI
 

Method Detail

getOClasses

@Deprecated
Set<OClass> getOClasses(byte closure)
Deprecated. 

Gets the set of classes this instance belongs to.

Parameters:
closure - either OntologyConstants.DIRECT_CLOSURE or OntologyConstants.TRANSITIVE_CLOSURE.
Returns:
a set of OClass objects.

getOClasses

Set<OClass> getOClasses(OConstants.Closure closure)

addOClass

void addOClass(OClass theClass)
Make this individual an instance of another class. This does nothing if the individual is already an instance of the given class. Note that this cann lead to inconsistencies, e.g. if this class is disjunct with a class of which the individual is already an instance.

Parameters:
theClass - - the OClass object for the class of which the individual should be an instance.

isInstanceOf

@Deprecated
boolean isInstanceOf(OClass aClass,
                                byte closure)
Deprecated. 

Checks whether the instance is an instance of the provided class.

Parameters:
aClass -
closure - either OntologyConstants.DIRECT_CLOSURE or OntologyConstants.TRANSITIVE_CLOSURE.
Returns:
true, if the instance is indded an instance of the provided class, otherwise - false.

isInstanceOf

boolean isInstanceOf(OClass aClass,
                     OConstants.Closure closure)

setDifferentFrom

void setDifferentFrom(OInstance theInstance)
Sets the instance being different from the provided instance.

Parameters:
theIndividual -

getDifferentInstances

Set<OInstance> getDifferentInstances()
Returns a set of OInstance objects which are explicitly specified as being different from the current instance.

Returns:
a Set of OInstances

isDifferentFrom

boolean isDifferentFrom(OInstance theInstance)
Checks whether the instance is different from the given instance

Parameters:
theInstance -
Returns:

setSameInstanceAs

void setSameInstanceAs(OInstance theIndividual)
Sets the instance being same as the provided instance.

Parameters:
theIndividual -

getSameInstance

Set<OInstance> getSameInstance()
Returns a set of OInstance objects which are explicitly specified as being same as the current instance.

Returns:

isSameInstanceAs

boolean isSameInstanceAs(OInstance theInstance)
Checks whether the instance is same as the given instance

Parameters:
theInstance -
Returns:

addRDFPropertyValue

@Deprecated
void addRDFPropertyValue(RDFProperty aProperty,
                                    OResource value)
                         throws InvalidValueException
Deprecated. this throws an exception in the new implementation

Adds the value for the given RDFProperty.

Parameters:
aProperty -
value -
Throws:
InvalidValueException - This exception is thrown when a value is not compatible with the specified property's range.

removeRDFPropertyValue

@Deprecated
void removeRDFPropertyValue(RDFProperty aProperty,
                                       OResource value)
Deprecated. 

Remove the provided value for the given property.

Parameters:
aProperty -
value -

getRDFPropertyValues

@Deprecated
List<OResource> getRDFPropertyValues(RDFProperty aProperty)
Deprecated. 

Gets a list of values for the given Property.

Parameters:
aProperty -
Returns:
a List of OResource.

getRDFPropertyOValues

List<OValue> getRDFPropertyOValues(RDFProperty aProperty)

getSetRDFProperties

Set<RDFProperty> getSetRDFProperties()
This method returns the RDF properties set on this resource.

Returns:

hasRDFPropertyWithValue

@Deprecated
boolean hasRDFPropertyWithValue(RDFProperty aProperty,
                                           OResource aResource)
Deprecated. 

Checks if the resource has the provided annotation property set on it with the specified value.

Parameters:
aProperty -
aValue -
Returns:

removeRDFPropertyValues

@Deprecated
void removeRDFPropertyValues(RDFProperty aProperty)
Deprecated. 

Removes all property values set for the current property.

Parameters:
aProperty -

addDatatypePropertyValue

void addDatatypePropertyValue(DatatypeProperty aProperty,
                              Literal value)
                              throws InvalidValueException
Adds the value for the given Property.

Parameters:
aProperty -
value -
Throws:
InvalidValueException - This exception is thrown when a value is not compatible with the specified property's range.

removeDatatypePropertyValue

void removeDatatypePropertyValue(DatatypeProperty aProperty,
                                 Literal value)
Remove the provided value for the given property.

Parameters:
aProperty -
value -

getDatatypePropertyValues

List<Literal> getDatatypePropertyValues(DatatypeProperty aProperty)
Gets a list of values for the given Property.

Parameters:
aProperty -
Returns:
a List of Literal.

removeDatatypePropertyValues

void removeDatatypePropertyValues(DatatypeProperty aProperty)
Removes all property values set for the current property.

Parameters:
aProperty -

addObjectPropertyValue

void addObjectPropertyValue(ObjectProperty aProperty,
                            OInstance value)
                            throws InvalidValueException
Adds the value for the given property (Object, Symmetric and Transitive).

Parameters:
aProperty -
value -
Throws:
InvalidValueException - This exception is thrown when a value is not compatible with the specified property's range.

removeObjectPropertyValue

void removeObjectPropertyValue(ObjectProperty aProperty,
                               OInstance value)
Remove the provided value for the given property (Object, Symmetric and Transitive).

Parameters:
aProperty -
value -

getObjectPropertyValues

List<OInstance> getObjectPropertyValues(ObjectProperty aProperty)
Gets a list of values for the given Property (Object, Symmetric and Transitive).

Parameters:
aProperty -
Returns:
a List of OInstance.

removeObjectPropertyValues

void removeObjectPropertyValues(ObjectProperty aProperty)
Removes all property values set for the current property (Object, Symmetric and Transitive).

Parameters:
aProperty -

getSetDatatypeProperties

Set<DatatypeProperty> getSetDatatypeProperties()
This method returns the datatype properties set on this resource.

Returns:

getSetObjectProperties

Set<ObjectProperty> getSetObjectProperties()
This method returns the object properties set on this resource.

Returns:

hasDatatypePropertyWithValue

boolean hasDatatypePropertyWithValue(DatatypeProperty aProperty,
                                     Literal aValue)
Checks if the resource has the provided datatype property set on it with the specified value.

Parameters:
aProperty -
aValue -
Returns:

hasObjectPropertyWithValue

boolean hasObjectPropertyWithValue(ObjectProperty aProperty,
                                   OInstance aValue)
Checks if the resource has the provided object property set on it with the specified value.

Parameters:
aProperty -
aValue -
Returns:

getOURI

OURI getOURI()