org.deri.wsml.reasoner.flora
Class Reasoner

java.lang.Object
  extended by org.deri.wsml.reasoner.flora.Reasoner

public class Reasoner
extends java.lang.Object

Flora2 reasoner connector for WSML. With this class you can convert WSML ontologies and WSML conjunctive queries to Flora2 ontologies and Flora2 queries, respectively. Furthermore, you can connect to an Flora2 instance and execute the query against the given ontology. The reasoner depends on WSMO4J for the parsing of WSML documents and for internal representation of WSML. At the current stage, the reasoner only supports the logical expressions in an ontology, since WSMO4J has not yet been sufficiently updated. If several instances of this class work on the same Flora2, problems may arise, because there is no locking mechanism.

Version:
$Revision: 1.4 $ $Date: 2005/05/06 12:55:29 $
Author:
DERI Innsbruck, jos.debruijn@deri.org, holger.lausen@deri.org, ioan.toma@deri.org

Constructor Summary
Reasoner()
           
 
Method Summary
 void connectFlora(java.lang.String floraDirectory, java.lang.String xsbDirectory)
          Connects to Flora2 given the XSB and Flora2 directories
 void connectToFlora2()
          Connects to Flora2
 java.lang.String convertQuery(java.lang.String wsmlQuery)
          Convert a given WSML conjunctive query to an Flora2 query
 java.lang.String convertWSML(java.io.PushbackReader wsmlDocument)
          Converts a WSML document (in human-readable syntax) to Flora2 F-Logic currently, only the logical expressions are converted
 void loadOntology(java.io.PushbackReader wsmlOntology)
          Loads the given ontology into the reasoner and checks the constraints
 java.lang.Object[] processCommand(java.lang.String command)
           
 java.lang.String query(java.io.PushbackReader wsmlOntology, java.lang.String wsmlQuery)
          Queries a given WSML ontology using a given conjunctive query
 java.lang.String query(java.lang.String wsmlQuery)
          Queries the reasoner
 java.lang.String queryOntology(java.lang.String wsmlOntology, java.lang.String wsmlQuery)
          Queries a given WSML ontology using a given conjunctive query using the Flora2 running on the local machine
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Reasoner

public Reasoner()
Method Detail

connectFlora

public void connectFlora(java.lang.String floraDirectory,
                         java.lang.String xsbDirectory)
Connects to Flora2 given the XSB and Flora2 directories

Parameters:
floraDirectory -
xsbDirectory -

connectToFlora2

public void connectToFlora2()
Connects to Flora2


processCommand

public java.lang.Object[] processCommand(java.lang.String command)

queryOntology

public java.lang.String queryOntology(java.lang.String wsmlOntology,
                                      java.lang.String wsmlQuery)
                               throws java.lang.Exception
Queries a given WSML ontology using a given conjunctive query using the Flora2 running on the local machine

Parameters:
wsmlOntology -
wsmlQuery -
Returns:
Query answer
Throws:
java.lang.Exception

query

public java.lang.String query(java.io.PushbackReader wsmlOntology,
                              java.lang.String wsmlQuery)
                       throws java.lang.Exception
Queries a given WSML ontology using a given conjunctive query

Parameters:
wsmlOntology -
wsmlQuery -
Returns:
Query answer
Throws:
java.lang.Exception

query

public java.lang.String query(java.lang.String wsmlQuery)
                       throws java.lang.Exception
Queries the reasoner

Parameters:
wsmlQuery -
Returns:
query answer
Throws:
java.lang.Exception

loadOntology

public void loadOntology(java.io.PushbackReader wsmlOntology)
                  throws java.lang.Exception
Loads the given ontology into the reasoner and checks the constraints

Parameters:
wsmlOntology -
Throws:
java.lang.Exception

convertQuery

public java.lang.String convertQuery(java.lang.String wsmlQuery)
Convert a given WSML conjunctive query to an Flora2 query

Parameters:
wsmlQuery -
Returns:
Flora2 query

convertWSML

public java.lang.String convertWSML(java.io.PushbackReader wsmlDocument)
Converts a WSML document (in human-readable syntax) to Flora2 F-Logic currently, only the logical expressions are converted

Parameters:
wsmlDocument - A WSML document in human-readable syntax
Returns:
Flora2 F-Logic version of the input