org.jscience.linguistics.kif
Class Vampire

java.lang.Object
  extended by org.jscience.linguistics.kif.Vampire

public class Vampire
extends java.lang.Object

Class for invoking the KIF version of Vampire from Java. Vampire takes XML input and returns XML output. Input forms are either KIF formula or KIF formula. Results of queries have the following form: KIF formula KIF formula

Note that if the result of a query is not a variable binding, then the element will be omitted.

Since:
14/08/2003, Acapulco

Field Summary
 java.lang.String EMPTY_FILE
          DOCUMENT ME!
 
Constructor Summary
Vampire(java.lang.String kbFileName)
          ************************************************************ Create a running instance of Vampire.
 
Method Summary
 java.lang.String assertFormula(java.lang.String formula)
          ************************************************************ Add an assertion.
static void main(java.lang.String[] args)
          ************************************************************ A simple test.
 java.lang.String submitQuery(java.lang.String formula, int timeLimit, int bindingsLimit)
          ************************************************************ Submit a query.
 void terminate()
          ************************************************************ Terminate this instance of Vampire.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EMPTY_FILE

public java.lang.String EMPTY_FILE
DOCUMENT ME!

Constructor Detail

Vampire

public Vampire(java.lang.String kbFileName)
        throws java.io.IOException
************************************************************ Create a running instance of Vampire.

Parameters:
kbFileName - file name of the initial knowledge base to be downloaded by Vampire.
Throws:
java.io.IOException - should not normally be thrown unless either Vampire executable or database file name are incorrect
Method Detail

assertFormula

public java.lang.String assertFormula(java.lang.String formula)
                               throws java.io.IOException
************************************************************ Add an assertion.

Parameters:
formula - asserted formula in the KIF syntax
Returns:
answer to the assertion (in the XML syntax)
Throws:
java.io.IOException - should not normally be thrown

terminate

public void terminate()
               throws java.io.IOException
************************************************************ Terminate this instance of Vampire. Warning:After calling this functions no further assertions or queries can be done.

Throws:
java.io.IOException - should not normally be thrown

submitQuery

public java.lang.String submitQuery(java.lang.String formula,
                                    int timeLimit,
                                    int bindingsLimit)
                             throws java.io.IOException
************************************************************ Submit a query.

Parameters:
formula - query in the KIF syntax
timeLimit - time limit for answering the query (in seconds)
bindingsLimit - limit on the number of bindings
Returns:
answer to the query (in the XML syntax)
Throws:
java.io.IOException - should not normally be thrown

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
************************************************************ A simple test. Works as follows:
  1. start Vampire;
  2. make an assertion;
  3. submit a query;
  4. terminate Vampire.

Throws:
java.lang.Exception