Menu Close

Overview

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.

  • ActiveRDF can be used with various RDF stores, adapters to other stores can be written very easily.
  • ActiveRDF uses convention over configuration, which means it works very nicely in 90% of the cases.
  • ActiveRDF is open source, released under the LGPL license.

The development of ActiveRDF was inspired and influenced by the work on model-driven web development of prof. Daniel Schwabe and his group on SHDM and HyperDE.

Examples

Query resources

require 'active_rdf'

ConnectionPool.add_data_source(:type => :sparql, :results => :sparql_xml, :engine => :virtuoso, :url => "http://dbpedia.org/sparql")
Namespace.register(:dbpedia, "http://dbpedia.org/ontology/")
tj = RDFS::Resource.new("http://dbpedia.org/resource/Thomas_Jefferson")
tj.dbpedia::birthPlace
tj.dbpedia::deathDate

query = Query.new.distinct(:o).where(tj, RDF::type, :o)
query.execute

Documentation

The wiki should be your starting point for documentation. You can read the RDoc API documentation online.

For a more general discussion on object-oriented access to RDF data, a comparison to other approaches and the advantages of a dynamic language such as Ruby, please see our WWW paper or the older SFSW workshop paper.

Download

You can install ActiveRDF and the adapters as a gem: “gem install activerdf” and then for example “gem install activerdf_rdflite”. Do “gem search -r activerdf” to see all available adapters.

Github is the new home of ActiveRDF. Check out a copy git clone git@github.com:ActiveRDF/ActiveRDF.git Make any changes you want locally, publish your branch somewhere online and send us an email.

Contact

Please report bugs or feature requests in our Github issue tracker, and use the mailinglist for questions, feature requests, or any other discussion. ActiveRDF is a product of Eyal OrenRenaud Delbru, Sebastian Gerke, and Benjamin Heitmann from DERI, supported by science Foundation Ireland under Grant No. SFI/02/CE1/I131. Currently maintained by Michael Diamond