class RDF::N3::Algebra::Math::Product
The subject is a list of numbers. The object is calculated as the arithmentic product of those numbers.
Constants
- NAME
- URI
Public Instance Methods
Source
# File lib/rdf/n3/algebra/math/product.rb, line 16 def resolve(list) list.to_a.map(&:as_number).reduce(&:*) || RDF::Literal(1) # Empty list product is 1 end
The math:product operator takes a list of strings or numbers and calculates their sum.
@param [RDF::N3::List] list @return [RDF::Term] @see RDF::N3::ListOperator#evaluate