kaos.ontology.management
Interface OntologyRepositoryService

All Superinterfaces:
OntologyService
All Known Subinterfaces:
DirectoryService
All Known Implementing Classes:
CorbaAgentDirectoryServiceProxy, CougaarAgentDirectoryServiceProxy, DirectoryServiceProxy, GridAgentDirectoryServiceProxy, GridDirectoryServicePolicyCert, KAoSAgentDirectoryServiceProxy, KAoSDirectoryService, TCPAgentDirectoryServiceProxy, TunnelClient

public interface OntologyRepositoryService
extends OntologyService

Defines the operations enabling loading and managing ontologies in the ontology repository. Currently the interface enables only addition of ontologies. This should be update in the future with method enabling removing of the ontology and restarting the repository

Version:
1.0 $Revision: 1.28 $
Author:
KAoS Team

Method Summary
 void addFilteredNamespace(java.lang.String namespace)
          This method add a namespace to the set of urls depicting ontology namespaces concept of which are filtered out when returned by methods of this repository.
 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 JTP as well namespaces used internally by KAoS.
 java.util.Set<java.lang.String> getClassesDefInNamespace(java.lang.String namespaceName)
          Get set of classes defined in the given namespace.
 SerializableOntModelImpl getConstructedOntologyStructure(java.lang.String structureId)
          This method get stored ontology structure references by its id in the repository.
 java.util.List<SerializableOntModelImpl> getConstructedOntologyStructures()
          This method retrieves all user defined ontology structures in the repository.
 java.util.Set<java.lang.String> getFilteredNamespaces()
          This method returns a set of urls depicting ontology namespaces concept of which are filtered out when returned by methods of this repository.
 java.util.Set<java.lang.String> getImmediateSubClassesOf(java.lang.String className)
          Get set of immediate subclasses of the given class.
 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> getNamspacesImportedByNamespace(java.lang.String namespaceName)
          Get set of namespaces imported by the given namespace.
 java.util.List<java.lang.String> getPropertiesApplicableTo(java.lang.String className)
          Get set of properties defined in the given namespace.
 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> 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 superproperties of the given property.
 java.util.Set<java.lang.String> getUltimateOntologyTypesOfIndividual(java.lang.String individualName)
          Finds the ultimate Ontology type of the provided individual
 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 subject)
          Get values of the variable satisfying the KIF query: (property subject ?val).
 void loadOntologies(java.util.List<SerializableOntModelImpl> myOntModels, boolean recursiveLoad)
          Adds ontology included in the provide objects into the ontology repository.
 void loadOntology(SerializableOntModelImpl myOntModel, boolean recursiveLoad)
          Adds ontology included in the provide objects into the ontology repository.
 void loadOntology(java.lang.String myURL, boolean recursiveLoad)
          Loads ontology from the provided url.
 void putConstructedOntologyStructures(java.util.List<SerializableOntModelImpl> ontologyStructureList)
          This method stores multiple ontology structures in the repository.
 void removeFilteredNamespace(java.lang.String namespace)
          This method remove a namespace from the set of urls depicting ontology namespaces concept of which are filtered out when returned by methods of this repository.
 boolean testTrue(java.lang.String statement)
          Test if the KIF statemant is true according to the ontologies in the ontology repository.
 
Methods inherited from interface kaos.core.csi.ontology.OntologyService
getListOfLoadedOntologies, getOntologyDefinitionForConcept, getSchema, getSubPropertiesOf, initiateActionClassTargets, loadOntology, putSchema, removeConstructedOntologyStructure, removeConstructedOntologyStructures
 

Method Detail

getAllNamespaces

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

Throws:
DirectoryFailure

getFilteredNamespaces

java.util.Set<java.lang.String> getFilteredNamespaces()
                                                      throws DirectoryFailure
This method returns a set of urls depicting ontology namespaces concept of which are filtered out when returned by methods of this repository.

Throws:
DirectoryFailure

addFilteredNamespace

void addFilteredNamespace(java.lang.String namespace)
                          throws DirectoryFailure
This method add a namespace to the set of urls depicting ontology namespaces concept of which are filtered out when returned by methods of this repository.

Parameters:
namespace - The name of the namespace
Throws:
DirectoryFailure

removeFilteredNamespace

void removeFilteredNamespace(java.lang.String namespace)
                             throws DirectoryFailure
