|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.buffalo.sneps.JavaSnepsAPI
public class JavaSnepsAPI
Class of connections between Java and the SNePS knowledge representation and reasoning system. Methods defined invoke their respective SNePS functions using Allegro Common Lisp's (ACL) Jlinker interface
Note: ACL or an instance of the SNePS executable is required to use this API.
Constructor Summary | |
---|---|
JavaSnepsAPI(int interface_port)
Creates an instance of the JavaSnepsAPI using the specified port. |
|
JavaSnepsAPI(java.lang.String config_file,
int interface_port)
Creates an instance of the JavaSnepsAPI using the specified port and config_file. |
Method Summary | |
---|---|
java.util.HashSet<java.lang.String> |
ask(java.lang.String command)
Given a valid ask input, invokes the SNePSLOG ask method on that input. |
java.util.HashSet<java.lang.String> |
askifnot(java.lang.String command)
Given a valid ask input, invokes the SNePSLOG askifnot method on that input. |
java.util.HashSet<Substitution> |
askwh(java.lang.String command)
Given a valid ask input, invokes the SNePSLOG askwh method on that input. |
java.util.HashSet<Substitution> |
askwhnot(java.lang.String command)
Given a valid ask input, invokes the SNePSLOG askwhnot method on that input. |
void |
endLispConnection()
Terminates the Java-Sneps connection. |
boolean |
isConnected()
Returns true if the connection between Java and Sneps is still functioning. |
void |
tell(java.lang.String command)
Given a proper command string, invokes the SNePSLOG tell method on that command. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JavaSnepsAPI(int interface_port)
(snepslog:init-java-sneps-connection
interface_port
java-classpath
)
The java-classpath is the classpath needed to compile and run this class.
interface_port
- The port to use for this connectionpublic JavaSnepsAPI(java.lang.String config_file, int interface_port)
config_file
- Location of the JavaSNePS config file (java_sneps_config.config). Typically this file is the JavaSneps subdirectory in the SNePS home directory. Ask the administrator who installed SNePS for its location.interface_port
- The port to use for this connectionMethod Detail |
---|
public boolean isConnected()
true
if Java and SNePS are still connected, false
otherwise.public void tell(java.lang.String command)
Note: Unlike the SNePS version of tell, this tell returns nothing.
command
- A SNePSLOG parsable string to invoke in SNePS.public java.util.HashSet<java.lang.String> ask(java.lang.String command)
command
- Valid ask input with which to query SNePS.
HashSet
of String objects representing the query resultspublic java.util.HashSet<java.lang.String> askifnot(java.lang.String command)
command
- Valid ask input with which to query SNePS.
HashSet
of String objects representing query resultspublic java.util.HashSet<Substitution> askwh(java.lang.String command)
command
- Valid ask input with which to query SNePS.
HashSet
of Substitution
"The get value from variable method"
,
"The SNePS 2.7.0 Manual - snepslog:askwh"public java.util.HashSet<Substitution> askwhnot(java.lang.String command)
command
- Valid ask input with which to query SNePS.
HashSet
of Substitution
"The get value from variable method"
,
"The SNePS 2.7.0 Manual - snepslog:askwhnot"public void endLispConnection()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |