If you are not using hsqldb, you will need to unzip
the file hsql_prolog and just use the src/gnu tree.
I've made some fixes to allow loading and unloading a
prolog file correctly (i hope).
---
This package requires the hsqldb_ext.zip pacakge from
my last submit. This plugin allows you to connect to
prolog as a stored procedure language.
something you could say is
select * from append([a,b],[c,d],X)
this will return one row with the value [a,b,c,d] in
column X.
I've also added some library support to allow
connecting prolog back to jdbc. I've included the XSB
package for binding relations to tables. However, this
isn't tested, and I would welcome suggestions and
help. So essentially this package would allow you to
do something like:
in a prolog file gran.pro
grandparent(X, Y) :- parent(X, Z), parent(Z, Y)
where parent would be tied to a SQL table.
in SQL you could do the following.
call load_module('org.hsqldb.PrologLibrary')
call prolog_load('gran.pro')
select * form grandparent('john', GrandParent)
The prolog pacakge I am using is
http://sourceforge.net/projects/gnuprologjava/
I might switch to a different prolog such as javalog,
however gnuprolog is written purely in java and is
easily extended.
INSTALLATION:
In the zip file you will find lib/gnuprolog2.jar
This is the original *.jar file from gnuprologjava
with my patches put on it. You will need to put
gnurpolog2.jar in your path.
You will also need to have the prolog source directory
gnuprolog which has many *.pro files in your path when
you are executing the sql daemon.
As for Hsqldb source, there is only one file:
org.hsqldb.PrologLibrary
you will need to put compile and put the class file
somewhere that java can see.
Cheers,
Hiep H Nguyen
hiep256@yahoo.com
Logged In: YES
user_id=943591
workaround might be useful
I can't seem to find lib/gnuprolog2.jar as the lib folder of the attachment appears to be empty...
However I think the files in src/gnu/prolog/ are the patched files.
Though the patches don't seem completely clean (there is commented out debug code in the patches). It should be possible to clean that up and integrate your patches.