Operate on Multiple Instances of JPL

Hi. I’m using JPL for Prolog in Java. I would like to maintain multiple knowledge basese at the same time for comparison and answering different queires. However, according to JPL documentation, an prolog engine is initiated via a static method init() of class JPL. Is there a possible way to create multiple instances of SWIPL engine in the same process?

No. There can be only one Prolog instance in a process. You can however put different knowledge bases into multiple Prolog modules to load them into the same Prolog instance and query the appropriate module. The best way of doing so depends on the structure of the knowledge and the (reusable) code reasoning about the knowledge. There have been several discussions on related topics on this forum.

Thanks Jan!
I just found this topic about modules in the forum. Hope others who encounter the same problem may find entrance here :slight_smile: