Class: RDF::N3::Algebra::Str::ContainsIgnoringCase
- Inherits:
-
ResourceOperator
- Object
- SPARQL::Algebra::Operator::Binary
- ResourceOperator
- RDF::N3::Algebra::Str::ContainsIgnoringCase
- Defined in:
- lib/rdf/n3/algebra/str/contains_ignoring_case.rb
Overview
True iff the subject string contains the object string, with the comparison done ignoring the difference between upper case and lower case characters.
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 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
29 30 31 |
# File 'lib/rdf/n3/algebra/str/contains_ignoring_case.rb', line 29 def apply(left, right) RDF::Literal(left.to_s.include?(right.to_s)) end |
#input_operand ⇒ Object
Both subject and object are inputs.
19 20 21 |
# File 'lib/rdf/n3/algebra/str/contains_ignoring_case.rb', line 19 def input_operand RDF::N3::List.new(values: operands) end |
#resolve(resource, position:) ⇒ RDF::Literal
Resolves inputs as lower-case strings.
14 15 16 |
# File 'lib/rdf/n3/algebra/str/contains_ignoring_case.rb', line 14 def resolve(resource, position:) RDF::Literal(resource.to_s.downcase) if resource.term? end |