kaos.spatial
Interface SpatialQuery

All Known Implementing Classes:
SpatialReasoner

public interface SpatialQuery

This interface defines methods to query spatial relations between known objects. Currently the qualitative information are returned.


Method Summary
 java.util.Vector<Location3D> findLocationReferencedBy(java.lang.String relationName, java.lang.String subjectObjectID, java.lang.String referenceObjectID, double distance)
          This method returns a location of the subject object which is in the given relation with the reference object
 java.util.Vector findObjectsInRelation(java.util.Vector relationNames, java.lang.String subjectObjectID, float maxDistance)
          This method returns a vector of the IDs of objects being in the specified relation to the subject object, but in the specified maximum distance.
 java.util.Vector findObjectsInRelationReferencedBy(java.util.Vector relationNames, java.lang.String subjectObjectID, java.lang.String referenceObjectID, float maxDistance)
          This method returns objects being in the specified relations to the subject object in regards to the referenced object, but in the specified maximum distance.
 java.util.Vector findSpatialRelationsBetween(java.lang.String subjectObjectID, java.lang.String relatedObjectID)
          This method returns spatial relations between two objects from the perspective of the first subject object.
 java.util.Vector findSpatialRelationsReferencedBy(java.lang.String subjectObjectID, java.lang.String relatedObjectID, java.lang.String referencedObjectID)
          This method returns spatial relations between two objects from the perspective of the first subject object in regards to the reference object.
 java.util.Vector<Location3D> findSpecificSideOfObject(java.lang.String objectID, java.lang.String sideOrientation)
          This method finds the alternative name of the spatial object.
 double getDistanceBetween(java.lang.String subjectObjectID, java.lang.String relatedObjectID)
          This method returns a value of the distance between two objects
 double getValueOfOrientationRelation(java.lang.String relationName, java.lang.String subjectObjectID, java.lang.String relatedObjectID)
          This method returns a value of rotation, in radius, requqired to directly face the given object being in the given initial spatial relation It is important to remember that this value is calculated based on the orientation and location associated with the subject object.
 boolean testSpatialRelationBetween(java.lang.String relationName, java.lang.String subjectObjectID, java.lang.String relatedObjectID)
          This method tests the given spatial relation between two objects from the perspective of the subject object.
 boolean testSpatialRelationsReferencedBy(java.lang.String relationName, java.lang.String relatedObjectID, java.lang.String subjectObjectID, java.lang.String referencedObjectID)
          This method test spatial relation between two objects from the perspective of the subject object in regards to the referenced object.
 

Method Detail

findSpatialRelationsBetween

java.util.Vector findSpatialRelationsBetween(java.lang.String subjectObjectID,
                                             java.lang.String relatedObjectID)
                                             throws NotRegisteredException
This method returns spatial relations between two objects from the perspective of the first subject object. For instance it can find: That in relation to the subject the related object is on the right and down. It is important to remember that these relations are calculated based on the orientation and location associated with the subject object.

Parameters:
subjectObjectID - - id of the subject object
relatedObjectID - - id of the related object
Returns:
Vector - containing found relations URI in the OWL ontology file(s) to the relations defitions (the object, for instance, can be in the up and on the left relations)
Throws:
NotRegisteredException - when the objects are not registered in spatial database

testSpatialRelationBetween

boolean testSpatialRelationBetween(java.lang.String relationName,
                                   java.lang.String subjectObjectID,
                                   java.lang.String relatedObjectID)
                                   throws NotRegisteredException,
                                          UnknownConceptException
This method tests the given spatial relation between two objects from the perspective of the subject object. For instance it can test If the related object is on the left to the subject. It is important to remember that these relations are calculated based on the orientation and location associated with the subject object.

Parameters:
relationName - - URI in the OWL ontology file to the relation definition to be tested, for instance: inside, on-the-left, etc.
subjectObjectID - - id of the subject object
relatedObjectID - - id of the related object
Returns:
true - if the objects are in the tested relation
Throws:
NotRegisteredException - when the objects are not registered in spatial database
UnknownConceptException - when the spatial relation is unknown

findObjectsInRelation

java.util.Vector findObjectsInRelation(java.util.Vector relationNames,
                                       java.lang.String subjectObjectID,
                                       float maxDistance)
                                       throws NotRegisteredException,
                                              UnknownConceptException
This method returns a vector of the IDs of objects being in the specified relation to the subject object, but in the specified maximum distance. For instance, it can return: All the object being on the left and up to the subject, but not further then 20 meters or All the object in the subject space (teh subject depicts some block of space). It is important to remember that these relations are calculated based on the orientation and location associated with the subject object.

Parameters:
relationNames - - URIs in the OWL ontology file(s) to the relation definition, for instance left, down, etc.
subjectObjectID - - id of the subject object
maxDistance - - meximum distance of the search
Returns:
Vector - containing ids of the found objects
Throws:
NotRegisteredException - when the subject is not registered in the spatial database
UnknownConceptException - when the spatial relation is unknown

getValueOfOrientationRelation

double getValueOfOrientationRelation(java.lang.String relationName,
                                     java.lang.String subjectObjectID,
                                     java.lang.String relatedObjectID)
                                     throws NotRegisteredException,
                                            UnknownConceptException,
                                            UnsatisfiedOrientationRelation
