This guide is outdated with respect to latest OWLIM versions and to capabilities of ST for interacting with OWLIM/GraphDB. We

A more recent and simple article is available here: Using GraphDB (formerly OWLIM) with Semantic Turkey

We keep this page open as it still contains useful information such as using custom rulesets, however the page above is the official reference for (easily) accessing an OWLIM/GraphDB repository.

This guide is meant to remain as “static” as possible, along different configuration scenarios embracing data and vocabulary updates, changes in the various installation settings etc. For this reason, reference is made to an external wiki page on the google project site of Semantic Turkey:

https://code.google.com/p/agrovoc-cs-workbench/wiki/VB2_Installation (note: if you want to perform a quick test-drive of ST, you don't need to follow this)

In the above wiki page, several configuration parameters have been defined, belonging to the different components which are part of VB2.0. The user may refer to a particular installation configuration presented there, as a series of ATTRIBUTE-VALUE pairs, where ATTRIBUTE is one of the configuration parameters required by the installation and VALUE represents the specific value which will be assigned for that particular configuration. This installation guide will use ATTRIBUTE names which are consistent with those present in the wiki.

The ATTRIBUTE will be explicitly mentioned by wrapping it between {} brackets.

E.g. {OWLIM.TOTAL_CACHE_MEMORY}

OWLIM Setup  

By using the content of {OWLIM.VERSION}, follow the instructions online at: http://owlim.ontotext.com/display/OWLIMv54/OWLIM-SE+Installation#OWLIM-SEInstallation-Easyinstall only for deploying the OWLIM .war files into Tomcat. We will ot use OWLIM for a first inst

and stop before the instruction starting with this text:
“Fill in the fields as required…”   
follow now the specific instructions here below for creating a repository

Also, other than all the “OWLIM.” prefixed properties, consider the {DATA.BASEURL} to be used in the “Base URL” field of the configuration.

In particular, be sure to check that all the parameters starting with {OWLIM. in the interested configurations have found a match in the entries (with a similar name) in the form, and leave untouched all those form fields which are not specified in the configurations.   
Confirm after all the fields have been filled up, by clicking the “create” button.

 2.   Add the new project to Semantic Turkey

This will be defined in a new version of the guide. If you have installed SemanticTurkeyData in the “Semantic Turkey Server Setup”, it will come with an already configured project for your first install.

 

Create a new project   with OWLIM

Follow the steps in Configuring OWLIM-SE for ST (section Create new project), until "Creating a plain Sesame2 project (no OWLIM)" excluded. Then follows these steps for connecting to the OWLIM instance.

Creating an OWLIM project

How to use a custom ruleset

OWLIM allows for loading custom rulesets (used for inferencing) instead of the precompiled ones bundled with the OWLIM distribution. .

Custom rulesets may be easily loaded by specifying the full path to their file location as a value for the OWLIM configuration parameter: “ruleset” (instead of the code name of the standard ones).

However, while this is pretty straightforward when specifying an OWLIM configuration programmatically, doing this through the Sesame2 workbench is not trivial, as the workbench only allows for pre-defined values (associated to the standard preloaded ruleset).

Here follows the instructions for changing ruleset in Sesame2 workbench

The instructions have been compiled by following the example reported in this post on the OWLIM forum:

http://answers.ontotext.com/questions/996/archive-setting-ruleset-owlim-repository-using-sesame-workbench

PREFIX sys:  <http://www.openrdf.org/config/repository#>     
PREFIX sail: <http://www.openrdf.org/config/repository/sail#>
PREFIX onto: <http://www.ontotext.com/trree/owlim#>
SELECT ?g ?sail ?param ?value
WHERE {
    GRAPH ?g { ?rep sys:repositoryID ?id . }
    GRAPH ?g { ?rep sys:repositoryImpl ?impl . }
    GRAPH ?g { ?impl sys:repositoryType ?type . }
    GRAPH ?g { ?impl sail:sailImpl ?sail . }
    GRAPH ?g { ?sail ?param ?value . }
    FILTER( ?id = "{OWLIM.REPOSITORY_ID}" ) .
    FILTER( ?param = onto:ruleset ) .
}


to check that the parameter is, as expected, the “empty” value that has been selected when creating the repository. Note the use of the OWLIM.REPOSITORY_ID, which you must obviously replace with your OWLIM repository ID.

PREFIX sys:  <http://www.openrdf.org/config/repository#>
PREFIX sail: <http://www.openrdf.org/config/repository/sail#>
PREFIX onto: <http://www.ontotext.com/trree/owlim#>
DELETE { GRAPH ?g {?sail ?param ?old_value } }
INSERT { GRAPH ?g {?sail ?param ?new_value } }
WHERE {
   GRAPH ?g { ?rep sys:repositoryID ?id . }
   GRAPH ?g { ?rep sys:repositoryImpl ?impl . }
   GRAPH ?g { ?impl sys:repositoryType ?type . }
   GRAPH ?g { ?impl sail:sailImpl ?sail . }
   GRAPH ?g { ?sail ?param ?old_value . }
   FILTER( ?id = "{OWLIM.REPOSITORY_ID}" ) .
   FILTER( ?param = onto:ruleset ) .
   BIND( "<directorypathtoyourcustompiefile>/builtin_owl2-rl-fixed.pie" AS ?new_value ) .
}

by changing the parameters of the last and the third to last rows in the following way: