Mirror of the Rel4tion website/wiki source, view at <http://rel4tion.org>
Clone
HTTPS:
git clone https://vervis.peers.community/repos/yEzqv
SSH:
git clone USERNAME@vervis.peers.community:yEzqv
Branches
Tags
01-use.mdwn
[[!meta title=“6.1 | Use Directive”]]
Use Directive
The use
directive declares a namespace for use in PLrefs and NSrefs. A prefix used without being declared in a use
directive earlier in the file must be resolved externally, e.g. using a datastore, otherwise it is an error.
A use
directive has two parts: a reference to the namespace used, and a prefix to represent it in the rest of the document. The reference may be given as a Uid, in which case the prefix part is required, or as a PLref, in which case the prefix part is optional and serves as an alias.
The syntax form variants are:
%use% UID %as% PREFIX
%use% PLREF
%use% PLREF %as% PREFIX
The UID is specified like in statements, i.e. a Uid enclosed with angle brackets (<>
). PREFIX is the prefix string, but without any surrounding quotes. PLREF may be either a prefix or a regular PLref.
Examples, assuming the language has been declared as English:
use <0000-0000-0000-0000> as myns
use myns
use myns:subns
use some:long:plref as short
The fallback symbol for %use%
is %%
, and the fallback symbol for %as%
is =>
. The above examples are equivalent to the following:
%% <0000-0000-0000-0000> => myns
%% myns
%% myns:subns
%% some:long:plref => short