Menu

#29 Prolog Plugin

open
1
2002-04-03
2001-08-29
No

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

Discussion

  • Hiep Huu Nguyen

    Hiep Huu Nguyen - 2001-08-29
     
  • Hiep Huu Nguyen

    Hiep Huu Nguyen - 2001-08-29
     
  • Michael J. Cannon

    Logged In: YES
    user_id=32217

    Fred,

    This and #45709: are they going to make it? All of this
    work in the Trackers are to clear my SF.net Dashboard, so I
    can concentrate on the re-org of fora, Trackers and
    readying the CVS and doc management.

    Hiep's patches for embedding other languages, eventually
    could include XML (to make hsqldb an 'active' XML source
    for J2EE and CMS/DbPrism), python, php, (both have Java
    implementations, for instance, in Coccoon)...even PL/SQL
    and perl...

    Interesting, but do we need to do this now or in FUTURE?

    Mike

     
  • Michael J. Cannon

    • milestone: 131870 -->
    • priority: 5 --> 1
     
  • Michael J. Cannon

    • assigned_to: dedmike --> fredt
     

Log in to post a comment.