Class: RDF::SPARQL::Reader

Inherits:
Reader
  • Object
show all
Includes:
Common
Defined in:
lib/lib/reader.rb

Instance Method Summary collapse

Methods included from Common

#distinct?, #each_statement, #each_target, #each_triple, #each_variable, #reduced?, #statements, #targets, #triples, #type, #variables

Constructor Details

#initialize(input = $stdin, options = {}) {|reader| ... } ⇒ Reader

Returns a new instance of Reader.

Parameters:

  • input (IO, File, String) (defaults to: $stdin)

Yields:

  • (reader)

Yield Parameters:



12
13
14
15
16
17
18
19
20
21
22
# File 'lib/lib/reader.rb', line 12

def initialize(input = $stdin, options = {}, &block)
  @line = input.respond_to?(:read) ? input.read : input
  @graph = RDF::Graph.new
  @type = nil
  @prefixes = {}
  @variables = {}
  @targets = []
  @options = {}
  read_query
  block.call(self) if block_given?
end