Class: SPARQL::Algebra::Operator::FunctionCall
- Includes:
- Evaluatable
- Defined in:
- lib/sparql/algebra/operator/function_call.rb
Overview
The SPARQL function_call operator.
[70] FunctionCall ::= iri ArgList
Constant Summary collapse
- NAME =
:function_call
Instance Method Summary collapse
-
#apply(iri, *args, **options) ⇒ RDF::Term
Invokes the function with the passed arguments.
-
#to_sparql(**options) ⇒ String
Returns a partial SPARQL grammar for this operator.
-
#to_sxp_bin ⇒ Array
Returns the SPARQL S-Expression (SSE) representation of this expression.
Methods included from Evaluatable
#evaluate, #memoize, #replace_aggregate!, #replace_vars!
Instance Method Details
#apply(iri, *args, **options) ⇒ RDF::Term
Invokes the function with the passed arguments.
34 35 36 37 |
# File 'lib/sparql/algebra/operator/function_call.rb', line 34 def apply(iri, *args, **) args = RDF.nil == args.last ? args[0..-2] : args SPARQL::Algebra::Expression.extension(iri, *args, **) end |
#to_sparql(**options) ⇒ String
Returns a partial SPARQL grammar for this operator.
55 56 57 58 59 60 61 |
# File 'lib/sparql/algebra/operator/function_call.rb', line 55 def to_sparql(**) iri, args = operands iri.to_sparql(**) + '(' + args.to_sparql(delimiter: ', ', **) + ')' end |
#to_sxp_bin ⇒ Array
Returns the SPARQL S-Expression (SSE) representation of this expression.
Remove the optional argument.
46 47 48 |
# File 'lib/sparql/algebra/operator/function_call.rb', line 46 def to_sxp_bin @operands.map(&:to_sxp_bin) end |