|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object kaos.ontology.repository.OntologyRepository
public class OntologyRepository
This class conatins the JPT ontology repository and provids method to load new ontologies, manage ontologies and query the ontology knowledge base.
Field Summary | |
---|---|
static java.lang.String |
maxDepthProperty
|
Constructor Summary | |
---|---|
OntologyRepository()
|
|
OntologyRepository(boolean loadDefaultOntologies)
|
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. |
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 |
computeSetsIntersection(java.util.Set set1,
java.util.Set set2)
Computes intersection of two sets. |
java.lang.String |
convertJTPFormatToString(java.lang.String convertedString)
|
java.lang.String |
convertStatementToJTPFormat(java.lang.String convertedStatement)
|
java.lang.String |
convertStringToJTPFormat(java.lang.String convertedString)
|
boolean |
filterConcept(java.lang.String inputConcept)
This method filter out the concept if its namespace is in the filtered namespaces set. |
java.util.Set |
filterConcepts(java.util.Set inputConcepts)
This method filter out concepts which namespaces are in the filtered namespaces set. |
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.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.lang.String |
getLocalNameFromJTPString(java.lang.String jtpString)
|
java.util.Set |
getNamspacesImportedByNamespace(java.lang.String namespaceName)
Get set of namspaces imported by the given namespace. |
java.util.Set |
getOntologyDefinitionForConcept(java.lang.String conceptName)
Get mapping to the urls of ontology concept for the given concept name. |
OntologyLoader |
getOntologyLoader()
Get an ontology loader |
java.util.Vector |
getPropertiesApplicableTo(java.lang.String className)
Get properties applicable to the given class |
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 |
getSubPropertiesOf(java.lang.String propertyName)
Get set of subproperties of the given property. |
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, from the ontologies explicitly loaded into JTP context |
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 satisfing the KIF query: (property subject ?val). |
java.util.Map |
getValuesForMultiplyVariablesQuery(java.lang.String multiplyVariablesQuery)
Get values of the variables satisfing the KIF query with possibly many variable. |
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 |
loadKB(java.net.URL _url)
Stores the assertion as well as its forward-chained information. |
java.util.Set |
loadOntology(java.lang.String myURL,
boolean recursiveLoad)
Loads ontology from the provided url. |
protected void |
printDebugString(java.lang.String msg,
int loggerDisplayLevel)
A utility method to print a String. |
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. |
void |
resetOntologyLoader(java.lang.String ontlogyListFileName)
Resets ontology loader list of loaded namespaces |
void |
setNotificationRef(KAoSDirectoryService _myKAoSDirectoryService)
Sets the reference to the notification class. |
static void |
setReasoningDepth(int depth)
Sets the depth of the reasoning |
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 |
testIfIntersectionsDisjoint(java.util.Vector set1,
java.util.Vector set2)
Test if the two intersections of concepts are disjoint. |
boolean |
testIfSetsDifferenceEmpty(java.util.Vector set1,
java.util.Vector set2)
Test if the difference of two sets of concepts is empty (set1 - set2). |
boolean |
testTrue(java.lang.String statement)
Test if the KIF statemant 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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String maxDepthProperty
Constructor Detail |
---|
public OntologyRepository()
public OntologyRepository(boolean loadDefaultOntologies)
Method Detail |
---|
public static void setReasoningDepth(int depth)
public void setNotificationRef(KAoSDirectoryService _myKAoSDirectoryService)
public OntologyLoader getOntologyLoader()
public void resetOntologyLoader(java.lang.String ontlogyListFileName)
public void loadKB(java.net.URL _url) throws ReasoningException, java.io.IOException
_url
- - a url to a file containg KIF-formatted string to assert
ReasoningException
java.io.IOException
public int tellKifString(java.lang.String assertion) throws ReasoningException
assertion
- - a KIF-formatted string to assert
ReasoningException
public void untellKifString(java.lang.String assertion) throws ReasoningException
assertion
- - a KIF-formatted string to untell
ReasoningException
public int tellOwlString(java.lang.String assertion) throws ReasoningException
assertion
- - a KIF-formatted string to assert
ReasoningException
public void untellOwlString(java.lang.String assertion) throws ReasoningException
assertion
- - a OWL-formatted string to untell
ReasoningException
public javax.swing.undo.UndoManager getUndoManager()
public java.util.Set getListOfLoadedOntologies()
public java.util.Set getAllNamespaces()
public java.util.Set getFilteredNamespaces()
public void addFilteredNamespace(java.lang.String namespace)
namespace
- The name of the namespacepublic void removeFilteredNamespace(java.lang.String namespace)
namespace
- The name of the namespacepublic boolean filterConcept(java.lang.String inputConcept)
inputConcept
- The name of the concept
public java.util.Set filterConcepts(java.util.Set inputConcepts)
inputConcepts
- The set of namespaces
public java.util.Set loadOntology(java.lang.String myURL, boolean recursiveLoad) throws ReasoningException, java.io.IOException
myURL
- the url to the ontologyrecursiveLoad
- indicates if the imported ontologies (by the ontology depicted by myURL) should also be recursively loaded.
ReasoningException
- or IOException when loading of the ontology failed.
java.io.IOException
public boolean testTrue(java.lang.String statement) throws ReasoningException
statement
- the statement in KIF to be tested if true
ReasoningException
- if reasoning failed.public java.lang.String getUniqueValueForProperty(java.lang.String property, java.lang.String subject) throws ReasoningException
property
- the name of the propertysubject
- the name of the subject
ReasoningException
- if reasoning failed.public java.util.Set getValuesForProperty(java.lang.String property, java.lang.String subject) throws ReasoningException
property
- the name of the propertysubject
- the name of the subject
ReasoningException
- if reasoning failed.public java.util.Set getResourcesWithValueForProperty(java.lang.String property, java.lang.String value) throws ReasoningException
property
- the name of the propertyvalue
- the value
ReasoningException
- if reasoning failed.public java.util.Set askQuery(java.lang.String variableName, java.lang.String multiplyVariablesQuery) throws ReasoningException
variableName
- the neame ofthe selected variablemultiplyVariablesQuery
- the query
ReasoningException
- if reasoning failed.public java.util.Map getValuesForMultiplyVariablesQuery(java.lang.String multiplyVariablesQuery) throws ReasoningException
multiplyVariablesQuery
- the query
ReasoningException
- if reasoning failed.public java.util.Vector getPropertiesApplicableTo(java.lang.String className) throws ReasoningException
className
- the name of the class
ReasoningException
- if reasoning failed.public java.lang.String getRangeOnPropertyForClass(java.lang.String className, java.lang.String propertyName) throws ReasoningException
className
- the name of the classpropertyName
- the name of the property
ReasoningException
- if reasoning failed.public java.util.Set getUltimateOntologyTypesOfIndividual(java.lang.String individualName) throws UnknownConceptException
individualName
- the name of the individual
individualName
- if concept unknow or any problem with JTP approached
UnknownConceptException
public java.util.Set getInstancesOf(java.lang.String conceptName) throws UnknownConceptException
conceptName
- The name of the concept in the Jena format
UnknownConceptException
- if forActor is unknow for the ontology repositorypublic java.util.Set getSuperClassesOf(java.lang.String className) throws UnknownConceptException
className
- The name of the class in Jena format
UnknownConceptException
- if className is unknow for the ontology repositorypublic java.util.Set getSubClassesOf(java.lang.String className) throws UnknownConceptException
className
- The name of the class in Jena format
UnknownConceptException
- if className is unknow for the ontology repositorypublic java.util.Set getSuperPropertiesOf(java.lang.String propertyName) throws UnknownConceptException
propertyName
- The name of the property in Jena format
java.lang.Exception
- if propertyName is unknow for the ontology repository
UnknownConceptException
public java.util.Set getSubPropertiesOf(java.lang.String propertyName) throws UnknownConceptException
propertyName
- The name of the property in Jena format
java.lang.Exception
- if propertyName is unknow for the ontology repository
UnknownConceptException
public java.util.Set getClassesDefInNamespace(java.lang.String namespaceName) throws UnknownNamespaceException
namespaceName
- The name of the namespace in the Jena format
UnknownNamespaceException
- if namespaceName is unknow for the ontology repositorypublic java.util.Set getPropertiesDefInNamespace(java.lang.String namespaceName) throws UnknownNamespaceException
namespaceName
- The name of the namespace in the Jena format
UnknownNamespaceException
- if namespaceName is unknow for the ontology repositorypublic java.util.Set getInstancesDefInNamespace(java.lang.String namespaceName) throws UnknownNamespaceException
namespaceName
- The name of the namespace in the Jena format
UnknownNamespaceException
- if namespaceName is unknow for the ontology repositorypublic java.util.Set getNamspacesImportedByNamespace(java.lang.String namespaceName) throws UnknownNamespaceException
namespaceName
- The name of the namespace in the Jena format
UnknownNamespaceException
- if namespaceName is unknow for the ontology repositorypublic java.util.Set getOntologyDefinitionForConcept(java.lang.String conceptName)
conceptName
- The name of the namespace in the Jena format
public boolean testIfSetsDifferenceEmpty(java.util.Vector set1, java.util.Vector set2) throws ReasoningException
set1
- the first set of concepts names (Vector)set2
- the second set of concepts names (Vector)
ReasoningException
- if reasoning failed.public boolean testIfIntersectionsDisjoint(java.util.Vector set1, java.util.Vector set2) throws ReasoningException
set1
- the first set of concepts names (Vector)set2
- the second set of concepts names (Vector)
ReasoningException
- if reasoning failed.public java.util.Set computeSetsIntersection(java.util.Set set1, java.util.Set set2)
set1
- the first set of concepts namesset2
- the second set of concepts names
public java.lang.String convertStringToJTPFormat(java.lang.String convertedString)
public java.lang.String convertJTPFormatToString(java.lang.String convertedString)
public java.lang.String convertStatementToJTPFormat(java.lang.String convertedStatement)
public java.lang.String getLocalNameFromJTPString(java.lang.String jtpString)
protected void printDebugString(java.lang.String msg, int loggerDisplayLevel)
msg
- The String to be printed.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |