JSONiq follows the W3C standard for function calls. The following explanations, provided as an informal summary for convenience, are non-normative.
Function calls in JSONiq can either be made statically, with a named function, or dynamically, by passing a function item on the fly.
The syntax for function calls is similar to many other languages. JSONiq supports four sorts of functions:
Builtin functions: these have no prefix and can be called without any import.
Local functions: they are defined in the prolog, to be used in the main query. They have the prefix local:. Chapter Prologs describes how to define your own local functions.
Imported functions: they are defined in a library module. They have the prefix corresponding to the alias to which the imported module has been bound to. Chapter Modules describes how to define your own modules.
Anonymous functions: they are defined on the fly, by inline function expressions or partial evaluation.
The first three are named functions and can be called statictically. All four can be called dynamically, as a named function can be also passed as an item with a named function reference.