Recipe for Sesame + OWLIM Install on Windows

smuthhomelyServers

Nov 17, 2013 (3 years and 6 months ago)

284 views

Recipe for Sesame + OWLIM
Install on Windows
Download the necessary software
Java
– Get Java JRE for your system.
Tomcat
-
http://tomcat.apache.org/
- the current version is 6.0.26. Please find the download link |
Core|32-bit/64-bit Windows Service Installer. Download, run the installer and accept the defaults. Note,
I choose to use port 8500 instead of 8080 and I added an admin ID and password.
Sesame 2

http://www.openrdf.org/
- find version 2.3.1-sdk.zip and download this. Unzip it to a
temp directory somewhere. Copy the two files in “…\openrdf-sesame-2.3.1\war\” (openrdf-sesame.war
& openrdf.workbench.war) into the” …\Program Files\Apache Software Foundation\Tomcat
6.0\webapps” directory.
OWLIM
-
http://www.ontotext.com/owlim/
- find the link for SwiftOWLIM v3.0.12. Copy the two files
in “…\swiftowlim-3.0.beta12-sesame-2.0.zip\swiftowlim-3.0.beta12-sesame-2.0\lib” (owlim-
3.0.beta12.jar & trree-3.0.beta12.jar) into the “…\Program Files\Apache Software Foundation\Tomcat
6.0\webapps\openrdf-sesame\WEB-INF\lib”
AND copy them to your “…\openrdf-sesame-2.3.1\lib” directory.
Start Tomcat and browse to Sesame Workbench to verify that it is setup.
To start Tomcat, find the item in Start | All Programs | Apache Tomcat 6.0 | Monitor Tomcat. Note you
may have to start this “As Administrator” if you are running Windows7. This will start the monitor –
you’ll need to right click on this in the task bar and choose “Start Service”. Tomcat should now be
running. Open your browser and connect to web interface at
http://localhost:8500/openrdf-workbench/

- if you see the list of repositories, then you are in business. This web interface will be the normal way
you can work with Sesame unless you want to program against it, in which case there are several
approaches to this. You’ll probably use the Add and Query functions for most of the basic stuff in the
examples in the book.
Configure an OWLIM repository
We will need to configure an OWLIM repository for any OWL lite reasoning that you might want to
experiment with in the book. We will need to add an OWLIM repository template to be able to create
the repository. However, we need to have the specific directory structure created in order to add our
template in the right place. We do this via the other interface to openrdf-sesame, the console. Find
“…\openrdf-sesame-2.3.1\bin\console.bat” and run this, and the following commands (with trailing
periods):
> connect http://localhost:8500/openrdf-sesame.
> create memory.
Please specify values for the following variables:
Repository ID [memory]: Mem1
Repository title [Memory store]: InMem 1
Persist (true|false) [true]: false
Sync delay [0]:
Repository created

Exit the console (type “exit.” (with the period)). This process will set up the directory structure:
Windows7 - “\Users\[username]\AppData\Roaming\Aduna\OpenRDF Sesame console\”
WindowsXP - “\Documents and Settings\[username]\Application Data\Aduna\OpenRDF Sesame console\”
Mac – “~/Library/Application Support/Aduna/OpenRDF Sesame console/”
Linux - /home/[username]/.aduna/openrdf-sesame-console/
Navigate to the one specific to your machine. To this we will add a “\templates” directory – then in this
new directory, create a text file with the name “owlim.ttl” and paste in the following:
#
# Sesame configuration template for a owlim repository
#
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>.
@prefix rep: <http://www.openrdf.org/config/repository#>.
@prefix sr: <http://www.openrdf.org/config/repository/sail#>.
@prefix sail: <http://www.openrdf.org/config/sail#>.
@prefix owlim: <http://www.ontotext.com/trree/owlim#>.

[] a rep:Repository ;
rep:repositoryID "{%Repository ID|owlimTest%}" ;
rdfs:label "{%Repository title|OWLIM Test store%}" ;
rep:repositoryImpl [
rep:repositoryType "openrdf:SailRepository" ;
sr:sailImpl [
sail:sailType "swiftowlim:Sail" ;
owlim:ruleset "{%Set of rules|owl-max%}" ;
owlim:partialRDFS "{%Partial RDFS|true|false%}" ;
owlim:noPersist "{%No Persistence|true|false%}" ;
owlim:storage-folder "{%Storage folder|owlimTest-storage%}" ;
owlim:base-URL "http://example.org/owlim#" ;
owlim:new-triples-file "new-triples-file.nt" ;
owlim:entity-index-size "200000" ;
owlim:jobsize "200" ;
owlim:repository-type "in-memory-repository" ;
owlim:imports "{%imports(';' delimited)|./ontology/owl.rdfs%}" ;
owlim:defaultNS "{%defaultNS(';' delimited)| http://www.w3.org/2002/07/owl#%}"

]
].

Save this file.
Rerun the console, connect to your localhost instance and you should be able to create your owlim
repository like such:
> create owlim.
Please specify values for the following variables:
Repository ID [owlimTest]: OWLIM
Repository title [OWLIM Test store]:
Set of rules [owl-max]:
Partial RDFS (true|false) [true]:
No Persistence (true|false) [true]:
Storage folder [owlimTest-storage]:
imports(';' delimited) [./ontology/owl.rdfs]:
defaultNS(';' delimited) [ http://www.w3.org/2002/07/owl#]:
Repository created
Note that while you can create the other default repository types from within openrdf-workbench, you
must create any OWLIM repositories from the console. You may want to search for “swiftowlim:Sail” or
“owlim.ttl” on the web and see some other examples of configurations – I haven’t explored this… Also
note that you’ll want to look at the release notes / documentation that come with OWLIM to determine
exactly what type of inference it supports.
Additional Links
Blog post about Sesame+OWLIM+Tomcat
http://4and5.sfmishras.com/2009/03/sesameowlimtomcat.html


Forum Thread about OWLIM configuration – slight different approach
http://www.openrdf.org/forum/mvnforum/viewthread?thread=2200&offset=0


Sesame docs
http://www.openrdf.org/doc/sesame2/2.3.1/users/index.html