Class: RDF::Query::Solutions
Overview
Extensions for RDF::Query::Solutions
.
Instance Method Summary collapse
-
#filter(expression = {}) {|solution| ... }
(also: #filter!)
Filters this solution sequence by the given
criteria
. - #filter_without_expression ⇒ Object
Instance Method Details
#filter(expression = {}) {|solution| ... } Also known as: filter!
This method returns an undefined value.
Filters this solution sequence by the given criteria
.
236 237 238 239 240 241 242 243 244 245 246 |
# File 'lib/sparql/algebra/extensions.rb', line 236 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 |
#filter_without_expression ⇒ Object
225 |
# File 'lib/sparql/algebra/extensions.rb', line 225 alias_method :filter_without_expression, :filter |