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 6-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
4. install rake:
gem install rake --include-dependencies --no-rdoc --no-ri
5. install activerdf and activerdf-sesame
gem install activerdf-sesame --include-dependencies --no-rdoc --no-riYou can get them from http://rubyforge.org/projects/activerdf/ , if the rubygems mirrors are not quick enough for this howto.
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.1/ext/ or similiar. we will define JRUBY_HOME/lib/ruby/gems/1.8/gems/activerdf_sesame-0.1/ 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.
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 )