Class: RDF::N3::Algebra::Str::EqualIgnoringCase
- Inherits:
-
ResourceOperator
- Object
- SPARQL::Algebra::Operator::Binary
- ResourceOperator
- RDF::N3::Algebra::Str::EqualIgnoringCase
- Defined in:
- lib/rdf/n3/algebra/str/equal_ignoring_case.rb
Direct Known Subclasses
Constant Summary collapse
Instance Attribute Summary
Attributes included from Enumerable
Instance Method Summary collapse
-
#apply(left, right) ⇒ RDF::Literal::Boolean
True iff the subject string is the same as object string ignoring differences between upper and lower case.
-
#input_operand ⇒ Object
Both subject and object are inputs.
-
#resolve(resource, position:) ⇒ RDF::Literal
Resolves inputs as lower-case strings.
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
True iff the subject string is the same as object string ignoring differences between upper and lower case.
30 31 32 |
# File 'lib/rdf/n3/algebra/str/equal_ignoring_case.rb', line 30 def apply(left, right) RDF::Literal(left.to_s == right.to_s) end |
#input_operand ⇒ Object
Both subject and object are inputs.
18 19 20 |
# File 'lib/rdf/n3/algebra/str/equal_ignoring_case.rb', line 18 def input_operand RDF::N3::List.new(values: operands) end |
#resolve(resource, position:) ⇒ RDF::Literal
Resolves inputs as lower-case strings.
13 14 15 |
# File 'lib/rdf/n3/algebra/str/equal_ignoring_case.rb', line 13 def resolve(resource, position:) RDF::Literal(resource.to_s.downcase) if resource.term? end |