kaos.ontology.repository
Interface OntologyRepository

All Known Implementing Classes:
JTPOntologyRepository, OWLapiOntologyRepository

public interface OntologyRepository


Nested Class Summary
static class OntologyRepository.ReasoningException
           
 
Method Summary
 void addFilteredNamespace(java.lang.String namespace)
          This method add a namespaces to the set of ontology namespaces which are filtered out when returned by methods of this repository.
 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.
 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> 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 (direct children of the 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> getListOfLoadedOntologies()
          This method returns a set of urls depicting ontologies loaded into the repository
 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.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.util.Set<java.lang.String> getUltimateOntologyTypesOfIndividual(java.lang.String individualName)
          Finds the ultimate Ontology type of the provided individual, from the ontologies explicitly loaded into repository
 javax.swing.undo.UndoManager getUndoManager()
          Get the undo manager for reasoning inference.
 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).
 java.util.List<OntClassPropertyDescription> initiateClassProperties(java.lang.String actionClassName, java.lang.String actorClassName)
          Get properties applicable to the action class
 void loadKB(java.net.URL _url)
          Stores the assertion as well as its forward-chained information.
 void loadOntology(OntModel myOWLModel, boolean recursiveLoad)
          Adds ontology included in the provide objects into the ontology repository.
 java.util.Set<java.lang.String> loadOntology(java.lang.String myURL, boolean recursiveLoad)
          Loads ontology from the provided url.
 void removeFilteredNamespace(java.lang.String namespace)
          This method remove a namespace from the set of ontology namespaces which are filtered out when returned by methods of this repository.
 void resetOntologyLoader()
          Resets ontology loader
 void setNotificationRef(KAoSDirectoryService _myKAoSDirectoryService)
          Sets the reference to the notification object; needed to send feedback about progress of operations
 int tellKifString(java.lang.String assertion)
          Stores the assertion as well as its forward-chained information.
 int tellOwlString(java.lang.String assertion)
          Stores the assertion as well as its forward-chained information.
 boolean testTrue(java.lang.String statement)
          Test if the KIF statement is true according to the ontologies in the ontology repository.
 void untellKifString(java.lang.String assertion)
          Deletes the assertion as well as its forward-chained information.
 void untellOwlString(java.lang.String assertion)
          Deletes the assertion as well as its forward-chained information.
 

Method Detail

setNotificationRef

void setNotificationRef(KAoSDirectoryService _myKAoSDirectoryService)
Sets the reference to the notification object; needed to send feedback about progress of operations


resetOntologyLoader

void resetOntologyLoader()
Resets ontology loader


loadKB

void loadKB(java.net.URL _url)
            throws OntologyRepository.ReasoningException,
                   java.io.IOException
Stores the assertion as well as its forward-chained information.

Parameters:
_url - - a url to a file containing KIF-formatted string to assert
Throws:
OntologyRepository.ReasoningException
java.io.IOException

tellKifString

int tellKifString(java.lang.String assertion)
                  throws OntologyRepository.ReasoningException
Stores the assertion as well as its forward-chained information.

Parameters:
assertion - - a KIF-formatted string to assert
Throws:
OntologyRepository.ReasoningException

untellKifString

void untellKifString(java.lang.String assertion)
                     throws OntologyRepository.ReasoningException
Deletes the assertion as well as its forward-chained information.

Parameters:
assertion - - a KIF-formatted string to untell
Throws:
OntologyRepository.ReasoningException

tellOwlString

int tellOwlString(java.lang.String assertion)
                  throws OntologyRepository.ReasoningException
Stores the assertion as well as its forward-chained information.

Parameters:
assertion - - OWL string to assert
Throws:
OntologyRepository.ReasoningException

untellOwlString

void untellOwlString(java.lang.String assertion)
                     throws OntologyRepository.ReasoningException
Deletes the assertion as well as its forward-chained information.

Parameters:
assertion - - a OWL-formatted string to untell
Throws:
OntologyRepository.ReasoningException

getUndoManager

javax.swing.undo.UndoManager getUndoManager()
Get the undo manager for reasoning inference.


getListOfLoadedOntologies

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


getAllNamespaces

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.


getFilteredNamespaces

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.


