kaos.core.csi.query
Interface QueryState

All Known Subinterfaces:
OntologyRepositoryService, OntologyService

public interface QueryState

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

Author:
KAoS Team $Revision: 1.12 $

Nested Class Summary
static class QueryState.UnknownConceptException
          UnknownConceptException defines an exception to be thrown when a provided name of the concept is not know for the ontology repository
static class QueryState.UnknownNamespaceException
          UnknownNamespaceException defines an exception to be thrown when a provided namespace is not know for the ontology repository
 
Method Summary
 boolean areClassesDisjoint(java.lang.String firstClass, java.lang.String secondClass)
          Test if two provided classes are disjoint
 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> getAllNamespaces()
          This method returns a set of urls depicting ontologies loaded into the repository as well namespaces used internally by KAoS.
 OntClassDescription getClassDesc(java.lang.String className)
           
 java.util.Set<java.lang.String> getClassesDefInNamespace(java.lang.String namespaceName)
          Get set of classes defined in the given namespace.
 java.util.Set<java.lang.String> getImmediateSubClassesOf(java.lang.String className)
          Get set of immediate subclasses of the given class (direct children of the class).
 OntInstanceDescription getIndividualDesc(java.lang.String individualName)
          Finds the Ontology description of the provided individual
 java.util.Set<java.lang.String> getInstancesDefInNamespace(java.lang.String namespaceName)
          Get set of instances defined in the given namespace.
 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> getListOfLoadedOntologies()
          This method returns a set of urls depicting ontologies loaded into the Ontology Service
 java.util.Set<java.lang.String> getNamspacesImportedByNamespace(java.lang.String namespaceName)
          Get set of namespaces imported by the given namespace.
 java.util.Set<java.lang.String> getOntologyDefinitionForConcept(java.lang.String conceptName)
          Get mapping to the urls of ontology concept for the given concept name.
 java.util.Set<java.lang.String> getOntologyTypesOfIndividual(java.lang.String individualName)
          Finds the ultimate Ontology type of the provided individual, from the ontologies explicitly loaded into repository
 java.util.List<java.lang.String> getPropertiesApplicableTo(java.lang.String className)
          Get properties applicable to the given class
 java.util.Set<java.lang.String> getPropertiesDefInNamespace(java.lang.String namespaceName)
          Get set of properties defined in the given namespace.
 java.lang.String getRangeOnPropertyForClass(java.lang.String className, java.lang.String propertyName)
          Get the name of the class defining the range of the specified property for the given class.
 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.util.Set<java.lang.String> getSubClassesOf(java.lang.String className)
          Get set of subclasses of the given class.
 java.util.Set<java.lang.String> getSubPropertiesOf(java.lang.String propertyName)
          Get set of subproperties of the given property.
 java.util.Set<java.lang.String> getSuperClassesOf(java.lang.String className)
          Get set of superclasses of the given class.
 java.util.Set<java.lang.String> getSuperPropertiesOf(java.lang.String propertyName)
          Get set of super properties of the given property.
 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 subject, java.lang.String predicate, java.lang.String object)
          Test if triple is true according to the ontologies in the ontology repository.
 

Method Detail

getListOfLoadedOntologies

java.util.Set<java.lang.String> getListOfLoadedOntologies()
                                                          throws DirectoryFailure
This method returns a set of urls depicting ontologies loaded into the Ontology Service

Throws:
DirectoryFailure

getAllNamespaces

java.util.Set<java.lang.String> getAllNamespaces()
                                                 throws DirectoryFailure
This method returns a set of urls depicting ontologies loaded into the repository as well namespaces used internally by KAoS.

Throws:
DirectoryFailure

testTrue

boolean testTrue(java.lang.String subject,
                 java.lang.String predicate,
                 java.lang.String object)
                 throws OntologyService.ReasoningException,
                        QueryState.UnknownConceptException,
                        DirectoryFailure
Test if triple is true according to the ontologies in the ontology repository.

Parameters:
subject - of the triple
predicate - of the triple
object - of the triple
Returns:
true if the triple is true and false in the opposite case
Throws:
OntologyService.ReasoningException - if reasoning failed.
QueryState.UnknownConceptException
DirectoryFailure

askQuery

java.util.Set<java.lang.String> askQuery(java.lang.String variableName,
                                         java.lang.String multiplyVariablesQuery)
                                         throws OntologyService.ReasoningException,
                                                DirectoryFailure
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:
OntologyService.ReasoningException - if reasoning failed.
DirectoryFailure

getUniqueValueForProperty

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

