class RDF::N3::Algebra::Str::GreaterThan
True iff the string is greater than the object when ordered according to Unicode(tm) code order.
Constants
- NAME
- URI
Public Instance Methods
apply(left, right)
click to toggle source
@param [RDF::Literal] left
a literal
@param [RDF::Literal] right
a literal
@return [RDF::Literal::Boolean]
# File lib/rdf/n3/algebra/str/greater_than.rb, line 29 def apply(left, right) case when !left.is_a?(RDF::Term) || !right.is_a?(RDF::Term) || !left.compatible?(right) log_error(NAME) {"expected two RDF::Literal operands, but got #{left.inspect} and #{right.inspect}"} when left > right then RDF::Literal::TRUE else RDF::Literal::FALSE end end
input_operand()
click to toggle source
Both subject and object are inputs.
# File lib/rdf/n3/algebra/str/greater_than.rb, line 19 def input_operand RDF::N3::List.new(values: operands) end
resolve(resource, position:)
click to toggle source
The string:greaterThan compares subject with object as strings.
@param [RDF::Term] resource @param [:subject, :object] position @return [RDF::Term] @see RDF::N3::ResourceOperator#evaluate
# File lib/rdf/n3/algebra/str/greater_than.rb, line 14 def resolve(resource, position:) resource if resource.literal? end