Graffiti RDF store now uses Sequel instead of DBI for relational database access. Sequel understands named parameters, so there's no more need for the awkward passing of re-ordered params list in SquishSelect#to_sql and Store#select, both methods now return just the translated SQL query. The query itself will have the column names aliased to blank node names from the Squish query where applicable.
require 'sequel' require 'yaml' require 'graffiti' db = Sequel.connect(:adapter => 'pg', :database => dbname) config = File.open('rdf.yaml') {|f| YAML.load(f.read) } store = Graffiti::Store.new(db, config) data = store.fetch(%{ SELECT ?date, ?title WHERE (dc::date ?r ?date FILTER ?date >= :start) (dc::title ?r ?title) ORDER BY ?date DESC}, 10, 0, :start => Time.now - 24*3600) puts data.first[:title]