class RDF::Query::Solutions
Extensions for `RDF::Query::Solutions`.
Extensions for `RDF::Query::Solutions`.
Public Instance Methods
filter(expression = {}, &block)
click to toggle source
Filters this solution sequence by the given `criteria`.
@param [SPARQL::Algebra::Expression] expression @yield [solution]
each solution
@yieldparam [RDF::Query::Solution] solution @yieldreturn [Boolean] @return [void] `self`
# File lib/sparql/algebra/extensions.rb, line 555 def filter(expression = {}, &block) case expression when SPARQL::Algebra::Expression filter_without_expression do |solution| expression.evaluate(solution).true? end filter_without_expression(&block) if block_given? self else filter_without_expression(expression, &block) end end
Also aliased as: filter_without_expression, filter!