|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.semanticweb.owlapi.util.OWLReasonerMediator
public class OWLReasonerMediator
Author: Matthew Horridge
The University Of Manchester
Bio-Health Informatics Group
Date: 27-Apr-2007
OWLReasoner
. The mediator
provides several useful layers of client implementation functionality and
insulation on top of basic reasoner functionality. For example, autoloading
and unloading of imports, silent undefined entity handling etc.
Field Summary | |
---|---|
static boolean |
SILENT_UNDEFINED_ENTITY_HANDLING_DEFAULT_VALUE
|
Constructor Summary | |
---|---|
OWLReasonerMediator(OWLReasoner kernel)
|
Method Summary | |
---|---|
boolean |
checkDefined(OWLClassExpression classExpression)
|
boolean |
checkDefined(OWLDataPropertyExpression prop)
|
boolean |
checkDefined(OWLIndividual individual)
|
boolean |
checkDefined(OWLObjectPropertyExpression prop)
|
void |
classify()
Asks the reasoner to classify the ontology. |
void |
clearOntologies()
Clears the reasoner. |
void |
dispose()
Disposes of and cleans up any resources used by this reasoner. |
java.util.Set<java.util.Set<OWLClass>> |
getAncestorClasses(OWLClassExpression clsC)
Returns the collection of all superclasses of the given class expression. |
java.util.Set<java.util.Set<OWLDataProperty>> |
getAncestorProperties(OWLDataProperty property)
|
java.util.Set<java.util.Set<OWLObjectProperty>> |
getAncestorProperties(OWLObjectProperty property)
|
java.util.Map<OWLDataProperty,java.util.Set<OWLLiteral>> |
getDataPropertyRelationships(OWLNamedIndividual individual)
|
java.util.Set<java.util.Set<OWLClass>> |
getDescendantClasses(OWLClassExpression clsC)
Returns the collection of all subclasses of the given class expression. |
java.util.Set<java.util.Set<OWLDataProperty>> |
getDescendantProperties(OWLDataProperty property)
|
java.util.Set<java.util.Set<OWLObjectProperty>> |
getDescendantProperties(OWLObjectProperty property)
|
java.util.Set<java.util.Set<OWLClassExpression>> |
getDomains(OWLDataProperty property)
|
java.util.Set<java.util.Set<OWLClassExpression>> |
getDomains(OWLObjectProperty property)
Gets the domains of a particular property. |
java.util.Set<OWLClass> |
getEquivalentClasses(OWLClassExpression clsC)
Returns the collection of (named) classes which are equivalent to the given class expression. |
java.util.Set<OWLDataProperty> |
getEquivalentProperties(OWLDataProperty property)
|
java.util.Set<OWLObjectProperty> |
getEquivalentProperties(OWLObjectProperty property)
|
java.util.Set<OWLNamedIndividual> |
getIndividuals(OWLClassExpression clsC,
boolean direct)
|
java.util.Set<java.util.Set<OWLObjectProperty>> |
getInverseProperties(OWLObjectProperty property)
|
OWLReasoner |
getKernel()
Gets the real reasoner that this mediator wraps |
java.util.Set<OWLOntology> |
getLoadedOntologies()
Gets the ontologies that have been loaded into this reasoner. |
java.util.Map<OWLObjectProperty,java.util.Set<OWLNamedIndividual>> |
getObjectPropertyRelationships(OWLNamedIndividual individual)
|
java.util.Set<OWLDataRange> |
getRanges(OWLDataProperty property)
|
java.util.Set<OWLClassExpression> |
getRanges(OWLObjectProperty property)
|
java.util.Set<OWLNamedIndividual> |
getRelatedIndividuals(OWLNamedIndividual subject,
OWLObjectPropertyExpression property)
|
java.util.Set<OWLLiteral> |
getRelatedValues(OWLNamedIndividual subject,
OWLDataPropertyExpression property)
|
java.util.Set<java.util.Set<OWLClass>> |
getSubClasses(OWLClassExpression clsC)
Returns the collection of (named) most general subclasses of the given class expression. |
java.util.Set<java.util.Set<OWLDataProperty>> |
getSubProperties(OWLDataProperty property)
|
java.util.Set<java.util.Set<OWLObjectProperty>> |
getSubProperties(OWLObjectProperty property)
|
java.util.Set<java.util.Set<OWLClass>> |
getSuperClasses(OWLClassExpression clsC)
Returns the collection of (named) most specific superclasses of the given class expression. |
java.util.Set<java.util.Set<OWLDataProperty>> |
getSuperProperties(OWLDataProperty property)
|
java.util.Set<java.util.Set<OWLObjectProperty>> |
getSuperProperties(OWLObjectProperty property)
|
java.util.Set<java.util.Set<OWLClass>> |
getTypes(OWLNamedIndividual individual,
boolean direct)
|
java.util.Set<OWLClass> |
getUnsatisfiableClasses()
A convenience methods for obtaining all classes which are unsatisfiable. |
boolean |
hasDataPropertyRelationship(OWLNamedIndividual subject,
OWLDataPropertyExpression property,
OWLLiteral object)
|
boolean |
hasObjectPropertyRelationship(OWLNamedIndividual subject,
OWLObjectPropertyExpression property,
OWLNamedIndividual object)
|
boolean |
hasType(OWLNamedIndividual individual,
OWLClassExpression type,
boolean direct)
|
boolean |
isAsymmetric(OWLObjectProperty property)
|
boolean |
isClassified()
Determines if the reasoner has classified the ontology. |
boolean |
isConsistent(OWLOntology ontology)
Checks to see if the ontology that have been loaded into the reasoner are consistent in combination. |
boolean |
isDefined(OWLClass cls)
Determines if the specified class is defined in the reasoner. |
boolean |
isDefined(OWLDataProperty prop)
Determines if the specified property is defined in the reasoner. |
boolean |
isDefined(OWLIndividual ind)
Determines if the specified individual is defined in the reasoner. |
boolean |
isDefined(OWLObjectProperty prop)
Determines if the specified property is defined in the reasoner. |
boolean |
isEquivalentClass(OWLClassExpression clsC,
OWLClassExpression clsD)
Checks whether the first class is equivalent to the second class |
boolean |
isFunctional(OWLDataProperty property)
|
boolean |
isFunctional(OWLObjectProperty property)
|
boolean |
isInverseFunctional(OWLObjectProperty property)
|
boolean |
isIrreflexive(OWLObjectProperty property)
|
boolean |
isRealised()
Determines if the types of individuals have been computed by this reasoner (if supported). |
boolean |
isReflexive(OWLObjectProperty property)
|
boolean |
isSatisfiable(OWLClassExpression classExpression)
Determines if the specified class is satisfiable. |
boolean |
isSilentUndefinedEntityHandlingEnabled()
Determines if undefined entities are handled silently. |
boolean |
isSubClassOf(OWLClassExpression clsC,
OWLClassExpression clsD)
Checks whether the first class is a subclass of the second class |
boolean |
isSymmetric(OWLObjectProperty property)
|
boolean |
isTransitive(OWLObjectProperty property)
|
boolean |
isUndefinedClassesSatisfiable()
If an isSatisfiable ask is performed on an undefined class
then the return value of this method will be equal to the return value
of the asks request. |
void |
loadOntologies(java.util.Set<OWLOntology> ontologies)
Loads the specified ontologies. |
void |
realise()
Asks the reasoner to compute the types of individuals (if supported). |
void |
setSilentUndefinedEntityHandling(boolean silentUndefinedEntityHandling)
Sets the undefined entity handling behaviour. |
void |
setUndefinedClassesSatisfiable(boolean b)
|
java.lang.String |
toString()
|
void |
unloadOntologies(java.util.Set<OWLOntology> ontologies)
Unloads the specified ontologies from this reasoner. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final boolean SILENT_UNDEFINED_ENTITY_HANDLING_DEFAULT_VALUE
Constructor Detail |
---|
public OWLReasonerMediator(OWLReasoner kernel)
Method Detail |
---|
public OWLReasoner getKernel()
public boolean isSilentUndefinedEntityHandlingEnabled()
UndefinedEntityException
is thrown,
or 2) The undefined entity is handled silently and a "null" response is
returned.
Generally speaking, if silent undefined entity handling is enabled then all asks
operations which return Set
s and Map
s will return
empty Set
s and empty Map
s if the asks request
references an undefined entity. For example, if getSubClasses
asks for the subclasses of an undefined entity then an empty Set
will be returned. Most methods which have boolean return values will return
false
, for example isType
will return false if the
individual is undefined, or the class expression which is the type references
an undefined entity. The exception to this is the isSatisfiable
asks request which will return the value set by setUndefinedClassesSatisfiable
.
true
if silent undefined entity handling is enabled, otherwise
false
. If undefined entity handling is not enabled then asks
requests that reference undefined entities will most likely throw
UndefinedEntityException
s.public void setSilentUndefinedEntityHandling(boolean silentUndefinedEntityHandling)
silentUndefinedEntityHandling
- true
if undefined entities
should be handled silently, otherwise false
.public boolean isUndefinedClassesSatisfiable()
isSatisfiable
ask is performed on an undefined class
then the return value of this method will be equal to the return value
of the asks request.
true
if undefined classes should be regarded as being
satisfiable, false
if undefined classes should be regarded as
being unsatisfiable.public void setUndefinedClassesSatisfiable(boolean b)
public boolean checkDefined(OWLClassExpression classExpression) throws OWLReasonerException
OWLReasonerException
public boolean checkDefined(OWLObjectPropertyExpression prop) throws OWLReasonerException
OWLReasonerException
public boolean checkDefined(OWLDataPropertyExpression prop) throws OWLReasonerException
OWLReasonerException
public boolean checkDefined(OWLIndividual individual) throws OWLReasonerException
OWLReasonerException
public boolean isConsistent(OWLOntology ontology) throws OWLReasonerException
OWLConsistencyChecker
isConsistent
in interface OWLConsistencyChecker
ontology
- Implementations should ignore this parameter. It is here
for legacy reasons.
true
if the loaded ontologies in combination are consistent,
or false
if the loaded ontologies in combination are not consistent.
OWLReasonerException
public void loadOntologies(java.util.Set<OWLOntology> ontologies) throws OWLReasonerException
OWLReasonerBase
loadOntologies
in interface OWLReasonerBase
ontologies
- The ontolgies to be loaded.
OWLReasonerException
public boolean isClassified() throws OWLReasonerException
OWLReasonerBase
isClassified
in interface OWLReasonerBase
true
if the ontology has been classified,
or false
if the ontology has not been classified.
OWLReasonerException
public void classify() throws OWLReasonerException
OWLReasonerBase
classify
in interface OWLReasonerBase
OWLReasonerException
public boolean isRealised() throws OWLReasonerException
OWLReasonerBase
isRealised
in interface OWLReasonerBase
true
is the types of individuals have been computed,
otherwise false
.
OWLReasonerException
public void realise() throws OWLReasonerException
OWLReasonerBase
realise
in interface OWLReasonerBase
OWLReasonerException
public boolean isDefined(OWLClass cls) throws OWLReasonerException
OWLReasonerBase
isDefined
in interface OWLReasonerBase
cls
- The class to check for.
true
if the class is defined in the
reasoner, or false
if the class is not defined
in the reasoner.
OWLReasonerException
public boolean isDefined(OWLObjectProperty prop) throws OWLReasonerException
OWLReasonerBase
isDefined
in interface OWLReasonerBase
prop
- The property to check for.
true
if the property is defined in the
reasoner, or false
if the property is not defined
in the reasoner.
OWLReasonerException
public boolean isDefined(OWLDataProperty prop) throws OWLReasonerException
OWLReasonerBase
isDefined
in interface OWLReasonerBase
prop
- The property to check for.
true
if the property is defined in the
reasoner, or false
if the property is not defined
in the reasoner.
OWLReasonerException
public boolean isDefined(OWLIndividual ind) throws OWLReasonerException
OWLReasonerBase
isDefined
in interface OWLReasonerBase
ind
- The individual to check for.
true
if the individual is defined in the
reasoner, or false
if the individual is not defined
in the reasoner.
OWLReasonerException
public java.util.Set<OWLOntology> getLoadedOntologies()
OWLReasonerBase
getLoadedOntologies
in interface OWLReasonerBase
public void unloadOntologies(java.util.Set<OWLOntology> ontologies) throws OWLReasonerException
OWLReasonerBase
unloadOntologies
in interface OWLReasonerBase
ontologies
- The ontologies to be unloaded.
OWLReasonerException
public void clearOntologies() throws OWLReasonerException
OWLReasonerBase
clearOntologies
in interface OWLReasonerBase
OWLReasonerException
public void dispose() throws OWLReasonerException
OWLReasonerBase
dispose
in interface OWLReasonerBase
OWLReasonerException
public boolean isSubClassOf(OWLClassExpression clsC, OWLClassExpression clsD) throws OWLReasonerException
OWLClassReasoner
isSubClassOf
in interface OWLClassReasoner
true
if the first class is a subclass of the second class
OWLReasonerException
public boolean isEquivalentClass(OWLClassExpression clsC, OWLClassExpression clsD) throws OWLReasonerException
OWLClassReasoner
isEquivalentClass
in interface OWLClassReasoner
true
if the first class is equivalent to the second class, or
false
if the first class is not equivalent to the second class
OWLReasonerException
public java.util.Set<java.util.Set<OWLClass>> getSuperClasses(OWLClassExpression clsC) throws OWLReasonerException
OWLClassReasoner
getSuperClasses
in interface OWLClassReasoner
OWLReasonerException
public java.util.Set<java.util.Set<OWLClass>> getAncestorClasses(OWLClassExpression clsC) throws OWLReasonerException
OWLClassReasoner
getAncestorClasses
in interface OWLClassReasoner
OWLReasonerException
public java.util.Set<java.util.Set<OWLClass>> getSubClasses(OWLClassExpression clsC) throws OWLReasonerException
OWLClassReasoner
getSubClasses
in interface OWLClassReasoner
OWLReasonerException
public java.util.Set<java.util.Set<OWLClass>> getDescendantClasses(OWLClassExpression clsC) throws OWLReasonerException
OWLClassReasoner
getDescendantClasses
in interface OWLClassReasoner
OWLReasonerException
public java.util.Set<OWLClass> getEquivalentClasses(OWLClassExpression clsC) throws OWLReasonerException
OWLClassReasoner
getEquivalentClasses
in interface OWLClassReasoner
OWLReasonerException
public java.util.Set<OWLClass> getUnsatisfiableClasses() throws OWLReasonerException
OWLClassReasoner
getUnsatisfiableClasses
in interface OWLClassReasoner
OWLReasonerException
public boolean isSatisfiable(OWLClassExpression classExpression) throws OWLReasonerException
OWLSatisfiabilityChecker
isSatisfiable
in interface OWLSatisfiabilityChecker
OWLReasonerException
public java.util.Set<java.util.Set<OWLClass>> getTypes(OWLNamedIndividual individual, boolean direct) throws OWLReasonerException
getTypes
in interface OWLIndividualReasoner
OWLReasonerException
public java.util.Set<OWLNamedIndividual> getIndividuals(OWLClassExpression clsC, boolean direct) throws OWLReasonerException
getIndividuals
in interface OWLIndividualReasoner
OWLReasonerException
public java.util.Map<OWLObjectProperty,java.util.Set<OWLNamedIndividual>> getObjectPropertyRelationships(OWLNamedIndividual individual) throws OWLReasonerException
getObjectPropertyRelationships
in interface OWLIndividualReasoner
OWLReasonerException
public java.util.Map<OWLDataProperty,java.util.Set<OWLLiteral>> getDataPropertyRelationships(OWLNamedIndividual individual) throws OWLReasonerException
getDataPropertyRelationships
in interface OWLIndividualReasoner
OWLReasonerException
public boolean hasType(OWLNamedIndividual individual, OWLClassExpression type, boolean direct) throws OWLReasonerException
hasType
in interface OWLIndividualReasoner
OWLReasonerException
public boolean hasObjectPropertyRelationship(OWLNamedIndividual subject, OWLObjectPropertyExpression property, OWLNamedIndividual object) throws OWLReasonerException
hasObjectPropertyRelationship
in interface OWLIndividualReasoner
OWLReasonerException
public boolean hasDataPropertyRelationship(OWLNamedIndividual subject, OWLDataPropertyExpression property, OWLLiteral object) throws OWLReasonerException
hasDataPropertyRelationship
in interface OWLIndividualReasoner
OWLReasonerException
public java.util.Set<OWLNamedIndividual> getRelatedIndividuals(OWLNamedIndividual subject, OWLObjectPropertyExpression property) throws OWLReasonerException
getRelatedIndividuals
in interface OWLIndividualReasoner
OWLReasonerException
public java.util.Set<OWLLiteral> getRelatedValues(OWLNamedIndividual subject, OWLDataPropertyExpression property) throws OWLReasonerException
getRelatedValues
in interface OWLIndividualReasoner
OWLReasonerException
public java.util.Set<java.util.Set<OWLObjectProperty>> getSuperProperties(OWLObjectProperty property) throws OWLReasonerException
getSuperProperties
in interface OWLPropertyReasoner
OWLReasonerException
public java.util.Set<java.util.Set<OWLObjectProperty>> getSubProperties(OWLObjectProperty property) throws OWLReasonerException
getSubProperties
in interface OWLPropertyReasoner
OWLReasonerException
public java.util.Set<java.util.Set<OWLObjectProperty>> getAncestorProperties(OWLObjectProperty property) throws OWLReasonerException
getAncestorProperties
in interface OWLPropertyReasoner
OWLReasonerException
public java.util.Set<java.util.Set<OWLObjectProperty>> getDescendantProperties(OWLObjectProperty property) throws OWLReasonerException
getDescendantProperties
in interface OWLPropertyReasoner
OWLReasonerException
public java.util.Set<java.util.Set<OWLObjectProperty>> getInverseProperties(OWLObjectProperty property) throws OWLReasonerException
getInverseProperties
in interface OWLPropertyReasoner
OWLReasonerException
public java.util.Set<OWLObjectProperty> getEquivalentProperties(OWLObjectProperty property) throws OWLReasonerException
getEquivalentProperties
in interface OWLPropertyReasoner
OWLReasonerException
public java.util.Set<java.util.Set<OWLClassExpression>> getDomains(OWLObjectProperty property) throws OWLReasonerException
OWLPropertyReasoner
getDomains
in interface OWLPropertyReasoner
property
- The property whose domains are to be retrieved.
OWLReasonerException
- If there is a problem with the reasoner.public java.util.Set<OWLClassExpression> getRanges(OWLObjectProperty property) throws OWLReasonerException
getRanges
in interface OWLPropertyReasoner
OWLReasonerException
public boolean isFunctional(OWLObjectProperty property) throws OWLReasonerException
isFunctional
in interface OWLPropertyReasoner
OWLReasonerException
public boolean isInverseFunctional(OWLObjectProperty property) throws OWLReasonerException
isInverseFunctional
in interface OWLPropertyReasoner
OWLReasonerException
public boolean isSymmetric(OWLObjectProperty property) throws OWLReasonerException
isSymmetric
in interface OWLPropertyReasoner
OWLReasonerException
public boolean isTransitive(OWLObjectProperty property) throws OWLReasonerException
isTransitive
in interface OWLPropertyReasoner
OWLReasonerException
public boolean isReflexive(OWLObjectProperty property) throws OWLReasonerException
isReflexive
in interface OWLPropertyReasoner
OWLReasonerException
public boolean isIrreflexive(OWLObjectProperty property) throws OWLReasonerException
isIrreflexive
in interface OWLPropertyReasoner
OWLReasonerException
public boolean isAsymmetric(OWLObjectProperty property) throws OWLReasonerException
isAsymmetric
in interface OWLPropertyReasoner
OWLReasonerException
public java.util.Set<java.util.Set<OWLDataProperty>> getSuperProperties(OWLDataProperty property) throws OWLReasonerException
getSuperProperties
in interface OWLPropertyReasoner
OWLReasonerException
public java.util.Set<java.util.Set<OWLDataProperty>> getSubProperties(OWLDataProperty property) throws OWLReasonerException
getSubProperties
in interface OWLPropertyReasoner
OWLReasonerException
public java.util.Set<java.util.Set<OWLDataProperty>> getAncestorProperties(OWLDataProperty property) throws OWLReasonerException
getAncestorProperties
in interface OWLPropertyReasoner
OWLReasonerException
public java.util.Set<java.util.Set<OWLDataProperty>> getDescendantProperties(OWLDataProperty property) throws OWLReasonerException
getDescendantProperties
in interface OWLPropertyReasoner
OWLReasonerException
public java.util.Set<OWLDataProperty> getEquivalentProperties(OWLDataProperty property) throws OWLReasonerException
getEquivalentProperties
in interface OWLPropertyReasoner
OWLReasonerException
public java.util.Set<java.util.Set<OWLClassExpression>> getDomains(OWLDataProperty property) throws OWLReasonerException
getDomains
in interface OWLPropertyReasoner
OWLReasonerException
public java.util.Set<OWLDataRange> getRanges(OWLDataProperty property) throws OWLReasonerException
getRanges
in interface OWLPropertyReasoner
OWLReasonerException
public boolean isFunctional(OWLDataProperty property) throws OWLReasonerException
isFunctional
in interface OWLPropertyReasoner
OWLReasonerException
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |