Class: SPARQL::Algebra::Operator::Exprlist
- Inherits:
-
SPARQL::Algebra::Operator
- Object
- SPARQL::Algebra::Operator
- SPARQL::Algebra::Operator::Exprlist
- Includes:
- Evaluatable
- Defined in:
- lib/sparql/algebra/operator/exprlist.rb
Overview
The SPARQL GraphPattern exprlist
operator.
Used for filters with more than one expression.
[72] ExpressionList ::= NIL | ‘(’ Expression ( ‘,’ Expression )* ‘)’
Constant Summary collapse
- NAME =
[:exprlist]
Constants inherited from SPARQL::Algebra::Operator
Constants included from Expression
Instance Attribute Summary
Attributes inherited from SPARQL::Algebra::Operator
Instance Method Summary collapse
-
#evaluate(bindings, **options) ⇒ RDF::Literal::Boolean
Returns
true
if all operands evaluate totrue
.
Methods included from Evaluatable
#apply, #memoize, #replace_aggregate!, #replace_vars!
Methods inherited from SPARQL::Algebra::Operator
#aggregate?, arity, #base_uri, base_uri, base_uri=, #bind, #boolean, #constant?, #deep_dup, #each_descendant, #eql?, #evaluatable?, evaluate, #executable?, #first_ancestor, for, #initialize, #inspect, #ndvars, #node?, #operand, #optimize, #optimize!, #parent, #parent=, #prefixes, prefixes, prefixes=, #rewrite, #to_binary, to_sparql, #to_sparql, #to_sxp, #to_sxp_bin, #validate!, #variable?, #variables, #vars
Methods included from Expression
cast, #constant?, extension, extension?, extensions, for, #invalid?, new, #node?, open, #optimize, #optimize!, parse, register_extension, #to_sxp_bin, #valid?, #validate!, #variable?
Constructor Details
This class inherits a constructor from SPARQL::Algebra::Operator
Instance Method Details
#evaluate(bindings, **options) ⇒ RDF::Literal::Boolean
Returns true
if all operands evaluate to true
.
Note that this operator operates on the effective boolean value (EBV) of its operands.
52 53 54 55 |
# File 'lib/sparql/algebra/operator/exprlist.rb', line 52 def evaluate(bindings, **) res = operands.all? {|op| boolean(op.evaluate(bindings, **.merge(depth: [:depth].to_i + 1))).true? } RDF::Literal(res) # FIXME: error handling end |