Ben Engbers
Ben Engbers

Reputation: 453

How to call a Prolog-predicate from a Java webapp?

On my Linux-machine, I have developed a predicate (using SWI-Prolog) which I want to call from a webapp. And preferably I would like to deliver the predicate as a platform-independent unit that could be called from any java-based applicationserver (Tomcat, Wildfly, Websphere?) With JPL it is possible to construct a bridge between Prolog and Java. And I know that it's possible to build a stand-alone executable for the predicate.

Is it possible to pack all the needed files into a WAR-file, should I try to make use of docker-technology or are there any other approaches?

Upvotes: 2

Views: 307

Answers (2)

Lokesh Verma
Lokesh Verma

Reputation: 51

You can use mProlog for Web related project. This is a light weighted Prolog Engine. mProLog

You can also edit this Engine according to your requirement. I was also stuck on this point but SWI-Prolog is not able to support for java web [J2EE] Environment.

But sure it will help you

Upvotes: 0

user2800708
user2800708

Reputation: 2000

There is a Java Prolog Connectivity library here:

https://github.com/java-prolog-connectivity

Which provides a uniform interface between Java and a number of Prolog systems. Unfortunately, I don't think any of the Prolog systems with drivers written for it are 100% pure Java implementations - so you can't pack the whole thing into a single WAR-file.

There are some 100% Java Prolog implementations around. This one for example:

https://www.gnu.org/software/gnuprologjava/

Would be nice to see a JPC driver for it - check there isn't already one.

Upvotes: 2

Related Questions