Tuesday, March 24, 2009

Sesame+OWLIM+Tomcat

Yesterday I think I managed to set up Sesame 2.2.4 with OWLIM 3.0 Beta running on Tomcat 6.0.18. The process is not documented anywhere very well. I found the solution on a mailing list, in messages posted last year, which wasn't archived where I would have expected. Frustrating. I hope this blog posting is a little easier to find and follow.

So, here's what you do... There are two broad steps, which are very similar to one another: set up the sesame console, and set up the sesame+tomcat server.

First sesame+tomcat.
  1. Unpack openrdf-sesame.war in tomcat webapps.
  2. In the WEB-INF folder, put the two jar files from OWLIM.
  3. Find your sesame preferences folder. For the mac that would be ~/Library/Application Support/Aduna/OpenRDF Sesame/. Create a folder templates, and put the content below into owlim.ttl.
  4. Start tomcat.
#
# Sesame configuration template for a owlim repository
#
@prefix rdfs: .
@prefix rep: .
@prefix sr: .
@prefix sail: .
@prefix 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#%}"

]
].


Next, set up the sesame console. If you don't plan on using owlim without tomcat, I don't think the following steps are necessary
  1. In the sesame folder's lib directory, add the owlim jar files.
  2. In ~/Library/Application Support/Aduna/OpenRDF Sesame console/templates put owlim.ttl.
Now we go on to creating an owlim repository. While I've gone through this procedure myself, I haven't yet tested if the repository is behaving like an OWL triple store. You have been warned.
  1. Start the console.
  2. Assuming default parameters with tomcat running on localhost, connect http://localhost:8080/openrdf-sesame.
  3. create owlim.
  4. Provide appropriate parameter values, and you're all set.
You should now have an owlim repository.
Reblog this post [with Zemanta]

6 comments:

Rinke Hoekstra said...

Thanks for this excellent walkthrough! I put together the pieces myself as well, some time ago, and was happy not to have to go through the same madness again.

There is one thing I'd like to add though, and that is that you need to start the console once before the "OpenRDF Sesame console" appears.

lars said...

Hey! i'm really glad that i finally found an page that adresses how to set up sesame + owlim.

my server (glassfish) runs sesame 2.2.4 and i fetched the latest owlim package.

after following your guide and trying to create an owlim-repository via the console it quits with:

ERROR: Unsupported Sail type: swiftowlim:Sail

any idea what causes this error?

skottk said...

Thanks for putting this together and locating the Aduna directory on the Mac.

On Windows it's in Documents and Settings\[user profile\Application Settings\Aduna.

Rune Stilling said...

Hi there

Is this supposed to work with the openrdf-workbench as well? I have tried to do the same thing, but when I want to create a new repository from the web interface I cannot choose owlim as type?

Cheers,
Rune

Rune Stilling said...

Sorry - Forget my last comment. I understand that you have to use the console to create the repository to which you can then afterwards connect with the workbench.

Mihir_Wagle said...

I can't find the templates subdirectory of the "\Documents and Settings\my-username\Application Data\Aduna\OpenRDF Sesame" directory on my Windows Vista machine :(