Archive for the ‘ActiveRDF’ Category

A Semantic Web Architecture for a Rails Hosted Environment

Saturday, October 20th, 2007

Last week-end I installed ActiveRDF on my Mac OS X Powerbook, together with the Sparql, RDFLite and Redland adapters. Ideally I am working towards setting up an environment that allows me to build RESTful Semantic Web Applications that support reasoning over RDF data and implement a SPARQL query end point. Support for OpenID authentication, integrated with FOAF, is also at the top of the list.

On the Powerbook I could also install the ActiverRDF adapters for Sesame and Jena to give me the functionality that I am after but that only works in my development environment. Sesame and Jena are Java based. When it comes to deploying an application onto the web my options are currently more limited. 3kbo is deployed into hosted environment which supports PHP, Python, Ruby and Ruby On Rails and PERL, but no Java. (There is C/C++, limited to my local user account.)

Currently there are two PHP SPARQL implementations, ARC and RAP. RAP also provides a reasoning engine InfModel, with support for owl:sameAs and owl:inverseOf.

So at this stage the architecture that is emerging is an ActiveRDF RESTful Ruby On Rails application that uses RAP as the triple store, SPARQL query engine and reasoning engine. To integrate Rails with PHP I am planning to implement a RESTful PHP interface that acts as a facade to RAP.

Installing Ruby On Rails on Mac OS X

Saturday, August 25th, 2007

The two main sites I am working with are www.3kbo.com and www.abeservices.com.au. 3kbo is hosted at www.railsplayground.com and is centered around Ruby On Rails apps while www.abeservices.com.au has its own server and is java focused.

The plan is to develop semantic web based applications using the Ruby based RDF framework ActiveRDF and deploy them at 3kbo. The 3kbo applications will also be leveraging the Ruby On Rails web framework.

The first step in getting started is to install Ruby On Rails on my new(ish) Mac PowerBook. Initially I will be using just two of the available ActiveRDF adaptors, “SPARQL” and “RDFLite”. RDFLite needs SQLite3, meaning that the default version that comes with Mac OS X needs to be updated. Since RDFLite can also utilize ferret , the Ruby search engine library, this was installed as well.

To install Ruby on Rails I followed the basic instructions outlined in Installing Ruby on Rails and PostgreSQL on OS X.

This approach uses MacPorts and overall worked well, apart from getting the following error at the very beginning:

“Error: search for portname ruby failed: No index(es) found! Have you synced your source indexes?”

The fix was to run the port selfupdate command:

$ sudo port selfupdate

After that ruby and ruby gems were successfully installed with the port command:

$ sudo port install ruby rb-rubygems

Well almost. The first attempt to install rails using gem ended with the error:

Bulk updating Gem source index for: http://gems.rubyforge.org
ERROR: While executing gem … (Gem::GemNotFoundException)
Could not find rails (> 0) in any repository

Problem solved by following the instructions at http://armyofevilrobots.com/node/418, i.e delete the gem source_cache and update gems.

$ sudo gem update

With gem updated rails installed fine.

$ sudo gem install -y rails

SQLite3 installed without problem

$ sudo port install sqlite3

So did ferret

$ gem install ferret

To test that all was fine I created a basic Rails app following the steps outlined in Rolling with Ruby on Rails Revisited

$ rails example
$ cd example
$ ruby script/server

And view at http://localhost:3000/

Or to check when running with Mongrel

$ mongrel_rails start

And view at http://localhost:3000/

With the basic Rails app working it was time to get started with ActiveRDF.