This method returns a value of rotation, in radius, requqired to directly face the given object being in the given initial spatial relation It is important to remember that this value is calculated based on the orientation and location associated with the subject object.

Parameters:
relationName - - URI in the OWL ontology file to the relation definition, for instance left, down, etc.
subjectObjectID - - id of the subject object
relatedObjectID - - id of the related object
Returns:
double - represents an angle of orientation difference in radians
Throws:
NotRegisteredException - when the subject is not registered in the spatial database
UnknownConceptException - when the spatial relation is unknown
UnsatisfiedRelation - when the spatial relation is not satisfied by objects
UnsatisfiedOrientationRelation

getDistanceBetween

double getDistanceBetween(java.lang.String subjectObjectID,
                          java.lang.String relatedObjectID)
                          throws NotRegisteredException
This method returns a value of the distance between two objects

Parameters:
subjectObjectID - - id of the subject object
relatedObjectID - - id of the related object
Returns:
double - represents an angle of orientation difference in radians
Throws:
NotRegisteredException - when the subject is not registered in the spatial database

findSpatialRelationsReferencedBy

java.util.Vector findSpatialRelationsReferencedBy(java.lang.String subjectObjectID,
                                                  java.lang.String relatedObjectID,
                                                  java.lang.String referencedObjectID)
                                                  throws NotRegisteredException
This method returns spatial relations between two objects from the perspective of the first subject object in regards to the reference object. For instance it can find: That in relation to the subject the related object is further-right and less-down than the referenced object or that it is further than the referenced object. It is important to remember that these relations are calculated based on the orientation and location associated with the subject object.

Parameters:
subjectObjectID - - id of the subject object
relatedObjectID - - id of the related object
referencedObjectID - - id of the reference object
Returns:
Vector - containing found relations URI in OWL ontology (the objects can be, for instance, further-up and less-left relations)
Throws:
NotRegisteredException - when the objects are not registered in the spatial database

testSpatialRelationsReferencedBy

boolean testSpatialRelationsReferencedBy(java.lang.String relationName,
                                         java.lang.String relatedObjectID,
                                         java.lang.String subjectObjectID,
                                         java.lang.String referencedObjectID)
                                         throws NotRegisteredException,
                                                UnknownConceptException
This method test spatial relation between two objects from the perspective of the subject object in regards to the referenced object. For instance it can test: If the related object is further-left to the subject than the referenced object, or if it is simple further than the referenced object. It is important to remember that these relations are calculated based on the orientation and location associated with the subject object.

Parameters:
relationName - - URI in the OWL ontology file to the relation definition to be tested, for instance further-left, less-down, etc.
relatedObjectID - - id of the related object
subjectObjectID - - id of the subject object
referencedObjectID - - id of the referenced object
Returns:
true - if the objects are in the tested relations
Throws:
NotRegisteredException - when the objects are not registered in spatial database
UnknownConceptException - when the spatial relation is unknown

findObjectsInRelationReferencedBy

java.util.Vector findObjectsInRelationReferencedBy(java.util.Vector relationNames,
                                                   java.lang.String subjectObjectID,
                                                   java.lang.String referenceObjectID,
                                                   float maxDistance)
                                                   throws NotRegisteredException,
                                                          UnknownConceptException
This method returns objects being in the specified relations to the subject object in regards to the referenced object, but in the specified maximum distance. For instance, it can return: All the object beign further-left and less-up to the subject than the referenced object, but not further then 20 meters. It is important to remember that these relations are calculated based on the orientation and location associated with the subject object.

Parameters:
relationNames - - URIs in the OWL ontology file(s) to the relation definition, for instance further-left, less-down, etc.
subjectObjectID - - id of the subject object
referencedObjectID - - id of the reference object
maxDistance - - maximum distance of the search
Returns:
Vector - containing ids of the found objects
Throws:
NotRegisteredException - when the objects are not registered in spatial database
UnknownConceptException - when the spatial relation is unknown

findLocationReferencedBy

java.util.Vector<Location3D> findLocationReferencedBy(java.lang.String relationName,
                                                      java.lang.String subjectObjectID,
                                                      java.lang.String referenceObjectID,
                                                      double distance)
                                                      throws NotRegisteredException,
                                                             UnknownConceptException
This method returns a location of the subject object which is in the given relation with the reference object

Parameters:
relationName - - URI of relation definition, for instance left, behind, etc.
subjectObjectID - - id of the subject object
referencedObjectID - - id of the reference object
distance - - the distance of the object outside
Returns:
Vector - containing location on the found side of the object (midpoint), the norma wector (as the second location) and the point outside the object in the given distance (as the third location)
Throws:
NotRegisteredException - when the objects are not registered in spatial database
UnknownConceptException - when the spatial relation is unknown

findSpecificSideOfObject

java.util.Vector<Location3D> findSpecificSideOfObject(java.lang.String objectID,
                                                      java.lang.String sideOrientation)
                                                      throws NotRegisteredException
This method finds the alternative name of the spatial object.

Parameters:
objectID - - id of the object
sideOrientation - - the orientation of the searched side return Vector - vector containg locations of the ends of the found side
Throws:
NotRegisteredException - when the object is not registered in the spatial database