Variables and functions live in namespaces that are URIs -- the semantics is similar to that of C++ namespaces. For convenience, namespaces are associated with a much shorter alias, and this alias can be used as a prefix to a variable or a function.
Until now, we only dealt with main queries. In main queries, the namespace alias local: is predefined so that global variables and functions that are local to the main query can use this alias, for example local:myvariable or local:myfunction(). This alias is associated with a namespace, but which namespace it is not relevant for writing queries.
For variables, the alias is optional -- variables not prefixed with an alias live in no namespace.
For functions, the absence of alias is only allowed for builtin functions. Builtin functions live in their own special namespace.
Other namespaces and aliases can be defined as well with imported library modules. This is defined in
Chapter 13, Modules.