Refactored the RDF::Queryable#query API for better extensibility and performance.
Refactored the RDF::Queryable#query API for better extensibility and performance.

RDF::Queryable#query now returns Enumerator<RDF::Statement> instead of Array<RDF::Statement>. This allows for lazy query execution and for arbitrarily large resultsets.

Starting from RDF.rb 0.2.0, RDF::Repository implementations should now override the protected #query_pattern method rather than the public #query method.

This simplifies RDF::Repository implementations since #query_pattern is guaranteed to always be called with a RDF::Query::Pattern argument and with a block given, obviating the need for e.g. manually constructing and returning an enumerator when #query wasn't given a block.

PerfectMemory/rdf,jcoyne/rdf,ninjapanzer/rdf,ruby-rdf/rdf