Class: SPARQL::Algebra::Operator::IsBlank
- Inherits:
-
Unary
- Object
- SPARQL::Algebra::Operator
- Unary
- SPARQL::Algebra::Operator::IsBlank
- Defined in:
- lib/sparql/algebra/operator/is_blank.rb
Overview
The SPARQL isBlank operator.
Constant Summary
- NAME =
:isBlank
Constants inherited from Unary
Instance Method Summary (collapse)
-
- (RDF::Literal::Boolean) evaluate(solution)
Returns
trueif the operand is anRDF::Node,falseotherwise.
Methods inherited from Unary
Methods inherited from SPARQL::Algebra::Operator
#boolean, #constant?, evaluate, #initialize, #operand, #to_sse, #variable?
Constructor Details
This class inherits a constructor from SPARQL::Algebra::Operator::Unary
Instance Method Details
- (RDF::Literal::Boolean) evaluate(solution)
Returns true if the operand is an RDF::Node, false otherwise.
16 17 18 19 20 21 22 |
# File 'lib/sparql/algebra/operator/is_blank.rb', line 16 def evaluate(solution) case term = operand(0, solution) when RDF::Node then RDF::Literal::TRUE when RDF::Term then RDF::Literal::FALSE else raise TypeError, "expected an RDF::Term, but got #{term.inspect}" end end |