|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.stanford.smi.protegex.owl.inference.protegeowl.DefaultProtegeOWLReasoner
User: matthewhorridge
The Univeristy Of Manchester
Medical Informatics Group
Date: Jun 14, 2004
Field Summary | |
private boolean |
autoSynchReasoner
|
private ClassListener |
classListener
|
private DIGLoggerListener |
digLoggerListener
|
private String |
kbURI
|
private OWLModel |
model
|
private ModelListener |
modelListener
|
private edu.stanford.smi.protege.event.ProjectListener |
projectListener
|
private PropertyListener |
propertyListener
|
private PropertyValueListener |
propertyValueListener
|
private DIGReasoner |
reasoner
|
private ResourceAdapter |
resourceAdapter
|
private boolean |
synchronizeReasoner
|
Fields inherited from interface edu.stanford.smi.protegex.owl.inference.protegeowl.ProtegeOWLReasoner |
CLS1_EQUIVALENT_TO_CLS2, CLS1_SUBSUMED_BY_CLS2, CLS1_SUBSUMES_CLS2, NO_SUBSUMPTION_RELATIONSHIP |
Constructor Summary | |
DefaultProtegeOWLReasoner(OWLModel kb)
|
Method Summary | |
private void |
addListeners()
|
void |
classifyTaxonomy(ReasonerTaskListener taskListener)
For each named class in the ontology, this method queries the reasoner for the consistency of the class, its inferred super classes and its inferred equivalent classes. |
void |
computeEquivalentConcepts(ReasonerTaskListener taskListener)
|
void |
computeInconsistentConcepts(ReasonerTaskListener taskListener)
This method queries the reasoner for the consistency of all classes in the ontology, and updates protege-owl with the information. |
void |
computeInferredHierarchy(ReasonerTaskListener taskListener)
For each named class in the ontology, this method queries the reasoner to obtain its inferred superclasses. |
void |
computeInferredIndividualTypes(ReasonerTaskListener taskListener)
|
void |
forceReasonerReSynchronization()
Depending on the implementation of the ProtegeOWLReasoner, some kind of caching may be used. |
Collection |
getAncestorClasses(OWLClass aClass,
ReasonerTaskListener taskListener)
Gets the inferred ancestor classes of the specified class. |
Collection |
getDescendantClasses(OWLClass aClass,
ReasonerTaskListener taskListener)
Gets the inferred descendant classes of the specified class. |
DIGReasoner |
getDIGReasoner()
Gets the DIGReasoner that this reasoner uses to talk to the external DIG Reasoner Process |
Collection |
getEquivalentClasses(OWLClass aClass,
ReasonerTaskListener taskListener)
Gets the equivalent classes of the specified class. |
DIGReasonerIdentity |
getIdentity()
Gets the identity of the DIG reasoner. |
Collection |
getIndividualsBelongingToClass(OWLClass aClass,
ReasonerTaskListener taskListener)
Gets the individuals that are inferred to be members of the specified class. |
Collection |
getIndividualTypes(OWLIndividual individual,
ReasonerTaskListener taskListener)
Get the inferred types for the specified individual. |
OWLModel |
getKnowledgeBase()
Gets the knowledge base (OWLModel) that this reasoner reasons over. |
String |
getReasonerKnowledgeBaseURI()
The external DIG Reasoner that provides the reasoning services assigns each knowledgebase that it knows about a URI in order to identify the knowledgebase. |
Collection |
getSubclasses(OWLClass aClass,
ReasonerTaskListener taskListener)
Gets the (direct) inferred subclasses of the specified class. |
int |
getSubsumptionRelationship(OWLClass cls1,
OWLClass cls2,
ReasonerTaskListener taskListener)
Gets the subsumption relationship between two classes - the subsumption relationship of cls1 to cls2. |
Collection |
getSuperclasses(OWLClass aClass,
ReasonerTaskListener taskListener)
Gets the (direct) inferred superclasses of the specified class. |
Collection |
getSuperclassesOfIntersection(OWLClass[] clses,
ReasonerTaskListener taskListener)
Gets the inferred superclasses of the intersection of the list of specified classes. |
String |
getURL()
Gets the URL of the external DIG reasoner. |
boolean |
isAutoSynchronizationEnabled()
|
boolean |
isConnected()
Determines if the ProtegeOWLReasoner can connect to an external DIG compliant reasoner to provide reasoning services. |
boolean |
isDisjointTo(OWLClass cls1,
OWLClass cls2,
ReasonerTaskListener taskListener)
Determines if the specified classes are disjoint from each other. |
boolean |
isIntersectionSatisfiable(OWLClass[] clses,
ReasonerTaskListener taskListener)
Determines if the intersection of the list of specified classes is satisfiable. |
boolean |
isSatisfiable(OWLClass aClass,
ReasonerTaskListener taskListener)
This method queries the reasoner to determine if the specified concept is satisfiable. |
boolean |
isSubsumedBy(OWLClass cls1,
OWLClass cls2,
ReasonerTaskListener taskListener)
Determines if one class (cls1) is subsumed by another class (cls2). |
void |
performTask(ReasonerTask task,
ReasonerTaskListener taskListener)
Executes the specified task after synchronizing the reasoner if necessary. |
private void |
reactToKnowledgeBaseChange()
|
private void |
removeListeners()
|
void |
setAutoSynchronizationEnabled(boolean b)
Depending on the implementation of the ProtegeOWLReasoner, the DIG reasoner may automatically be sunchronized with changes in the Protege-OWL knowledgebase. |
protected void |
setKnowledgeBase(OWLModel kb)
|
void |
setURL(String url)
Sets the URL of the external DIG reasoner |
protected void |
synchronizeReasoner(ReasonerTaskListener taskListener)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private DIGReasoner reasoner
private OWLModel model
private boolean synchronizeReasoner
private boolean autoSynchReasoner
private String kbURI
private edu.stanford.smi.protege.event.ProjectListener projectListener
private ModelListener modelListener
private ResourceAdapter resourceAdapter
private PropertyListener propertyListener
private ClassListener classListener
private PropertyValueListener propertyValueListener
private DIGLoggerListener digLoggerListener
Constructor Detail |
public DefaultProtegeOWLReasoner(OWLModel kb)
Method Detail |
public DIGReasoner getDIGReasoner()
getDIGReasoner
in interface ProtegeOWLReasoner
protected void setKnowledgeBase(OWLModel kb)
private void removeListeners()
private void addListeners()
public void setURL(String url)
ProtegeOWLReasoner
setURL
in interface ProtegeOWLReasoner
public String getURL()
ProtegeOWLReasoner
getURL
in interface ProtegeOWLReasoner
String
representing the URL.public boolean isConnected()
ProtegeOWLReasoner
false
then
none of the reaoning methods will work.
isConnected
in interface ProtegeOWLReasoner
private void reactToKnowledgeBaseChange()
public void forceReasonerReSynchronization()
ProtegeOWLReasoner
forceReasonerReSynchronization
in interface ProtegeOWLReasoner
public void setAutoSynchronizationEnabled(boolean b)
ProtegeOWLReasoner
forceReasonerReSynchronization
method should
be used.
setAutoSynchronizationEnabled
in interface ProtegeOWLReasoner
b
- true
to enable autosync, or false
to disable autosync.public boolean isAutoSynchronizationEnabled()
isAutoSynchronizationEnabled
in interface ProtegeOWLReasoner
public String getReasonerKnowledgeBaseURI()
ProtegeOWLReasoner
getReasonerKnowledgeBaseURI
in interface ProtegeOWLReasoner
String
representing the URI.protected void synchronizeReasoner(ReasonerTaskListener taskListener) throws DIGReasonerException
DIGReasonerException
public DIGReasonerIdentity getIdentity()
ProtegeOWLReasoner
DIGReasonerIdentity
describes the
name, version and capabilities of an external DIG
reasoner.
getIdentity
in interface ProtegeOWLReasoner
public OWLModel getKnowledgeBase()
ProtegeOWLReasoner
getKnowledgeBase
in interface ProtegeOWLReasoner
public void classifyTaxonomy(ReasonerTaskListener taskListener) throws DIGReasonerException
ProtegeOWLReasoner
RDFSClass
such as getInferredSuperClasses
will return meaningful results.
classifyTaxonomy
in interface ProtegeOWLReasoner
taskListener
- - A listener which will be informed of the progress of
the task. May be null
if the progress of the task does not
need to be monitored.
DIGReasonerException
public void computeInferredHierarchy(ReasonerTaskListener taskListener) throws DIGReasonerException
ProtegeOWLReasoner
getInferredSuperClasses
on RDFSClass
will
return meaningful results.
computeInferredHierarchy
in interface ProtegeOWLReasoner
taskListener
- - A listener which will be informed of the progress of
the task. May be null
if the progress of the task does not
need to be monitored.
DIGReasonerException
public void computeEquivalentConcepts(ReasonerTaskListener taskListener) throws DIGReasonerException
computeEquivalentConcepts
in interface ProtegeOWLReasoner
taskListener
- - A listener which will be informed of the progress of
the task. May be null
if the progress of the task does not
need to be monitored.
DIGReasonerException
public void computeInconsistentConcepts(ReasonerTaskListener taskListener) throws DIGReasonerException
ProtegeOWLReasoner
computeInconsistentConcepts
in interface ProtegeOWLReasoner
taskListener
- - A listener which will be informed of the progress of
the task. May be null
if the progress of the task does not
need to be monitored.
DIGReasonerException
public void computeInferredIndividualTypes(ReasonerTaskListener taskListener) throws DIGReasonerException
computeInferredIndividualTypes
in interface ProtegeOWLReasoner
taskListener
- - A listener which will be informed of the progress of
the task. May be null
if the progress of the task does not
need to be monitored.
DIGReasonerException
public boolean isSatisfiable(OWLClass aClass, ReasonerTaskListener taskListener) throws DIGReasonerException
ProtegeOWLReasoner
isSatisfiable
in interface ProtegeOWLReasoner
aClass
- The OWLClass
whose satisfiablity is to be determined.taskListener
- - A listener which will be informed of the progress of
the task. May be null
if the progress of the task does not
need to be monitored.
true
if the specified class is satisfiable (consistent)
, or false
if the specified class is not satisfiable (not consistent).
DIGReasonerException
public boolean isIntersectionSatisfiable(OWLClass[] clses, ReasonerTaskListener taskListener) throws DIGReasonerException
ProtegeOWLReasoner
isIntersectionSatisfiable
in interface ProtegeOWLReasoner
clses
- An array of OWLClass
es, of which the satisfiablity of the
intersection will be determined.taskListener
- - A listener which will be informed of the progress of
the task. May be null
if the progress of the task does not
need to be monitored.
true
if the intersection of the list of classes is satisfiable (consistent)
or false
if the intersection of the list of classes is not satisfiable (not consistent)
DIGReasonerException
public boolean isSubsumedBy(OWLClass cls1, OWLClass cls2, ReasonerTaskListener taskListener) throws DIGReasonerException
ProtegeOWLReasoner
isSubsumedBy
in interface ProtegeOWLReasoner
cls1
- The subsumee (the expected subclass)cls2
- The subsumer (the expected superclass)taskListener
- - A listener which will be informed of the progress of
the task. May be null
if the progress of the task does not
need to be monitored.
true
if cls1 is subsumed by cls2, or false
if cls1
is not subsumed by cls2.
DIGReasonerException
public boolean isDisjointTo(OWLClass cls1, OWLClass cls2, ReasonerTaskListener taskListener) throws DIGReasonerException
ProtegeOWLReasoner
isDisjointTo
in interface ProtegeOWLReasoner
cls1
- An OWLClass
cls2
- An OWLClass
taskListener
- - A listener which will be informed of the progress of
the task. May be null
if the progress of the task does not
need to be monitored.
true
if cls1 is disjoint with cls2.
DIGReasonerException
public int getSubsumptionRelationship(OWLClass cls1, OWLClass cls2, ReasonerTaskListener taskListener) throws DIGReasonerException
ProtegeOWLReasoner
getSubsumptionRelationship
in interface ProtegeOWLReasoner
cls1
- An OWLClass
cls2
- An OWLClass
taskListener
- - A listener which will be informed of the progress of
the task. May be null
if the progress of the task does not
need to be monitored.
ProtegeOWLReasoner
for result values
DIGReasonerException
public Collection getSuperclasses(OWLClass aClass, ReasonerTaskListener taskListener) throws DIGReasonerException
ProtegeOWLReasoner
getSuperclasses
in interface ProtegeOWLReasoner
aClass
- The class whose inferred superclasses are to be retrieved.taskListener
- - A listener which will be informed of the progress of
the task. May be null
if the progress of the task does not
need to be monitored.
Collection
containing the classes that are the
inferred superclasses of the specified class.
DIGReasonerException
public Collection getSuperclassesOfIntersection(OWLClass[] clses, ReasonerTaskListener taskListener) throws DIGReasonerException
ProtegeOWLReasoner
getSuperclassesOfIntersection
in interface ProtegeOWLReasoner
clses
- An array of OWLClass
es, the intersection of
which will be obtained and then the inferred superclasses of this intersection
class will be retrieved from the reasoner.taskListener
- - A listener which will be informed of the progress of
the task. May be null
if the progress of the task does not
need to be monitored.
Collection
of classes.
DIGReasonerException
public Collection getSubclasses(OWLClass aClass, ReasonerTaskListener taskListener) throws DIGReasonerException
ProtegeOWLReasoner
getSubclasses
in interface ProtegeOWLReasoner
aClass
- The class whose inferred subclasses are to be retrieved.taskListener
- - A listener which will be informed of the progress of
the task. May be null
if the progress of the task does not
need to be monitored.
Collection
containing the inferred subclasses of the
specified class.
DIGReasonerException
public Collection getAncestorClasses(OWLClass aClass, ReasonerTaskListener taskListener) throws DIGReasonerException
ProtegeOWLReasoner
getAncestorClasses
in interface ProtegeOWLReasoner
aClass
- The class whose inferred ancestor classes are to be retrieved.taskListener
- - A listener which will be informed of the progress of
the task. May be null
if the progress of the task does not
need to be monitored.
Collection
containing the inferred ancestor classes
of the specified class.
DIGReasonerException
public Collection getDescendantClasses(OWLClass aClass, ReasonerTaskListener taskListener) throws DIGReasonerException
ProtegeOWLReasoner
getDescendantClasses
in interface ProtegeOWLReasoner
aClass
- The class whose descendent classes are to be retrieved.taskListener
- - A listener which will be informed of the progress of
the task. May be null
if the progress of the task does not
need to be monitored.
Collection
containing the inferred descendent classes.
DIGReasonerException
public Collection getEquivalentClasses(OWLClass aClass, ReasonerTaskListener taskListener) throws DIGReasonerException
ProtegeOWLReasoner
getEquivalentClasses
in interface ProtegeOWLReasoner
aClass
- The class whose equivalent classes are to be retrieved.taskListener
- - A listener which will be informed of the progress of
the task. May be null
if the progress of the task does not
need to be monitored.
Collection
containing the inferred equivalent classes
of the specified class.
DIGReasonerException
public Collection getIndividualsBelongingToClass(OWLClass aClass, ReasonerTaskListener taskListener) throws DIGReasonerException
ProtegeOWLReasoner
getIndividualsBelongingToClass
in interface ProtegeOWLReasoner
aClass
- The class whose members are to be retrieved.taskListener
- - A listener which will be informed of the progress of
the task. May be null
if the progress of the task does not
need to be monitored.
Collection
containing the OWLIndividuals
that are members of the specified class.
DIGReasonerException
public Collection getIndividualTypes(OWLIndividual individual, ReasonerTaskListener taskListener) throws DIGReasonerException
ProtegeOWLReasoner
getIndividualTypes
in interface ProtegeOWLReasoner
individual
- The individual whose inferred types are to be retrieved.taskListener
- - A listener which will be informed of the progress of
the task. May be null
if the progress of the task does not
need to be monitored.
Collection
of OWLClasses
that represent the
inferred types for the specified individual.
DIGReasonerException
public void performTask(ReasonerTask task, ReasonerTaskListener taskListener) throws DIGReasonerException
null
) is automatically registered
with the task before task execution, and the unregistered after task
execution.
task
- The task to be executed.taskListener
- The listener to be registered with the task. May be
null
if no listener should be registered.
DIGReasonerException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |