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-uids.mdwn
[[!meta title=“2.1 | Uids”]]
Uids
Resources are represented by Unique Identifiers - Uids - which are by themselves meaningless, and should generally be random and generated by a computer. It’s possible in Idan to specify them directly in the document. They may also appear directly if a document has been processed by software, and Uids were automatically generated and inserted into the text.
The recommended scheme for Uids is generating them as version 4 UUIDs. This is the version of UUID that is randomly generated and isn’t based on time, location or system information.
A Uid is a string of Graphical Unicode characters with no whitespace. It is written with angle brackets (<
and >
) surrounding it. For example:
<b3742023-97ef-4fb0-9dd2-4582d946d6f1>
Since Uids can technically contain >
, it’s possible in Idan to include a >
inside a Uid by putting a backslash before it. In other words, \>
is an escape sequence which means >
. Any use of \
as-is in a Uid is treated as an escape sequence. To specify \
directly, escape it too, i.e. \\
means \
. For example, the following literal expresses the Uid 123<456>789\0>123\\45
:
<123<456\>789\\0\>123\\\\45>
Each >
and \
is preceded by the escape sequence marker \
.
There is another special case: the form <%>
is used as a generator, explained in the section about placeholders. Since %
is technically a valid Uid, Idan allows to specify it as <\%>
. Note that in any other Uid which contains %
, the sequence \%
is invalid. For example, <123\%456>
isn’t a valid Uid literal. If the Uid 123%456
was meant, it should be written as <123%456>
, without the backslash. If the Uid 123\%456
was meant, then the \
should be escaped: <123\\%456>
.