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-anchors.mdwn
[[!meta title=“4.3.1 | Anchors”]]
Anchors
An anchor is an label given to an occurence of an entity in the document, that can be referred to from other places in the document. These labels are used only as a convenience feature for humans authoring Idan documents, and don’t translate into statements.
An anchor may be attached to any statement component, but referring to anchors is possible only from subjects, predicates and objects - not from identifiers.
Using anchors therefore requires two parts: attaching a label to a statement component, and referring to it from another component. These are called anchor label and anchor reference respectively.
An anchor label begins with an equal sign (=
), followed by a name string with no spaces. It comes after the component it’s attached to. Example:
<%> =alice myns:has_name "Alice" //<%> =stmt
<%> =bob myns:has_name "Bob"
When used with identifiers specified as <%>
, the <%>
may be omitted and the anchor label written in its place. In other words, this:
//<%> =stmt
is equivalent to this:
//=stmt
An anchor reference begins with an ampersand (&
), followed by the name string. A valid reference must use a name defined somewhere else as an anchor label. Example:
&alice myns:loves &bob
&bob myns:loves &alice
&bob myns:has_age 34
An anchor name can’t contain whitespace, but any other Unicode character with basic type Graphical is allowed.
There is a special anchor label defined by default for each Idan document. It can be referred to using the symbol &&&
, and refers to the Idan document itself, which is a resource of type idan:Document
. The &&&
reference is called the self-reference and allows expressing information about the document itself, such as its author and its creation date.
The self-reference can be localized by defining a regular anchor reference as an alias of &&&
. When choosing a language using the language directive, any aliases - if defined - become available, can cannot be overridden. Global aliases are possible too. The English localization is &This
.