Constructorsconstructor new Builder ( identifier : string ) : Builder Methodsarithmetic arithmetic ( op : ( expressionEvaluator : IInternalEvaluator , ) => ( left : number , right : number ) => number , addInvalidHandling ?: boolean , ) : Builder Parameters op : ( expressionEvaluator : IInternalEvaluator , ) => ( left : number , right : number ) => number addInvalidHandling : boolean = true boolean Test booleanTest ( test : ( expressionEvaluator : IInternalEvaluator , ) => ( left : boolean , right : boolean ) => boolean , addInvalidHandling ?: boolean , ) : Builder Parameters test : ( expressionEvaluator : IInternalEvaluator , ) => ( left : boolean , right : boolean ) => boolean addInvalidHandling : boolean = true copy copy ( __namedParameters : { from : ArgumentType [] ; to : ArgumentType [] } ) : Builder Parameters __namedParameters : { from : ArgumentType [] ; to : ArgumentType [] } number Test numberTest ( test : ( expressionEvaluator : IInternalEvaluator , ) => ( left : number , right : number ) => boolean , ) : Builder Parameters test : ( expressionEvaluator : IInternalEvaluator , ) => ( left : number , right : number ) => boolean numeric Converter numericConverter ( op : ( expressionEvaluator : IInternalEvaluator ) => ( val : number ) => number , addInvalidHandling ?: boolean , ) : Builder Parameters op : ( expressionEvaluator : IInternalEvaluator ) => ( val : number ) => number addInvalidHandling : boolean = true on Binary Typed onBinaryTyped < L extends ISerializable , R extends ISerializable > ( types : [ ArgumentType , ArgumentType ] , op : ( expressionEvaluator : IInternalEvaluator , ) => ( left : L , right : R ) => TermExpression , addInvalidHandling ?: boolean , ) : Builder Type Parameters L extends ISerializable R extends ISerializable on Quaternary Typed onQuaternaryTyped < A1 extends ISerializable , A2 extends ISerializable , A3 extends ISerializable , A4 extends ISerializable , > ( types : [ ArgumentType , ArgumentType , ArgumentType , ArgumentType ] , op : ( expressionEvaluator : IInternalEvaluator , ) => ( a1 : A1 , a2 : A2 , a3 : A3 , a4 : A4 ) => TermExpression , addInvalidHandling ?: boolean , ) : Builder Type Parameters A1 extends ISerializable A2 extends ISerializable A3 extends ISerializable A4 extends ISerializable on Ternary onTernary < A1 extends TermExpression , A2 extends TermExpression , A3 extends TermExpression , > ( types : [ ArgumentType , ArgumentType , ArgumentType ] , op : ( expressionEvaluator : IInternalEvaluator , ) => ( a1 : A1 , a2 : A2 , a3 : A3 ) => TermExpression , addInvalidHandling ?: boolean , ) : Builder on Ternary Typed onTernaryTyped < A1 extends ISerializable , A2 extends ISerializable , A3 extends ISerializable , > ( types : [ ArgumentType , ArgumentType , ArgumentType ] , op : ( expressionEvaluator : IInternalEvaluator , ) => ( a1 : A1 , a2 : A2 , a3 : A3 ) => TermExpression , addInvalidHandling ?: boolean , ) : Builder Type Parameters A1 extends ISerializable A2 extends ISerializable A3 extends ISerializable set set ( argTypes : [ ] , func : ImplementationFunctionTuple < [ ] > , addInvalidHandling ?: boolean , ) : Builder set < T1 extends TermExpression > ( argTypes : [ ArgumentType ] , func : ImplementationFunctionTuple < [ T1 ] > , addInvalidHandling ?: boolean , ) : Builder set < T1 extends TermExpression , T2 extends TermExpression > ( argTypes : [ ArgumentType , ArgumentType ] , func : ImplementationFunctionTuple < [ T1 , T2 ] > , addInvalidHandling ?: boolean , ) : Builder set < T1 extends TermExpression , T2 extends TermExpression , T3 extends TermExpression , > ( argTypes : [ ArgumentType , ArgumentType , ArgumentType ] , func : ImplementationFunctionTuple < [ T1 , T2 , T3 ] > , addInvalidHandling ?: boolean , ) : Builder set < T1 extends TermExpression , T2 extends TermExpression , T3 extends TermExpression , T4 extends TermExpression , > ( argTypes : [ ArgumentType , ArgumentType , ArgumentType , ArgumentType ] , func : ImplementationFunctionTuple < [ T1 , T2 , T3 , T4 ] > , addInvalidHandling ?: boolean , ) : Builder set ( argTypes : ArgumentType [] , func : ImplementationFunction , addInvalidHandling ?: boolean , ) : Builder string Test stringTest ( test : ( expressionEvaluator : IInternalEvaluator , ) => ( left : string , right : string ) => boolean , addInvalidHandling ?: boolean , ) : Builder Parameters test : ( expressionEvaluator : IInternalEvaluator , ) => ( left : string , right : string ) => boolean addInvalidHandling : boolean = true
!!! Be aware when using this function, it will create different overloads with different return types !!! Arithmetic operators take 2 numeric arguments, and return a single numerical value. The type of the return value is heavily dependent on the types of the input arguments. In JS everything is a double, but in SPARQL it is not.
The different arguments are handled by type promotion and subtype substitution. The way numeric function arguments work is described here: https://www.w3.org/TR/xpath20/#mapping Above url is referenced in the sparql spec: https://www.w3.org/TR/sparql11-query/#OperatorMapping