class RDF::N3::Algebra::Str::Matches
The subject is a string; the object is is a regular expression in the perl, python style. It is true iff the string matches the regexp.
Constants
- NAME
- URI
Public Instance Methods
Source
# File lib/rdf/n3/algebra/str/matches.rb, line 33 def apply(left, right) RDF::Literal(Regexp.new(right.to_s).match?(left.to_s)) end
Tre if right, treated as a regular expression, matches left
@param [RDF::Literal] left
a simple literal
@param [RDF::Literal] right
a simple literal
@return [RDF::Literal::Boolean] ‘true` or `false` @see www.w3.org/TR/xpath-functions/#regex-syntax
Source
# File lib/rdf/n3/algebra/str/matches.rb, line 20 def input_operand RDF::N3::List.new end
Neither subect nor object are considered inputs, and must be resolved before evaluation.
Source
# File lib/rdf/n3/algebra/str/matches.rb, line 15 def resolve(resource, position:) resource if resource.literal? end
Resolves inputs as strings.
@param [RDF::Term] resource @param [:subject, :object] position @return [RDF::Literal] @see RDF::N3::ResourceOperator#evaluate