SPARQL Algebra for RDF.rb

This is an in-the-works (currently pre-alpha) Ruby implementation of the SPARQL algebra for RDF.rb.

Features

Examples

require 'sparql/algebra'

include SPARQL::Algebra

Evaluating operators without a solution sequence

Operator::IsBlank.evaluate(RDF::Node.new)           #=> RDF::Literal(true)
Operator::IsIRI.evaluate(RDF::DC.title)             #=> RDF::Literal(true)
Operator::IsLiteral.evaluate(RDF::Literal(3.1415))  #=> RDF::Literal(true)

Evaluating operators with a solution sequence

expression = Operator::Bound.new(RDF::Query::Variable.new(:email))
solutions  = query.execute(...) # see RDF::Query and RDF::Query::Solutions
solutions.filter! { |solution| expression.evaluate(solution).true? }

Documentation

http://sparql.rubyforge.org/algebra/

Dependencies

Installation

The recommended installation method is via RubyGems. To install the latest official release of the SPARQL::Algebra gem, do:

% [sudo] gem install sparql-algebra

Download

To get a local working copy of the development repository, do:

% git clone git://github.com/bendiken/sparql-algebra.git

Alternatively, download the latest development version as a tarball as follows:

% wget http://github.com/bendiken/sparql-algebra/tarball/master

Mailing List

Author

Contributors

Refer to the accompanying CREDITS file.

Contributing

License

This is free and unencumbered public domain software. For more information, see http://unlicense.org/ or the accompanying UNLICENSE file.