This method remove a namespace from the set of urls depicting ontology namespaces concept of which are filtered out when returned by methods of this repository.

Parameters:
namespace - The name of the namespace
Throws:
DirectoryFailure

getConstructedOntologyStructures

java.util.List<SerializableOntModelImpl> getConstructedOntologyStructures()
                                                                          throws DirectoryFailure
This method retrieves all user defined ontology structures in the repository.

Specified by:
getConstructedOntologyStructures in interface OntologyService
Returns:
list containing SerializableOntModelImpl objects
Throws:
DirectoryFailure

putConstructedOntologyStructures

void putConstructedOntologyStructures(java.util.List<SerializableOntModelImpl> ontologyStructureList)
                                      throws OntologyRepository.ReasoningException,
                                             java.io.IOException,
                                             DirectoryFailure
This method stores multiple ontology structures in the repository.

Parameters:
ontologyStructureList - a list containing SerializableOntModelImpl objects.
Throws:
ReasoningException, - IOException, DirectoryFailure when putting of the ontology structures failed.
OntologyRepository.ReasoningException
java.io.IOException
DirectoryFailure

getConstructedOntologyStructure

SerializableOntModelImpl getConstructedOntologyStructure(java.lang.String structureId)
                                                         throws OntologyRepository.ReasoningException,
                                                                UnknownConceptException,
                                                                java.io.IOException,
                                                                DirectoryFailure
This method get stored ontology structure references by its id in the repository.

Specified by:
getConstructedOntologyStructure in interface OntologyService
Parameters:
structureId - ontology structure id
Returns:
SerializableOntModelImpl object
Throws:
OntologyRepository.ReasoningException - or IOException when loading of the ontology failed.
structureId - when the id is not registered.
UnknownConceptException
java.io.IOException
DirectoryFailure

loadOntology

void loadOntology(SerializableOntModelImpl myOntModel,
                  boolean recursiveLoad)
                  throws OntologyRepository.ReasoningException,
                         java.io.IOException
Adds ontology included in the provide objects into the ontology repository.

Specified by:
loadOntology in interface OntologyService
Parameters:
myOntModel - The object of type SerializableOntModelImpl containing the added ontology
recursiveLoad - Indicates if the imported ontologies (by the ontology contained in myOntModel) should also be recursively loaded.
Throws:
jtp.InconsistencyException - when loading of the ontology failed.
OntologyRepository.ReasoningException
java.io.IOException

loadOntologies

void loadOntologies(java.util.List<SerializableOntModelImpl> myOntModels,
                    boolean recursiveLoad)
                    throws OntologyRepository.ReasoningException,
                           java.io.IOException
Adds ontology included in the provide objects into the ontology repository.

Specified by:
loadOntologies in interface OntologyService
Parameters:
myOntModel - The object of type SerializableOntModelImpl containing the added ontology
recursiveLoad - Indicates if the imported ontologies (by the ontology contained in myOntModel) should also be recursively loaded.
Throws:
jtp.InconsistencyException - when loading of the ontology failed.
OntologyRepository.ReasoningException
java.io.IOException

loadOntology

void loadOntology(java.lang.String myURL,
                  boolean recursiveLoad)
                  throws OntologyRepository.ReasoningException,
                         java.io.IOException,
                         DirectoryFailure
Loads ontology from the provided url.

Specified by:
loadOntology in interface OntologyService
Parameters:
myURL - The url to the ontology
recursiveLoad - Indicates if the imported ontologies (by the ontology depicted by myURL) should also be recursively loaded.
Throws:
jtp.InconsistencyException - when loading of the ontology failed.
OntologyRepository.ReasoningException - when loading of the ontology failed.
java.io.IOException
DirectoryFailure

getInstancesOf

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

Specified by:
getInstancesOf in interface OntologyService
Parameters:
conceptName - The name of the concept in the Jena format
Returns:
Set of instance ids in the Jena format
Throws:
UnknownConceptException - if conceptName is unknown for the ontology repository
DirectoryFailure

getSuperClassesOf

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

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

getSubClassesOf

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

Specified by:
getSubClassesOf in interface OntologyService
Parameters:
className - The name of the class in Jena format
Returns:
Set of subclasses names in Jena format
Throws:
UnknownConceptException - if className is unknown for the ontology repository
DirectoryFailure

getImmediateSubClassesOf

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

