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]