hyspirit.engines
Class HyPOOLEngine

java.lang.Object
  extended by hyspirit.engines.HyEngine
      extended by hyspirit.engines.HyInferenceEngine
          extended by hyspirit.engines.HyPOOLEngine
All Implemented Interfaces:
java.lang.Runnable

public class HyPOOLEngine
extends HyInferenceEngine

A POOL engine runs POOL (probabilistic object-oriented logic) programs. For example:

database1[
doc1.author(peter)
0.9 doc1 [ 0.2 sailing; 0.5 sailor(peter); peter.friend(mary) ]
0.5 doc2 [ 0.8 sec1[sailing]; 0.3 sec2[boats] ]
]

The program above models a database with two documents (doc1, doc2), and the content and structure of the documents are modelled with the same logical componends; for the content representation, words, classifications, and relationships are applied.

The document content augments the knowledge of the context in which the documents occur. For example, we view doc1 as more reliable then doc2, and sec1 contributes more to the description of doc2, than sec2 does.

Querying is as follows:
% Content-oriented querying:
% All documents about sailing:
?- D[ sailing ];

% Fact-oriented querying:
% All document of author peter:
?- D.author(peter);

% Integrated content and fact-oriented querying:
% All documents about sailing and a sailor, where the sailor
% is the author of that document.
?- D[sailing & sailor(X)] & D.author(X);

POOL is described in Thomas Roelleke, "POOL: A probabilistic object-oriented logic for hypermedia retrieval", Shaker Verlag, Aachen, 1999.


Field Summary
 
Fields inherited from class hyspirit.engines.HyInferenceEngine
deleteQueryProgram, retrieveProgram
 
Fields inherited from class hyspirit.engines.HyEngine
argumentString, LOG, stdin, TIME_PREFIX
 
Constructor Summary
HyPOOLEngine()
          This constructor must be used if you are going to start your own engine process (client/server mode).
HyPOOLEngine(HySpiritProperties hyspirit)
          This constructor must be used if you are going to start your own engine process (client/server mode).
HyPOOLEngine(java.lang.String hostname, int port)
          This constructor must be used if you use an engine server (client mode).
 
Method Summary
protected  java.lang.String[] buildCommand()
          Builds the command from the parameters.
 void reset()
          Resets all parameters of the engine after destroying a possibly running process.
 
Methods inherited from class hyspirit.engines.HyInferenceEngine
deleteQuery, deleteQueryProgram, echo, echoSpecial, eval, evalFile, getStreamEndMessage, nextTuple, retrieve, retrieveProgram, runProgram
 
Methods inherited from class hyspirit.engines.HyEngine
closeSTDIN, destroy, exitValue, getCommand, getEngineName, getInputReader, getOutputWriter, getPercentageCPU, getRealTime, getSTDERR, getSTDIN, getSTDOUT, getSysTime, getUserTime, hasNext, isInClientMode, isRunning, kb, kb, kb, next, readFromSTDIN, restart, run, send, send, sendAndReceive, sendFile, setArgumentString, setLogger, start, suppressSTDERR, takesTime, takeTime, waitFor, waitTillRunning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HyPOOLEngine

public HyPOOLEngine()
             throws HySpiritException
This constructor must be used if you are going to start your own engine process (client/server mode).

Throws:
HySpiritException - if we can't determine the environment

HyPOOLEngine

public HyPOOLEngine(HySpiritProperties hyspirit)
             throws HySpiritException
This constructor must be used if you are going to start your own engine process (client/server mode).

Parameters:
hyspirit - the HySpirit properties containing the environment
Throws:
HySpiritException - if we can't determine the environment

HyPOOLEngine

public HyPOOLEngine(java.lang.String hostname,
                    int port)
             throws HySpiritException
This constructor must be used if you use an engine server (client mode).

Parameters:
hostname - the server host name
port - the server port
Throws:
HySpiritException - if we can't determine the environment
Method Detail

reset

public void reset()
Resets all parameters of the engine after destroying a possibly running process. You have to restart the process with run().

Overrides:
reset in class HyEngine

buildCommand

protected java.lang.String[] buildCommand()
Description copied from class: HyEngine
Builds the command from the parameters. If subclasses support other parameters, they have to override the buildCommand and reset methods. Be sure that you place the support for new, additional parameters somewhere. This means the block
   if (this.argumentString != null) {
     StringTokenizer strTok= new StringTokenizer(this.argumentString);
     while (strTok.hasMoreTokens()) commandVec.add(strTok.nextToken());
  }
  
should appear somewhere in your buildCommand implementation.

The output of this method is used in the run() method.

Overrides:
buildCommand in class HyEngine
Returns:
the command string array