Pengines general use and from node.js application

Dear Community,

I am new to pengines, so I will be very grateful for any kind of help. I was thinking how could I use the prolog as knowledge base or model repository, while having some application in node.js utilizing it. So I installed the pengines to try it and I have following difficulties:

  1. After downloading the pengines and extracting from the archive, I’ve found some tutorial with examples https://www.swi-prolog.org/pengines/Genealogist.html, following all the steps: (i) executing run.pl, (ii) as example is already in app order, as well as load.pl in root I run the query:

use_module(library(pengines)).

response was true, as should be, but later when i run the query to get the results:

pengine_rpc(‘http://localhost:3030’, ancestor_descendant(X, Y), [
application(genealogist)
]).

I’ve got: Socket error: Connection refused

  1. Is there probably, something like node.js module of pengines I can install through the npm, by the analogy with Neo4j graph DB (where I need only to install neo4j-driver to utilize db) and if there is something (I haven’t found tutorials or detailed documentation, as I am new to pengines) following the analogy with Neo4j I need to have the running instance (with set port and password) of DB and when I create the DB instance I set the access port and password. So the question is, how can I run the instance of prolog using pengines? Where can I identify the access port? Is there some description of the whole process?

I would appreciate any help, as I am new and my questions might look very obvious for professionals.

Thank you in advance!

Artem

For using Pengines from Node.js, please look at https://www.npmjs.com/package/pengines

1 Like