edu.stanford.smi.protegex.owl.inference.dig.reasoner
Class DefaultDIGReasoner

java.lang.Object
  extended byedu.stanford.smi.protegex.owl.inference.dig.reasoner.DefaultDIGReasoner
All Implemented Interfaces:
DIGReasoner

public class DefaultDIGReasoner
extends Object
implements DIGReasoner

User: matthewhorridge
The Univeristy Of Manchester
Medical Informatics Group
Date: Jun 4, 2004

matthew.horridge@cs.man.ac.uk
www.cs.man.ac.uk/~horridgm


Field Summary
private  DocumentBuilder docBuilder
           
private  DocumentBuilderFactory docBuilderFactory
           
private  org.apache.xml.serialize.OutputFormat format
           
static boolean log
          Deprecated. Use DIGReasonerPreferences to set logging
private  URL reasonerURL
           
private  org.apache.xml.serialize.XMLSerializer serializer
           
private  DIGTranslator translator
           
 
Fields inherited from interface edu.stanford.smi.protegex.owl.inference.dig.reasoner.DIGReasoner
LOGGER_NAME
 
Constructor Summary
DefaultDIGReasoner()
           
 
Method Summary
 void clearKnowledgeBase(String kbURI)
          Clears the knowledge base
 String createKnowledgeBase()
          A helper method that asks the reasoner to create a new knowledgebase.
 DIGReasonerIdentity getIdentity()
          Gets the identity of the inference
 String getReasonerURL()
          Gets the URL of the reasoner.
protected  void log(Document doc)
          A helper method that lets us log the DIG XML used to communicate with the reasoner.
protected  void performErrorCheck(Document doc)
          This method checks for any errors in the DIG response and throws a DIGErrorException if there are any errors.
 Document performRequest(Document request)
          Sends a request to the reasoner and retrieves the response.
 void releaseKnowledgeBase(String kbURI)
          A helper method that releases a previously created knowledgebase.
 void setReasonerURL(String url)
          Sets the URL of the inference.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

reasonerURL

private URL reasonerURL

docBuilderFactory

private DocumentBuilderFactory docBuilderFactory

docBuilder

private DocumentBuilder docBuilder

serializer

private org.apache.xml.serialize.XMLSerializer serializer

format

private org.apache.xml.serialize.OutputFormat format

translator

private DIGTranslator translator

log

public static boolean log
Deprecated. Use DIGReasonerPreferences to set logging

Constructor Detail

DefaultDIGReasoner

public DefaultDIGReasoner()
Method Detail

setReasonerURL

public void setReasonerURL(String url)
Sets the URL of the inference.

Specified by:
setReasonerURL in interface DIGReasoner
Parameters:
url - The URL

getReasonerURL

public String getReasonerURL()
Gets the URL of the reasoner.

Specified by:
getReasonerURL in interface DIGReasoner

getIdentity

public DIGReasonerIdentity getIdentity()
                                throws DIGReasonerException
Gets the identity of the inference

Specified by:
getIdentity in interface DIGReasoner
Returns:
ADIGReasonerIdentity object that encapsulates the information about the inference.
Throws:
DIGReasonerException

createKnowledgeBase

public String createKnowledgeBase()
                           throws DIGReasonerException
A helper method that asks the reasoner to create a new knowledgebase.

Specified by:
createKnowledgeBase in interface DIGReasoner
Returns:
A String that represents a URI that is an identifier for the newly created knowledgebase.
Throws:
DIGReasonerException

releaseKnowledgeBase

public void releaseKnowledgeBase(String kbURI)
                          throws DIGReasonerException
A helper method that releases a previously created knowledgebase.

Specified by:
releaseKnowledgeBase in interface DIGReasoner
Parameters:
kbURI - The URI of the knowledgebase
Throws:
DIGReasonerException

clearKnowledgeBase

public void clearKnowledgeBase(String kbURI)
                        throws DIGReasonerException
Clears the knowledge base

Specified by:
clearKnowledgeBase in interface DIGReasoner
Parameters:
kbURI - The uri that identifies the knowledge base to be cleared.
Throws:
DIGReasonerException

performRequest

public Document performRequest(Document request)
                        throws DIGReasonerException
Description copied from interface: DIGReasoner
Sends a request to the reasoner and retrieves the response.

Specified by:
performRequest in interface DIGReasoner
Parameters:
request - A Document containing the DIG request
Returns:
A Document containing the reponse from the reasoner
Throws:
DIGReasonerException

performErrorCheck

protected void performErrorCheck(Document doc)
                          throws DIGErrorException
This method checks for any errors in the DIG response and throws a DIGErrorException if there are any errors.

Parameters:
doc - The XML DIG Document that contains that response from the reasoner.
Throws:
DIGErrorException

log

protected void log(Document doc)
A helper method that lets us log the DIG XML used to communicate with the reasoner.