class RDF::N3::Algebra::Str::ContainsIgnoringCase
True iff the subject string contains the object string, with the comparison done ignoring the difference between upper case and lower case characters.
Constants
- NAME
- URI
Public Instance Methods
apply(left, right)
click to toggle source
@param [String] left
a literal
@param [String] right
a literal
@return [RDF::Literal::Boolean]
# 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()
click to toggle source
Both subject and object are inputs.
# 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:)
click to toggle source
Resolves inputs as lower-case strings.
@param [RDF::Term] resource @param [:subject, :object] position @return [RDF::Literal] @see RDF::N3::ResourceOperator#evaluate
# 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