Parameters:
property - the name of the property
subject - the name of the subject
Returns:
a single value for the property on this subject
Throws:
OntologyService.ReasoningException - if reasoning failed.
QueryState.UnknownConceptException
DirectoryFailure

getValuesForProperty

java.util.Set<java.lang.String> getValuesForProperty(java.lang.String property,
                                                     java.lang.String subjectStr)
                                                     throws OntologyService.ReasoningException,
                                                            QueryState.UnknownConceptException,
                                                            DirectoryFailure
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:
OntologyService.ReasoningException - if reasoning failed.
QueryState.UnknownConceptException
DirectoryFailure

getResourcesWithValueForProperty

java.util.Set<java.lang.String> getResourcesWithValueForProperty(java.lang.String property,
                                                                 java.lang.String value)
                                                                 throws OntologyService.ReasoningException,
                                                                        QueryState.UnknownConceptException,
                                                                        DirectoryFailure
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:
OntologyService.ReasoningException - if reasoning failed.
QueryState.UnknownConceptException
DirectoryFailure

getPropertiesApplicableTo

java.util.List<java.lang.String> getPropertiesApplicableTo(java.lang.String className)
                                                           throws OntologyService.ReasoningException,
                                                                  QueryState.UnknownConceptException,
                                                                  DirectoryFailure
Get properties applicable to the given class

Parameters:
className - the name of the class
Returns:
vector of properties names
Throws:
OntologyService.ReasoningException - if reasoning failed.
QueryState.UnknownConceptException
DirectoryFailure

getRangeOnPropertyForClass

java.lang.String getRangeOnPropertyForClass(java.lang.String className,
                                            java.lang.String propertyName)
                                            throws OntologyService.ReasoningException,
                                                   QueryState.UnknownConceptException,
                                                   DirectoryFailure
Get the name of the class defining the range of the specified property for the given class.

Parameters:
className - the name of the class
propertyName - the name of the property
Returns:
the name of the class defining the range
Throws:
OntologyService.ReasoningException - if reasoning failed.
QueryState.UnknownConceptException
DirectoryFailure

getClassDesc

OntClassDescription getClassDesc(java.lang.String className)
                                 throws QueryState.UnknownConceptException,
                                        DirectoryFailure,
                                        OntologyService.ReasoningException
Throws:
QueryState.UnknownConceptException
DirectoryFailure
OntologyService.ReasoningException

getIndividualDesc

OntInstanceDescription getIndividualDesc(java.lang.String individualName)
                                         throws QueryState.UnknownConceptException,
                                                DirectoryFailure
Finds the Ontology description of the provided individual

Parameters:
individualName - the name of the individual
Returns:
OntInstanceDescription
Throws:
QueryState.UnknownConceptException - if concept unknown
DirectoryFailure

getOntologyTypesOfIndividual

java.util.Set<java.lang.String> getOntologyTypesOfIndividual(java.lang.String individualName)
                                                             throws QueryState.UnknownConceptException,
                                                                    DirectoryFailure
Finds the ultimate Ontology type of the provided individual, from the ontologies explicitly loaded into repository

Parameters:
individualName - the name of the individual
Returns:
the vector of names of the Ontology classes being the most narrow ones for the given individual
Throws:
QueryState.UnknownConceptException - if concept unknown
DirectoryFailure

getInstancesOf

java.util.Set<java.lang.String> getInstancesOf(java.lang.String conceptName)
                                               throws QueryState.UnknownConceptException,
                                                      DirectoryFailure
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 in the Jena format
Returns:
Set of instance ids in the Jena format
Throws:
QueryState.UnknownConceptException - if forActor is unknown for the ontology repository
DirectoryFailure

getSuperClassesOf

java.util.Set<java.lang.String> getSuperClassesOf(java.lang.String className)
                                                  throws QueryState.UnknownConceptException,
                                                         DirectoryFailure
Get set of superclasses of the given class.

Parameters:
className - The name of the class in Jena format
Returns:
Set of superclasses names in Jena format
Throws:
QueryState.UnknownConceptException - if className is unknown for the ontology repository
DirectoryFailure

getSubClassesOf

java.util.Set<java.lang.String> getSubClassesOf(java.lang.String className)
                                                throws QueryState.UnknownConceptException,
                                                       DirectoryFailure
Get set of subclasses of the given class.

Parameters:
className - The name of the class in Jena format
Returns:
Set of subclasses names in Jena format
Throws:
QueryState.UnknownConceptException - if className is unknown for the ontology repository
DirectoryFailure

getImmediateSubClassesOf

