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
.
638 639 640 641 642 643 644 645 646 647 648 |
# File 'lib/sparql/algebra/extensions.rb', line 638 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
627 |
# File 'lib/sparql/algebra/extensions.rb', line 627 alias_method :filter_without_expression, :filter |