Skip to content

mauriciobomfim/ActiveRDF

 
 

Repository files navigation

ActiveRDF is a library for accessing RDF data from Ruby programs. It can be used as data layer in Ruby-on-Rails, similar to ActiveRecord (which provides an O/R mapping to relational databases). ActiveRDF in RoR allows you to create semantic web applications very rapidly. ActiveRDF gives you a Domain Specific Language (DSL) for your RDF model: you can address RDF resources, classes, properties, etc. programmatically, without queries.

See www.activerdf.org for more information.

Installing

$ rake install

To use ActiveRDF with Sesame or Jena, you must use it with JRuby. To install ActiveRDF on JRuby, use the command below:

$ jruby -S rake install

Simple Example

The following example uses a SPARQL endpoint with FOAF data and displays all people found in the data source:

require 'rubygems'
require 'active_rdf'
ActiveRDF::ConnectionPool.add_data_source :type => :sparql, :host => '...'
ActiveRDF::Namespace.register :foaf, 'http://xmlns.com/foaf/0.1/'
ActiveRDF::ObjectManager.construct_classes
people = FOAF::Person.find_all

Sesame native store example

ActiveRDF::ConnectionPool.add_data_source :type => :sesame, :location => 'path/to/store/dir', :inferencing => true

OWLIM-SE store example

ActiveRDF::ConnectionPool.add_data_source :type => :sesame, :location => 'path/to/store/dir', :backend => 'owlim-se', :ruleset => 'owl-horst'

To use ActiveRDF with OWLIM-SE store, you must get OWLIM-SE >= 4.1 at http://www.ontotext.com/owlim.

After get OWLIM-SE files, execute the procedure below:

  1. Extract OWLIM-SE files at your local computer;

  2. Copy the content of ‘lib’ and ‘ext’ directories (from OWLIM-SE) to activerdf-sesame/ext;

  3. Run rake install again.

Licence information: The OWLIM-SE LICENCE is granted free of charge. The LICENCEE is allowed to install and use the PRODUCTS for research and evaluation purposes only. For more details see http://www.ontotext.com/owlim-license-agreement.

License

ActiveRDF is distributed under the LGPL license.

Authors

  • Eyal Oren

  • Renaud Delbru

  • Sebastian Gerke

  • Benjamin Heitmann

About

Object oriented RDF in Ruby

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 97.8%
  • Java 2.2%