Class: RDF::N3::Algebra::Log::EqualTo
- Inherits:
-
ResourceOperator
- Object
- SPARQL::Algebra::Operator::Binary
- ResourceOperator
- RDF::N3::Algebra::Log::EqualTo
- Defined in:
- lib/rdf/n3/algebra/log/equal_to.rb
Overview
True if the subject and object are the same RDF node (symbol or literal). Do not confuse with owl:sameAs. A cwm built-in logical operator, RDF graph level.
Constant Summary collapse
Instance Attribute Summary
Attributes included from Enumerable
Instance Method Summary collapse
- #apply(left, right) ⇒ RDF::Literal::Boolean
-
#input_operand ⇒ Object
Both subject and object are inputs.
-
#resolve(resource, position:) ⇒ RDF::Literal
Resolves inputs as terms.
Methods inherited from ResourceOperator
#as_literal, #execute, #valid?
Methods included from Builtin
#each, #evaluate, #hash, #rank, #to_uri
Instance Method Details
#apply(left, right) ⇒ RDF::Literal::Boolean
30 31 32 |
# File 'lib/rdf/n3/algebra/log/equal_to.rb', line 30 def apply(left, right) RDF::Literal(left.sameTerm?(right)) end |
#input_operand ⇒ Object
Both subject and object are inputs.
20 21 22 |
# File 'lib/rdf/n3/algebra/log/equal_to.rb', line 20 def input_operand RDF::N3::List.new(values: operands) end |
#resolve(resource, position:) ⇒ RDF::Literal
Resolves inputs as terms.
15 16 17 |
# File 'lib/rdf/n3/algebra/log/equal_to.rb', line 15 def resolve(resource, position:) resource if resource.term? end |