Class: RDF::N3::Algebra::Math::Sum
- Inherits:
-
ListOperator
- Object
- SPARQL::Algebra::Operator::Binary
- ListOperator
- RDF::N3::Algebra::Math::Sum
- Defined in:
- lib/rdf/n3/algebra/math/sum.rb
Overview
schema: ($a_1 .. $a_n) math:sum $a_s
summary: performs addition of numbers
definition: true
if and only if the arithmetic sum of $a_1, .. $a_n
equals $a_s
. Requires either:
-
all
$a_1, .., $a_n
to be bound; or -
all but one
$a_i
(subject list) to be bound, and$a_s
to be bound.
literal domains:
-
$a_1 .. $a_n
:xs:decimal
(or its derived types),xs:float
, orxs:double
(see note on type promotion, and casting from string) -
$a_s
:xs:decimal
(or its derived types),xs:float
, orxs:double
(see note on type promotion, and casting from string)
Constant Summary collapse
Instance Attribute Summary
Attributes included from Enumerable
Instance Method Summary collapse
-
#resolve(list) ⇒ RDF::Term
Evaluates to the sum of the list elements.
Methods inherited from ListOperator
#as_literal, #execute, #input_operand, #validate