Class: SPARQL::Algebra::Operator::Equal
- Inherits:
-
Compare
- Object
- SPARQL::Algebra::Operator
- Binary
- Compare
- SPARQL::Algebra::Operator::Equal
- Defined in:
- lib/sparql/algebra/operator/equal.rb
Overview
The SPARQL relational = (equal) comparison operator.
Direct Known Subclasses
Constant Summary
- NAME =
=
Constants inherited from Binary
Constants inherited from SPARQL::Algebra::Operator
Instance Attribute Summary
Attributes inherited from SPARQL::Algebra::Operator
Instance Method Summary (collapse)
-
- (RDF::Literal::Boolean) apply(term1, term2)
Returns
trueif the operands are equal; returnsfalseotherwise.
Methods included from Evaluatable
Methods inherited from Binary
Methods inherited from SPARQL::Algebra::Operator
arity, base_uri, #base_uri, base_uri=, #boolean, #constant?, #eql?, #evaluatable?, evaluate, #executable?, for, #initialize, #inspect, #operand, #optimize, prefixes, #prefixes, prefixes=, #to_sse, #to_sxp, #variable?
Methods included from Expression
cast, #constant?, #evaluate, for, new, open, #optimize, parse, #to_sse, #variable?
Constructor Details
This class inherits a constructor from SPARQL::Algebra::Operator::Binary
Instance Method Details
- (RDF::Literal::Boolean) apply(term1, term2)
Returns true if the operands are equal; returns false otherwise.
25 26 27 28 29 |
# File 'lib/sparql/algebra/operator/equal.rb', line 25 def apply(term1, term2) term1 = term1.dup.extend(RDF::TypeCheck) term2 = term2.dup.extend(RDF::TypeCheck) RDF::Literal(term1 == term2) end |