addFilteredNamespace

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

Parameters:
namespace - The name of the namespace

removeFilteredNamespace

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

Parameters:
namespace - The name of the namespace

loadOntology

java.util.Set<java.lang.String> loadOntology(java.lang.String myURL,
                                             boolean recursiveLoad)
                                             throws OntologyRepository.ReasoningException,
                                                    java.io.IOException
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.
Returns:
Returns a set to of namespaces loaded during this step
Throws:
OntologyRepository.ReasoningException - or IOException when loading of the ontology failed.
java.io.IOException

loadOntology

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

Parameters:
myOWLModel - the object of type com.hp.hpl.jena.OWL.OWLModel containing the added ontology
recursiveLoad - indicates if the imported ontologies (by the ontology contained in myOWLModel) should also be recursively loaded.
Throws:
OntologyRepository.ReasoningException - or IOException when loading of the ontology failed.
java.io.IOException

testTrue

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

Parameters:
statement - the statement in KIF to be tested if true
Returns:
true if the statement is true and false in the opposite case
Throws:
OntologyRepository.ReasoningException - if reasoning failed.

getUniqueValueForProperty

java.lang.String getUniqueValueForProperty(java.lang.String property,
                                           java.lang.String subject)
                                           throws OntologyRepository.ReasoningException
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:
OntologyRepository.ReasoningException - if reasoning failed.

getValuesForProperty

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

getResourcesWithValueForProperty

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

askQuery

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

initiateClassProperties

java.util.List<OntClassPropertyDescription> initiateClassProperties(java.lang.String actionClassName,
                                                                    java.lang.String actorClassName)
Get properties applicable to the action class

Parameters:
actionClassName - the name of the action class performing
actorClassName - the name of the actor class performing the action
Returns:
vector of TargetClassDescription

getPropertiesApplicableTo

java.util.List<java.lang.String> getPropertiesApplicableTo(java.lang.String className)
                                                           throws OntologyRepository.ReasoningException
Get properties applicable to the given class

Parameters:
className - the name of the class
Returns:
vector of properties names
Throws:
OntologyRepository.ReasoningException - if reasoning failed.

getRangeOnPropertyForClass

java.lang.String getRangeOnPropertyForClass(java.lang.String className,
                                            java.lang.String propertyName)
                                            throws OntologyRepository.ReasoningException
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:
OntologyRepository.ReasoningException - if reasoning failed.

getUltimateOntologyTypesOfIndividual

java.util.Set<java.lang.String> getUltimateOntologyTypesOfIndividual(java.lang.String individualName)
                                                                     throws UnknownConceptException
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:
individualName - if concept unknown
UnknownConceptException

getInstancesOf

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

getSuperClassesOf

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

getSubClassesOf

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

getImmediateSubClassesOf

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

getSuperPropertiesOf

java.util.Set<java.lang.String> getSuperPropertiesOf(java.lang.String propertyName)
                                                     throws UnknownConceptException
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:
OntologyRepository.ReasoningException - if propertyName is unknown for the ontology repository
UnknownConceptException

getSubPropertiesOf

java.util.Set<java.lang.String> getSubPropertiesOf(java.lang.String propertyName)
                                                   throws UnknownConceptException
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:
OntologyRepository.ReasoningException - if propertyName is unknown for the ontology repository
UnknownConceptException

getClassesDefInNamespace

java.util.Set<java.lang.String> getClassesDefInNamespace(java.lang.String namespaceName)
                                                         throws UnknownNamespaceException
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

getPropertiesDefInNamespace

java.util.Set<java.lang.String> getPropertiesDefInNamespace(java.lang.String namespaceName)
                                                            throws UnknownNamespaceException
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

getInstancesDefInNamespace

java.util.Set<java.lang.String> getInstancesDefInNamespace(java.lang.String namespaceName)
                                                           throws UnknownNamespaceException
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

getNamspacesImportedByNamespace

java.util.Set<java.lang.String> getNamspacesImportedByNamespace(java.lang.String namespaceName)
                                                                throws UnknownNamespaceException
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

getOntologyDefinitionForConcept

java.util.Set<java.lang.String> getOntologyDefinitionForConcept(java.lang.String conceptName)
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