How to use the srcurl option in Pengines?

This is my JS code. I am trying to ask a query through a button and getting this error: procedure 'ef95febb-4e5c-42e3-85f0-050ddc8d2364':graf(A,B,C,D)' does not exist.
How to use the option correctly?

var pengine = new Pengine({
	server: "https://pengines.swi-prolog.org/pengine",
	srcurl: "/apps/examples/parents_tree.pl"
});
$("#run-btn").on("click", function() {
	var answer = pengine.ask('graf(_,_,_,G)');
	console.log(answer);
});
1 Like

The text srcurl doesn’t appear in the source. src_url does. I guess this is either a typo or an error in some piece of documentation floating around.

1 Like

It is on this page: https://pengines.swi-prolog.org/docs/documentation.html#javascript-api

All the underscores are missing so probably eaten by some markup or markdown processor.

It is already missing here: https://github.com/SWI-Prolog/pengines/blob/74c318deeb22e64110ad655fa565b29ff744f30d/www/docs/documentation.html

1 Like

I have updated https://pengines.swi-prolog.org. Note that this site is not well maintained though. The core of the Pengines is a standard SWI-Prolog package. The pengines site reflects @torbjorn.lager original ideas. Torbjorn is concentrating on Web Prolog and SWI-Prolog comes with the bundled old pengines core library and SWISH.

Okay, I got it. Where can I get the source code of pengines? Because the links on https://pengines.swi-prolog.org don’t provide pengines.js and related files.

I have never used PEngines, but checking the GitHub SWI-Prolog repository has

which has

2 Likes

I got that, thank you