ActiveRDF and RoR and Sesame
Howto setup Ruby on Rails and Active RDF and Sesame in Ten Steps
1. get jruby
get jruby, as described in this guide Dont forget to export JRUBY_HOME and include JRUBY_HOME/bin in your path. I currently (as of 8-Feb-2006) recommend revision 2886, so that would be:svn co -r 2886 svn://svn.codehaus.org/jruby/trunk/jruby jruby-trunkIf something does not work, you can try to update your jruby-trunk.
Go into your JRUBY_HOME, and do “ant clean test” to build jruby and run the tests. hopefully all tests pass.
2. always check your path
from now on make sure that only jruby versions of all relevant ruby tools are used.
3. install ruby on rails:
gem install rails --include-dependencies --no-rdoc --no-ri
This should also install rake for you.
4. install activerdf:
Install activerdf and the gems it depends on.
gem install activerdf --include-dependencies --no-rdoc --no-ri
5. install activerdf and activerdf-sesame
Download the activerdf-sesame gem from http://rubyforge.org/projects/activerdf/. Because it includes the sesame jars, it is to be big for automatic distrbution to the rubyforge mirrors, so you have to download it manually.
gem install /path/to/activerdf_sesame-0.2.gem --include-dependencies --no-rdoc --no-ri
6. set your java classpath
set your java classpath to include the sesame jars, which are a part of the sesame adapter. these jars should be in JRUBY_HOME/lib/ruby/gems/1.8/gems/activerdf_sesame-0.2/ext/ or similiar. we will define JRUBY_HOME/lib/ruby/gems/1.8/gems/activerdf_sesame-0.2/ to be SESAME_ADAPTER then do:export CLASSPATH=$SESAME_ADAPTER/ext/wrapper-sesame2.jar:$SESAME_ADAPTER/ext/openrdf-sesame-2.0-alpha4-onejar.jar
WARNING: this step is extremely necessary, and also the one you will most likely forget. If possible put this into your .bashrc or .zshrc. We hope to be able to do this automatically in future versions.
Well, and the seperator between the two jars in the classpath should be a colon and not a semicolon, that was in error in a previous version of this howto.
7. run the sesame adapter tests
cd $SESAME_ADAPTER/test jruby test_sesame_adapter.rbdont worry about java warnings, just make sure that the unit test summary mentions no errors or warnings from (j)ruby.
8. modify the rails application
perform the steps in the Getting Started Guide in the the section “The Semantic Web on Rails” at the bottom. see http://wiki.activerdf.org/GettingStartedGuide
9. start your ruby on rails application
you can now start your ruby on rails application using jruby like this:jruby ./script/server
10. welcome to the semantic underground
if you have come this far, then you are one of the lucky few persons in the world, who could potentialy build a ruby on rails application which uses rdfs inferencing. Please report your success to the activerdf users mailing list at activerdf@lists.deri.org :)
(Underground, because we dont use java per se, it is more like just using java to reach our goals, instead of wholeheartedly loving java, and promising it to get a house and 7 children. :P )