Class: RDF::N3::Algebra::Math::ATanH
- Inherits:
-
ResourceOperator
- Object
- SPARQL::Algebra::Operator::Binary
- ResourceOperator
- RDF::N3::Algebra::Math::ATanH
- Defined in:
- lib/rdf/n3/algebra/math/atanh.rb
Overview
The object is calulated as the inverse hyperbolic tangent value of the subject.
Constant Summary collapse
Instance Attribute Summary
Attributes included from Enumerable
Instance Method Summary collapse
-
#resolve(resource, position:) ⇒ RDF::Term
The math:atanh operator takes string or number and calculates its inverse hyperbolic tangent.
Methods inherited from ResourceOperator
#as_literal, #execute, #input_operand, #valid?
Methods included from Builtin
#each, #evaluate, #hash, #input_operand, #rank, #to_uri
Instance Method Details
#resolve(resource, position:) ⇒ RDF::Term
The math:atanh operator takes string or number and calculates its inverse hyperbolic tangent.
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/rdf/n3/algebra/math/atanh.rb', line 15 def resolve(resource, position:) case position when :subject return nil unless resource.literal? as_literal(Math.atanh(resource.as_number.object)) when :object return nil unless resource.literal? || resource.variable? resource end end |