java.util.Set<java.lang.String> getImmediateSubClassesOf(java.lang.String className)
                                                         throws QueryState.UnknownConceptException,
                                                                DirectoryFailure
Get set of immediate subclasses of the given class (direct children of the class).

Parameters:
className - The name of the class in Jena format
Returns:
Set of subclasses names in Jena format
Throws:
QueryState.UnknownConceptException
QueryState.UnknownConceptException - if className is unknown for the ontology repository
DirectoryFailure

getSuperPropertiesOf

java.util.Set<java.lang.String> getSuperPropertiesOf(java.lang.String propertyName)
                                                     throws QueryState.UnknownConceptException,
                                                            DirectoryFailure
Get set of super properties of the given property.

Parameters:
propertyName - The name of the property in Jena format
Returns:
Set of super properties names in Jena format
Throws:
QueryState.UnknownNamespaceException - if propertyName is unknown for the ontology repository
QueryState.UnknownConceptException
DirectoryFailure

getSubPropertiesOf

java.util.Set<java.lang.String> getSubPropertiesOf(java.lang.String propertyName)
                                                   throws QueryState.UnknownConceptException,
                                                          DirectoryFailure
Get set of subproperties of the given property.

Parameters:
propertyName - The name of the property in Jena format
Returns:
Set of subproperties names in Jena format
Throws:
QueryState.UnknownNamespaceException - if propertyName is unknown for the ontology repository
QueryState.UnknownConceptException
DirectoryFailure

areClassesDisjoint

boolean areClassesDisjoint(java.lang.String firstClass,
                           java.lang.String secondClass)
                           throws OntologyService.ReasoningException,
                                  DirectoryFailure,
                                  QueryState.UnknownConceptException
Test if two provided classes are disjoint

Parameters:
firstClass - the name of the first class
secondClass - the name of the second class
Returns:
true if the classes are not disjoint
Throws:
QueryState.UnknownConceptException
OntologyService.ReasoningException
DirectoryFailure

getClassesDefInNamespace

java.util.Set<java.lang.String> getClassesDefInNamespace(java.lang.String namespaceName)
                                                         throws QueryState.UnknownNamespaceException,
                                                                DirectoryFailure
Get set of classes defined in the given namespace.

Parameters:
namespaceName - The name of the namespace in the Jena format
Returns:
Set of classes names in the Jena format
Throws:
QueryState.UnknownNamespaceException - if namespaceName is unknown for the ontology repository
DirectoryFailure

getPropertiesDefInNamespace

java.util.Set<java.lang.String> getPropertiesDefInNamespace(java.lang.String namespaceName)
                                                            throws QueryState.UnknownNamespaceException,
                                                                   DirectoryFailure
Get set of properties defined in the given namespace.

Parameters:
namespaceName - The name of the namespace in the Jena format
Returns:
Set of properties names in the Jena format
Throws:
QueryState.UnknownNamespaceException - if namespaceName is unknown for the ontology repository
DirectoryFailure

getInstancesDefInNamespace

java.util.Set<java.lang.String> getInstancesDefInNamespace(java.lang.String namespaceName)
                                                           throws QueryState.UnknownNamespaceException,
                                                                  DirectoryFailure
Get set of instances defined in the given namespace.

Parameters:
namespaceName - The name of the namespace in the Jena format
Returns:
Set of instances names in the Jena format
Throws:
QueryState.UnknownNamespaceException - if namespaceName is unknown for the ontology repository
DirectoryFailure

getNamspacesImportedByNamespace

java.util.Set<java.lang.String> getNamspacesImportedByNamespace(java.lang.String namespaceName)
                                                                throws QueryState.UnknownNamespaceException,
                                                                       DirectoryFailure
Get set of namespaces imported by the given namespace.

Parameters:
namespaceName - The name of the namespace in the Jena format
Returns:
Set of namespaces names in the Jena format
Throws:
QueryState.UnknownNamespaceException - if namespaceName is unknown for the ontology repository
DirectoryFailure

getOntologyDefinitionForConcept

java.util.Set<java.lang.String> getOntologyDefinitionForConcept(java.lang.String conceptName)
                                                                throws QueryState.UnknownNamespaceException,
                                                                       DirectoryFailure
Get mapping to the urls of ontology concept for the given concept name. Currently, it tries to match the concept name with the local name of the ontology definitions url.

Parameters:
conceptName - The name of the namespace in the Jena format
Returns:
Set of ontology definition url potentially matching the search concept
Throws:
QueryState.UnknownNamespaceException
DirectoryFailure


Copyright © 2006 IHMC All Rights Reserved.