sign in
Home | Updates | Pages | Users | Admin | Help

SWORD

The Semantic Web on Rails Development (SWORD) plugin eases the development of semantic web applications. SWORD is a ruby-on-rails plugin that provides scaffolding based on semantic web information.

Overview

SWORD allows you to generate a controller, model and views for managing one type of semantic web data, such as a foaf:Person. The controller offers actions such as list all people, search a person, fetch online semantic web information about people, and show/edit/update specific people. The generator also creates an ActiveRDF model for foaf:Person and basic views for each action. Based on these files automatically generated files, the application developer can further configure, enhance, and develop his application.

Example: a foaf editor and viewer

current way of installing and trying SWORD

First, you need to install ‘rapper’ from http://librdf.org. On Debian it’s in the ‘raptor-utils’ package.

Then create an (empty) rails app, and download the SWORD plugin (the bzr repository only contains the plugin, not the full application anymore). After that you can create rails model, view and controller for a specific RDF Schema, of which you must provide a location. In the below example, a MVC will be created for FOAF::Person.

$ have rapper installed, see http://librdf.org.
$ gem install --include-dependencies rails
$ gem install --include-dependencies activerdf_rdflite
$ rails test-app
$ cd test-app/vendor/plugins
$ bzr get http://bazaar.launchpad.net/~activerdf/sword/dev/ sword
$ cd ../../
$ ./script/generate scabbard person foaf http://xmlns.com/foaf/0.1/
$ ./script/server

Done! Point your browser to http://localhost:3000/people and play. The application runs and is fully functional, allowing users to fetch foaf data from the web, to search, display, and edit information about people.

Generated files

The scabbard generator constructs the following files (for the example of foaf:Person):

app/controllers/people_controller.rb
app/models/person.rb
app/views/people/edit.rhtml
app/views/people/list.rhtml
app/views/people/new.rhtml
app/views/people/show.rhtml

Getting involved

:)


Powered by JunebugWiki v0.0.31 Page last edited by duck1123 on May 18, 2008 04:50 PM (diff)
Version 31 (current) «olderversions