Class: Array

Inherits:
Object show all
Defined in:
lib/sparql/algebra/extensions.rb

Overview

Extensions for Ruby's Object class.

Instance Method Summary (collapse)

Instance Method Details

- (RDF::Term) evaluate(bindings)

Evaluates the array using the given variable bindings.

In this case, the Array has two elements, the first of which is an XSD datatype, and the second is the expression to be evaluated. The result is cast as a literal of the appropriate type



36
37
38
39
# File 'lib/sparql/algebra/extensions.rb', line 36

def evaluate(bindings)
  dt, val = self.map {|o| o.evaluate(bindings)}
  SPARQL::Algebra::Expression.cast(*self.map {|o| o.evaluate(bindings)})
end

- (String) to_sse

Returns the SXP representation of this object, defaults to `self'.



22
23
24
# File 'lib/sparql/algebra/extensions.rb', line 22

def to_sse
  map {|x| x.to_sse}
end