redleaf

Redleaf is an RDF library for Ruby. It’s composed of a hand-written binding for the Redland RDF Library, and a high-level layer that adds some idioms that Rubyists might find familiar.

It currently binds a good slice of the functionality that is offered by Redland, but is still missing a few features. There are plans to add them in the near future. We’ve built and deployed projects using it, but the API may have to change somewhat as we learn more.

You can help out by checking out the current development source with Mercurial from the following URL:

    http://repo.deveiate.org/Redleaf

The project page also has more details and the most-recent API documentation:

    http://deveiate.org/projects/Redleaf

Testing

Provided you have Rake and RSpec (`gem install rake rspec` if you don’t) installed, you can run the tests in this directory with the command:

  $ rake spec

RDBMS-backed Store Tests

Note that the Redleaf::Store classes that store triples in an RDBMS actually do connect to a database. While this is not ideal (I’d much rather they work in isolation), it can’t be helped if the corresponding bindings are to be testable. Connection errors should be handled gracefully as ‘Pending’ examples, but if you want to exercise one or more of them, just make a YAML file called ‘test-config.yml’ in the base directory, and add a Hash for each backend you wish to test with the requisite connection information. An example is provided as ‘test-config.yml.example’.

W3C and RDFa Auto-Generated Tests

Redleaf includes an optional (and only partially-finished) implementation of the W3C RDF test suite (www.w3.org/TR/rdf-testcases/) and the RDFa test suite (www.w3.org/2006/07/SWD/RDFa/testsuite/) that run using Redleaf. There are rake tasks (`w3ctests` and `rdfatests` respecively) that will fetch the latest test manifests and data files and generate specs in the spec/ directory that then are included in the normal ‘rake spec’ run.

There are currently a large number of failures in the W3C test suite, but I’ve yet to determine whether they indicate a problem in Redleaf, Redland, or with the way I’m generating the specs. Suggestions or help in fixing them would be greatly appreciated.

The tests are really not that useful to the end-user (IMO), so they’re not distributed in the gem, and I’d ask that you only run them if you’re interested in helping out with them, as they do fetch files from other peoples’ servers (albeit with a sleep between each request).

See the spec/README file for more information on what the various files under spec/ do.

Authors

Contributors

License

Copyright © 2008-2009, Michael Granger All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Files

Classes/Modules

Methods

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.