SWI-Prolog Reasoner/Translator Plug-in Pair for SADL

Last revised 02/19/2016.

Note: This plug-in currently runs on Windows. Some additional work is required for launching the service on other operating systems.

Introduction

SWI-Prolog is a popular flavor of Prolog and one which is particularly well-suited for use with OWL due to its ability to load RDF Data.

Installation Instructions

Both the SWI-Prolog reasoner plug-in and the associated translator plug-in require that SWI-Prolog be available as a service. The translator uses the service to verify that built-in predicates used in rules are actually defined and the reasoner uses the service to do inference and to respond to queries.

Install SWI-Prolog

Assuming that an SWI-Prolog service is not already available and running, please follow these instructions to set up a local service.

  1. Download SWI-Prolog from http://www.swi-prolog.org/Download.html. If you are running 64-bit Eclipse, download the 64-bit version of SWI-Prolog. If you are running 32-bit Eclipse, download the 32-bit version of SWI-Prolog. Version 6.2.5 of SWI-Prolog is recommended. Later 6.x.x versions have been found to work in most respects but may not properly handle exceptions. For a complete list of versions, including 6.2.5, see http://www.swi-prolog.org/download/stable?show=all.
  2. Install per instructions from download site.
  3. Add the Prolog bin folder to the environment path. Restart Eclipse if it is already running. It may be necessary to reboot in order for SWI-Prolog to work correctly from the Eclipse IDE.

Install SWI-Prolog for SADL

 Install the SADL-IDE and SWI-Prolog for SADL by following these instructions but use the update site http://sadl.sourceforge.net/kepler/swiprolog/update/.

User Guidance

When the SWI-Prolog reasoner for SADL is requested, SADL will start the service provided that the executable (swipl-win.exe) is on the path.

In the SWI-Prolog plug-ins for SADL, custom built-in functions (predicates) can be defined in Prolog and used in SADL rules. A template file is generated in which predicates can be defined or which can "consult" other .pl files containing the predicates. The following files are created in the OwlModels folder when the SWI-Prolog translator plug-in is run for a project.

  1. swi-run-prolog-service.pl -- this file is passed to the SWI-Prolog executable and starts the service

  2. swi-prolog-service.pl -- this file is loaded by the previous and sets up the HTTP service used by the reasoner

  3. swi-standard-declarations.pl -- contains standard declarations and loads standard libraries for semantic web; loaded by first file in this list

  4. swi-custom-predicates.pl -- this is mean for the user to edit to define custom predicates and/or to load other files; it is loaded by the first file in this list