The ClioPatria Semantic Web Toolkit


ClioPatria is an extension of the SWI-Prolog RDF infrastructure (semweb package) that provides you with a ready-to-run web-server that can be extended into a full-fledged Semantic Web application. The semweb package provides reading and writing RDF (XML and Turtle), storage and querying by means of rdf(Subject, Predicate, Object). ClioPatria adds the following:


Basic installation merely requires installing a recent version of SWI-Prolog and unpacking ClioPatria (see Downloading below). Next, you can deploy it in two ways:

Installation as application

Running ClioPatria as an application requires a few steps:

  1. Create the start-file from On Unix, this is achieved by running `./configure` from the top directory. On Windows by double-clicking win-config.exe.
  2. Optionally, pull in additional configuration files according to config-enabled/README.txt. This can also be done later.
  3. Start as `./` on Unix or double-clicking on Windows and direct your browser to the indicated address (default is http://localhost:3020/. If this is the first time, you will be asked to enter an admin password. This protects some web-operations, such as managing settings and loading/unloading RDF.

If you want to extend the application, there are two options. One is to put a Prolog file with the desired extensions in config-enabled. Another is to run configure/setup from another directory. This creates and config-enabled in the current working directory, after which the extensions can be placed in config-enabled.

Windows notes

If the file name extension that is associated to SWI-Prolog is pl, you may install the system by double-clicking rather win-config.exe.

If the file name extension that is associated to SWI-Prolog is not pl, win-config.exe is needed to open SWI-Prolog on The installation will create a run script with the appropriate extension (typically pro).

Use as library

To use ClioPatria as a library, one can simply compile The file as generated from installation as an application gives additional actions you may want to setup. The web-server is started by cp_server/0, but the system runs happily if the Prolog HTTP server is started in another way, as long as the server uses http_dispatch/1 for dispatching HTTP requests.


Currently, ClioPatria can only be downloaded through GIT. The commands for downloading the system are:

git clone
cd ClioPatria
git submodule update --init web/yasqe
git submodule update --init web/yasr

Further reading

We published an article in the Semantic Web Journal that explains the rationale behind ClioPatria. Please cite this when you are using ClioPatria in your research (full reference below).

Many of the design issues around handling the Semantic Web in Prolog are described and motivated in Jan Wielemaker's PhD thesis (PDF) as well as various articles. RoadMap.txt explains the basic layout of the sources.

Feel free to join the ClioPatria mailing list at


    author    = {Jan Wielemaker and
                 Wouter Beek and
                 Michiel Hildebrand and
                 Jacco van Ossenbruggen},
  title     = {ClioPatria: {A} SWI-Prolog infrastructure for the Semantic Web},
  journal   = {Semantic Web},
  volume    = {7},
  number    = {5},
  pages     = {529--541},
  year      = {2016},
  url       = {},
  doi       = {10.3233/SW-150191},
  timestamp = {Mon, 12 Dec 2016 16:21:50 +0100},
  biburl    = {},
  bibsource = {dblp computer science bibliography,}

Prolog files  -- ClioPatria main moduleShow source
cp_after_load/1Register Goal to be executed after reloading the RDF persistent DB.Source
cp_server/0Start the HTTP server.Source
cp_server/1Start the HTTP server.Source
cp_welcome/0Print welcome banner.Source
create_pool/1Create a thread-pool on-demand.Source  -- ClioPatria hooksShow source
bnode_label/3HTML-write DCG rule that produces an HTML description for the given RDF blank node.Source
context_graph/3This hook redefines the context graph shown by the RDF browser for the resource R.Source
context_predicate/2True when rdf(Subject, Predicate, _) must be included in the context graph for Subject.Source
list_resource/4This hook is called by cpa_browse:list_resource//2, which display the `local view' page for a resource.Source
logo/2Logo placed left of the menu-bar.Source
menu_item/2This hook adds an item to the ClioPatria menu.Source
menu_label/2This hook allows for dynamic or redefined (e.g., multilingual) labels.Source
menu_popup_order/2This hook controls the order of the popup-item of ClioPatria's menu.Source
node_shape/3Compute the desired properties for a table used to display a bag of resources.Source
node_shape/3Compute the desired shape for a GraphViz node representing URI.Source
page_body/3Emit the body of the page.Source
page_body/4Emit the body of the page.Source
predicate_order/2Define the order in which predicates appear in the local view.Source
server_address/2HTML-write DCG rule that writes the address of the server.Source
user_preference_db/2Query properties for the current user/session.Source
user_preference_default/2Provides defaults for the user_preference/2.Source
label_property/1True if the value of Property can be used to (non-uniquely) describe an object to the user.Source  -- ClioPatria parametersShow source

ClioPatria wishlist


Quality Assurance

Browser facilities

LOD Support

RDF Management