Specified by:
getImmediateSubClassesOf in interface OntologyService
Parameters:
className - The name of the class in Jena format
Returns:
Set of subclasses names in Jena format
Throws:
UnknownConceptException - if className is unknown for the ontology repository
DirectoryFailure

getSuperPropertiesOf

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

Specified by:
getSuperPropertiesOf in interface OntologyService
Parameters:
propertyName - The name of the property in Jena format
Returns:
Set of superproperties names in Jena format
Throws:
java.lang.Exception - if propertyName is unknown for the ontology repository
UnknownConceptException
DirectoryFailure

testTrue

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

Specified by:
testTrue in interface OntologyService
Parameters:
statement - to test
Returns:
true if the statement is true and false in the opposite case
Throws:
QueryFailure - if reasoning failed.
DirectoryFailure

getUniqueValueForProperty

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

Parameters:
property - the name of the property in the Jena format
subject - the name of the subject in the Jena format
Returns:
a single value (as string in the Jena format) for the property on this subject
Throws:
QueryFailure - if reasoning failed.
DirectoryFailure

getValuesForProperty

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

Specified by:
getValuesForProperty in interface OntologyService
Parameters:
property - the name of the property in the Jena format
subject - the name of the subject in the Jena format
Returns:
a set with values (as string in the Jena format) for the property on this subject
Throws:
QueryFailure - if reasoning failed.
DirectoryFailure

getResourcesWithValueForProperty

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

Parameters:
property - the name of the property in the Jena format
value - the value as a string in th Jena format
Returns:
a set with name of subjects (in the Jena format) which have the specified value for the given property
Throws:
QueryFailure - if reasoning failed.
DirectoryFailure

getPropertiesApplicableTo

java.util.List<java.lang.String> getPropertiesApplicableTo(java.lang.String className)
                                                           throws QueryFailure,
                                                                  UnknownConceptException,
                                                                  DirectoryFailure
Get set of properties defined in the given namespace.

Specified by:
getPropertiesApplicableTo in interface OntologyService
Parameters:
className - the name of the class
Returns:
set of properties names
Throws:
UnknownConceptException - if className is unknow for the ontology repository
QueryFailure
DirectoryFailure

getRangeOnPropertyForClass

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

Specified by:
getRangeOnPropertyForClass in interface OntologyService
Parameters:
className - the name of the class
propertyName - the name of the property
Returns:
the name of the class defining the range
Throws:
UnknownConceptException - if reasoning failed.
QueryFailure
DirectoryFailure

askQuery

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

areClassesDisjoint

boolean areClassesDisjoint(java.lang.String firstClass,
                           java.lang.String secondClass)
                           throws QueryFailure,
                                  DirectoryFailure
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:
QueryFailure - if reasoning failed.
DirectoryFailure

getClassesDefInNamespace

java.util.Set<java.lang.String> getClassesDefInNamespace(java.lang.String namespaceName)
                                                         throws 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:
UnknownNamespaceException - if namespaceName is unknown for the ontology repository
DirectoryFailure

getUltimateOntologyTypesOfIndividual

java.util.Set<java.lang.String> getUltimateOntologyTypesOfIndividual(java.lang.String individualName)
                                                                     throws UnknownConceptException,
                                                                            DirectoryFailure
Finds the ultimate Ontology type of the provided individual

Specified by:
getUltimateOntologyTypesOfIndividual in interface OntologyService
Parameters:
individualName - the name of the individual
Returns:
the set of names of the Ontology classes being the most narrow ones for the given individual
Throws:
UnknownConceptException - if concept unknown or any problem with JTP approached
DirectoryFailure

getPropertiesDefInNamespace

java.util.Set<java.lang.String> getPropertiesDefInNamespace(java.lang.String namespaceName)
                                                            throws 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:
UnknownNamespaceException - if namespaceName is unknown for the ontology repository
DirectoryFailure

getInstancesDefInNamespace

java.util.Set<java.lang.String> getInstancesDefInNamespace(java.lang.String namespaceName)
                                                           throws 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:
UnknownNamespaceException - if namespaceName is unknown for the ontology repository
DirectoryFailure

getNamspacesImportedByNamespace

java.util.Set<java.lang.String> getNamspacesImportedByNamespace(java.lang.String namespaceName)
                                                                throws 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:
UnknownNamespaceException - if namespaceName is unknown for the ontology repository
DirectoryFailure