Class: RDF::Query::Solutions

Inherits:
Object
  • Object
show all
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

SPARQL::Results::MIME_TYPES

Instance Method Summary collapse

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.

Parameters:

Yields:

  • (solution)

    each solution

Yield Parameters:

Yield Returns:

  • (Boolean)


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_expressionObject



600
# File 'lib/sparql/algebra/extensions.rb', line 600

alias_method :filter_without_expression, :filter