kaos.core.csi.query
Interface QueryState

All Known Implementing Classes:
QueryStateImpl

public interface QueryState

Defines the operations to query the different aspect of state stored in the Directory Service

Author:
KAoS Team $Revision: 1.6 $

Method Summary
 java.util.Set<java.lang.String> askQuery(java.lang.String variableName, java.lang.String multiplyVariablesQuery)
          Get values of the selected variable satisfying the KIF query with possibly many variable.
 java.util.Set<java.lang.String> getInstancesOf(java.lang.String conceptName)
          Get set of instances of the given concept; if the concept is an instance itself the set contains just this instance.
 java.util.Set<java.lang.String> getResourcesWithValueForProperty(java.lang.String property, java.lang.String value)
          Get values of the variable satisfying the KIF query: (property ?subject value).
 java.lang.String getUniqueValueForProperty(java.lang.String property, java.lang.String subject)
          Get a single value of the variable satisfying the KIF query: (property subject ?val).
 java.util.Set<java.lang.String> getValuesForProperty(java.lang.String property, java.lang.String subjectStr)
          Get values of the variable satisfying the KIF query: (property subject ?val).
 boolean testTrue(java.lang.String statement)
          Test if the KIF statement is true according to the ontologies in the ontology repository.
 

Method Detail

testTrue

boolean testTrue(java.lang.String statement)
                 throws DirectoryFailure,
                        QueryFailure
Test if the KIF statement is true according to the ontologies in the ontology repository.

Parameters:
statement - to be tested for truth
Returns:
true if the statement is true and false in the opposite case
Throws:
DirectoryFailure - if the connection to the DS cannot be established
QueryFailure - if query failed

askQuery

java.util.Set<java.lang.String> askQuery(java.lang.String variableName,
                                         java.lang.String multiplyVariablesQuery)
                                         throws DirectoryFailure,
                                                QueryFailure
Get values of the selected variable satisfying the KIF query with possibly many variable.

Parameters:
variableName - the name of the selected variable
multiplyVariablesQuery - the query
Returns:
a set with values satisfying the query
Throws:
DirectoryFailure - if the connection to the DS cannot be established
QueryFailure - if query failed.

getInstancesOf

java.util.Set<java.lang.String> getInstancesOf(java.lang.String conceptName)
                                               throws DirectoryFailure,
                                                      UnknownConceptException
Get set of instances of the given concept; if the concept is an instance itself the set contains just this instance.

Parameters:
conceptName - The name of the concept
Returns:
Set of instance ids
Throws:
DirectoryFailure - if the connection to the DS cannot be established
UnknownConceptException - if conceptName is unknown

getUniqueValueForProperty

java.lang.String getUniqueValueForProperty(java.lang.String property,
                                           java.lang.String subject)
                                           throws DirectoryFailure,
                                                  QueryFailure
Get a single value of the variable satisfying the KIF query: (property subject ?val).

Parameters:
property - String containing the name of the property.
subject - String containing the name of the subject.
Returns:
String containing the single value for the property on this subject.
Throws:
DirectoryFailure - if the connection to the DS cannot be established.
QueryFailure - if reasoning failed.

getValuesForProperty

java.util.Set<java.lang.String> getValuesForProperty(java.lang.String property,
                                                     java.lang.String subjectStr)
                                                     throws DirectoryFailure,
                                                            QueryFailure
Get values of the variable satisfying the KIF query: (property subject ?val).

Parameters:
property - the name of the property
subjectStr - the name of the subject
Returns:
a set with values for the property on this subject
Throws:
QueryFailure
DirectoryFailure

getResourcesWithValueForProperty

java.util.Set<java.lang.String> getResourcesWithValueForProperty(java.lang.String property,
                                                                 java.lang.String value)
                                                                 throws DirectoryFailure,
                                                                        QueryFailure
Get values of the variable satisfying the KIF query: (property ?subject value).

Parameters:
property - the name of the property
value - the value
Returns:
a set with name of subjects which has the specified value for the given property
Throws:
QueryFailure
DirectoryFailure