kaos.ontology.management
Interface OntologyRepositoryService

All Known Subinterfaces:
DirectoryService
All Known Implementing Classes:
GridDirectoryServicePolicyCert, KAoSDirectoryService, TunnelClient

public interface OntologyRepositoryService

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


Method Summary
 void addFilteredNamespace(java.lang.String namespace)
          This method add a nemaspace 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 askQuery(java.lang.String variableName, java.lang.String multiplyVariablesQuery)
          Get values of the selected variable satisfing the KIF query with possibly many variable.
 java.util.Set getAllNamespaces()
          This method returns a set of urls depicting ontologies loaded into the JTP as well namespaces used internally by KAoS.
 java.util.Set getClassesDefInNamespace(java.lang.String namespaceName)
          Get set of classes defined in the given namespace.
 java.util.List getConstructedOntologyStructures()
          This method retrieves all user defined ontlogy structures in the repositiry.
 java.util.Set 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 getInstancesDefInNamespace(java.lang.String namespaceName)
          Get set of instances defined in the given namespace.
 java.util.Set 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 getListOfLoadedOntologies()
          This method returns a set of urls depicting ontologies loaded into the JTP.
 java.util.Set getNamspacesImportedByNamespace(java.lang.String namespaceName)
          Get set of namspaces imported by the given namespace.
 java.util.Vector getPropertiesApplicableTo(java.lang.String className)
          Get set of properties defined in the given namespace.
 java.util.Set 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 getResourcesWithValueForProperty(java.lang.String property, java.lang.String value)
          Get values of the variable satisfing the KIF query: (property ?subject value).
 java.util.Set getSubClassesOf(java.lang.String className)
          Get set of subclasses of the given class.
 java.util.Set getSuperClassesOf(java.lang.String className)
          Get set of superclasses of the given class.
 java.util.Set getSuperPropertiesOf(java.lang.String propertyName)
          Get set of superproperties of the given property.
 java.util.Set 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 satisfing the KIF query: (property subject ?val).
 java.util.Set getValuesForProperty(java.lang.String property, java.lang.String subject)
          Get values of the variable satisfing the KIF query: (property subject ?val).
 void loadOntology(SerializableOntModelImpl myDAMLModel, 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 ontologyStructureList)
          This method stores multiple ontology structures in the repositiry.
 void removeFilteredNamespace(java.lang.String namespace)
          This method remove a nemaspace 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.
 

Method Detail

getListOfLoadedOntologies

java.util.Set getListOfLoadedOntologies()
                                        throws DirectoryFailure
This method returns a set of urls depicting ontologies loaded into the JTP.

Throws:
DirectoryFailure

getAllNamespaces

java.util.Set 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 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 nemaspace 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 nemaspace 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 getConstructedOntologyStructures()
                                                throws DirectoryFailure
This method retrieves all user defined ontlogy structures in the repositiry.

Returns:
list containing SerializableOntModelImpl objects
Throws:
DirectoryFailure

putConstructedOntologyStructures

void putConstructedOntologyStructures(java.util.List ontologyStructureList)
                                      throws ReasoningException,
                                             java.io.IOException,
                                             DirectoryFailure
This method stores multiple ontology structures in the repositiry.

Parameters:
ontologyStructureList - a list containing SerializableOntModelImpl objects.
Throws:
jtp.ReasoningException - or IOException when loading of the ontology failed.
ReasoningException
java.io.IOException
DirectoryFailure

loadOntology

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

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.
ReasoningException
java.io.IOException
DirectoryFailure

loadOntology

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

Parameters:
myDAMLModel - The object of type com.hp.hpl.jena.daml.DAMLModel (actually SerializableOntModelImpl) containing the added ontology
recursiveLoad - Indicates if the imported ontologies (by the ontology contained in myDAMLModel) should also be recursively loaded.
Throws:
jtp.InconsistencyException - when loading of the ontology failed.
ReasoningException
java.io.IOException
DirectoryFailure

getInstancesOf

java.util.Set 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.

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 unknow for the ontology repository
DirectoryFailure

getSuperClassesOf

java.util.Set 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 unknow for the ontology repository
DirectoryFailure

getSubClassesOf

java.util.Set getSubClassesOf(java.lang.String className)
                              throws 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:
UnknownConceptException - if className is unknow for the ontology repository
DirectoryFailure

getSuperPropertiesOf

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

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 unknow 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.

Parameters:
statement - the object of type com.hp.hpl.jena.daml.DAMLModel containing the added ontology
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 satisfing 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 getValuesForProperty(java.lang.String property,
                                   java.lang.String subject)
                                   throws QueryFailure,
                                          DirectoryFailure
Get values of the variable satisfing 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 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 getResourcesWithValueForProperty(java.lang.String property,
                                               java.lang.String value)
                                               throws QueryFailure,
                                                      DirectoryFailure
Get values of the variable satisfing 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.Vector getPropertiesApplicableTo(java.lang.String className)
                                           throws QueryFailure,
                                                  UnknownConceptException,
                                                  DirectoryFailure
Get set of properties defined in the given namespace.

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.

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 askQuery(java.lang.String variableName,
                       java.lang.String multiplyVariablesQuery)
                       throws QueryFailure,
                              DirectoryFailure
Get values of the selected variable satisfing the KIF query with possibly many variable.

Parameters:
variableName - the neame ofthe selected variable
multiplyVariablesQuery - 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
Throws:
QueryFailure - if reasoning failed.
DirectoryFailure

getClassesDefInNamespace

java.util.Set 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 unknow for the ontology repository
DirectoryFailure

getUltimateOntologyTypesOfIndividual

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

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 unknow or any problem with JTP approached
DirectoryFailure

getPropertiesDefInNamespace

java.util.Set 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 unknow for the ontology repository
DirectoryFailure

getInstancesDefInNamespace

java.util.Set 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 unknow for the ontology repository
DirectoryFailure

getNamspacesImportedByNamespace

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

Parameters:
namespaceName - The name of the namespace in the Jena format
Returns:
Set of namspaces names in the Jena format
Throws:
UnknownNamespaceException - if namespaceName is unknow for the ontology repository
DirectoryFailure