Configure IIS for SWI programs

37 views
Skip to first unread message

Roger Layton

unread,
Mar 3, 2017, 1:46:59 AM3/3/17
to SWI-Prolog
I have just started to use SWI Prolog and I am planning to build an expert system as part of a larger application I am building in C# / SQL Server.

I have been looking for guidelines on how to configure IIS (Windows 10) to run SWI Prolog programs - being programs with an .swi extention (rather than .pl which may be a conflict). I have searched this forums, the SWI Prolog documentation and the web, but without success.

I can run swipl.exe from the command line with the right parameters (-q, -t, -g) to run a program remotely and can emit the right HTML for this (or JSON or anything else I need).

What I would like is help from anyone who has configured recent versions of IIS run run prolog apps, and whether I am on the right track or not.

I am considering that a web service may be the best approach, given that I am not expecting my Prolog program to emit HTML but rather to take in the facts from a database, and to emit the conclusions and recommendations, which will then be picked up by other web programs.


Jacco van Ossenbruggen

unread,
Mar 3, 2017, 4:04:04 AM3/3/17
to swi-p...@googlegroups.com
Hi Roger,

We have been developing many web services based on SWI-Prolog. We tend to develop these using swipl as a stand-alone, multi-threaded web server running behind our firewall, and then configure a public web server (in our case typically Apache or nginx) to reverse proxy specific urls (e.g. all urls starting with some prefix) to the Prolog server. This allows development and testing of the Prolog services independently from the configuration of the main server, restricts all communication between the main server and Prolog to HTTP, and avoids overhead of restarting prolog (concurrently) on each (CGI) request. This works nice, both for HTML/CSS/JS based web applications as for more data driven (JSON, XML) Web APIs.

If your are aiming at a JSON-based API, you really should have a look at Jan's dict extensions [1], as these make JSON life really comfortable!

While my experiences are based on *nix environments, I think the same should work fine for IIS.

I hope this helps,

Jacco

PS: even if you are not interested in the Semantic Web capabilities of ClioPatria [2], you still might want to check it out
to have a look at the many builtin options it has to run SWI web services.

[1] http://www.swi-prolog.org/pldoc/man?section=dicts
[2] http://cliopatria.swi-prolog.org/

Roger Layton

unread,
Mar 3, 2017, 12:17:34 PM3/3/17
to SWI-Prolog
Thanks Jacco,

This is very helpful. Let me try the swipl web server approach. I was hoping to find a Prolog version within Visual Studio, but there is none I can find other than an editor and I found my way to SWI Prolog. I last used Prolog some 30 years ago, when I used to teach it, and quite a lot has changed!

The dict extensions look like a good way to prepare the information for export to anothersystem.

I will look more at ClioPatria as well - my current application is not Semantic Web, but I have many other projects which could use this for large-scale digital repositories and I have been considering AI approaches to accessing the information.

It is good to be back in the Prolog community after such a long time.

Roger

Anne Ogborn

unread,
Mar 3, 2017, 4:49:37 PM3/3/17
to Jacco van Ossenbruggen, swi-p...@googlegroups.com
SWI-Prolog can certainly emit html if you want.


http://www.pathwayslms.com/swipltuts/html/index.html

Sorry, know nothing about IIS.
Discover something new.

Anne Ogborn

unread,
Mar 3, 2017, 11:17:10 PM3/3/17
to Anne Ogborn, Jacco van Ossenbruggen, swi-p...@googlegroups.com
>Discover something new.
Sorry, I think that was in my copy/paste buffer when I started the reply, and it got pasted out of context from a completely unrelated message.
I aplogize if it looks a bit snarky in this context. I didn't intend for it to be in that message.

Reply all
Reply to author
Forward
0 new messages