Class: RDF::Query::Solutions
- Includes:
- SPARQL::Results
- Defined in:
- lib/sparql/algebra/extensions.rb,
lib/sparql/extensions.rb
Overview
Extensions for RDF::Query::Solutions
.
Constant Summary
Constants included from SPARQL::Results
Instance Method Summary collapse
-
#filter(expression = {}) {|solution| ... }
(also: #filter!)
Filters this solution sequence by the given
criteria
. - #filter_without_expression ⇒ Object
Methods included from SPARQL::Results
#to_csv, #to_html, #to_json, #to_tsv, #to_xml
Instance Method Details
#filter(expression = {}) {|solution| ... } Also known as: filter!
This method returns an undefined value.
Filters this solution sequence by the given criteria
.
611 612 613 614 615 616 617 618 619 620 621 |
# File 'lib/sparql/algebra/extensions.rb', line 611 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
600 |
# File 'lib/sparql/algebra/extensions.rb', line 600 alias_method :filter_without_expression, :filter |