Class: RDF::N3::Algebra::Math::GreaterThan
- Inherits:
- 
      ResourceOperator
      
        - Object
- SPARQL::Algebra::Operator::Binary
- ResourceOperator
- RDF::N3::Algebra::Math::GreaterThan
 
- Defined in:
- lib/rdf/n3/algebra/math/greater_than.rb
Overview
True iff the subject is a string representation of a number which is greater than the number of which the object is a string representation.
Direct Known Subclasses
Constant Summary collapse
Instance Attribute Summary
Attributes included from Enumerable
Instance Method Summary collapse
- 
  
    
      #apply(term1, term2)  ⇒ RDF::Literal::Boolean 
    
    
  
  
  
  
  
  
  
  
  
    Returns TRUE if term1is greater thanterm2.
- 
  
    
      #input_operand  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    Both subject and object are inputs. 
- 
  
    
      #resolve(resource, position:)  ⇒ RDF::Term 
    
    
  
  
  
  
  
  
  
  
  
    Resolves inputs as numbers. 
Methods inherited from ResourceOperator
#as_literal, #execute, #valid?
Methods included from Builtin
#each, #evaluate, #hash, #rank, #to_uri
Instance Method Details
#apply(term1, term2) ⇒ RDF::Literal::Boolean
Returns TRUE if term1 is greater than term2.
| 37 38 39 | # File 'lib/rdf/n3/algebra/math/greater_than.rb', line 37 def apply(term1, term2) RDF::Literal(term1 > term2) end | 
#input_operand ⇒ Object
Both subject and object are inputs.
| 22 23 24 | # File 'lib/rdf/n3/algebra/math/greater_than.rb', line 22 def input_operand RDF::N3::List.new(values: operands) end | 
#resolve(resource, position:) ⇒ RDF::Term
Resolves inputs as numbers.
| 17 18 19 | # File 'lib/rdf/n3/algebra/math/greater_than.rb', line 17 def resolve(resource, position:) resource.as_number if resource.term? end |