Class UserDefinedFunction

java.lang.Object
org.apache.jena.sparql.function.user.UserDefinedFunctionDefinition
org.apache.jena.sparql.function.user.UserDefinedFunction
All Implemented Interfaces:
Function

public class UserDefinedFunction extends UserDefinedFunctionDefinition implements Function
Represents a user defined function
  • Constructor Details

    • UserDefinedFunction

      public UserDefinedFunction(UserDefinedFunctionDefinition def)
      Creates a new user defined function
      Parameters:
      def - Function Definition
    • UserDefinedFunction

      public UserDefinedFunction(String url, Expr e, List<Var> argList)
      Creates a user defined function
      Parameters:
      url - Function URL
      e - Expression
      argList - Arguments
  • Method Details

    • build

      public void build(String uri, ExprList args)
      Builds the expression substituting the arguments given into the base expression to yield the actual expression to evaluate
      Throws:
      SSE_ExprBuildException - Thrown if an expression cannot be generated
    • build

      public void build(String uri, ExprList args, Context context)
      Builds the expression substituting the arguments given into the base expression to yield the actual expression to evaluate
      Specified by:
      build in interface Function
      Parameters:
      uri - The function URI
      args - The parsed arguments
      context - The build context.
      Throws:
      SSE_ExprBuildException - Thrown if an expression cannot be generated
    • exec

      public NodeValue exec(Binding binding, ExprList args, String uri, FunctionEnv env)
      Executes the function
      Specified by:
      exec in interface Function
      Parameters:
      binding - The current solution
      args - A list of unevaluated expressions
      uri - The name of this
      env - The execution context
      Returns:
      NodeValue - a value
    • getActualExpr

      public Expr getActualExpr()
      Gets the actual expression that was built for the function, assuming build(String, ExprList, Context) has been called
      Returns:
      Expression if built, null otherwise