Sha256: 1248eb4753a7777b39253b29a387367e84588b16e51fd3696a03e0b0ad9ed2fb
Contents?: true
Size: 862 Bytes
Versions: 4
Compression:
Stored size: 862 Bytes
Contents
module RDF::N3::Algebra::Str # True iff the subject string contains the object string. class Contains < RDF::N3::Algebra::ResourceOperator NAME = :strContains URI = RDF::N3::Str.contains ## # Resolves inputs as strings. # # @param [RDF::Term] resource # @param [:subject, :object] position # @return [RDF::Literal] # @see RDF::N3::ResourceOperator#evaluate def resolve(resource, position:) resource if resource.term? end # Neither subect nor object are considered inputs, and must be resolved before evaluation. def input_operand RDF::N3::List.new end ## # @param [String] left # a literal # @param [String] right # a literal # @return [RDF::Literal::Boolean] def apply(left, right) RDF::Literal(left.to_s.include?(right.to_s)) end end end
Version data entries
4 entries across 4 versions & 1 rubygems