Mirror of the Rel4tion website/wiki source, view at <http://rel4tion.org>

[[ 🗃 ^yEzqv rel4tion-wiki ]] :: [📥 Inbox] [📤 Outbox] [🐤 Followers] [🤝 Collaborators] [🛠 Commits]

Clone

HTTPS: git clone https://vervis.peers.community/repos/yEzqv

SSH: git clone USERNAME@vervis.peers.community:yEzqv

Branches

Tags

master :: projects / idan / manual / 04-phs-and-refs / 02-pos-ref /

02-arrows.mdwn

[[!meta title=“4.2.2 | Arrows”]]

Arrows

Arrows treat the Idan text as a table with 4 columns: subject, predicate, object and identifier. Each statement is a single row, even if it’s part of a block in which some components are shared. This conceptual table would be the result of splitting all the blocks into separate statements. For example, the following statements: (Uids short just for clarity)

<a> <b> <c>
    <d> <e>
    <f>
        <g>
        <h>
<i> <j> <k>

would become the table:

 S   P   O   I
--- --- --- ---
<a> <b> <c> <%>
<a> <d> <e> <%>
<a> <f> <g> <%>
<a> <f> <h> <%>
<i> <j> <k> <%>

An arrow can be used a subject, a predicate or an object of a statement, but not as its identifier. It simply points up or down in the table, to a component of another statement, in the same column. For example, if in the table given above replaced <e> with an arrow, it could point to <c>, <g>, <h> or <k>.

The algorithm for determining where the arrow points is as follows. Assume we have an Idan document expressing n statements, s_1, … s_n. Statament s_i has component c (where c is S, P, O or I) expressed in the document as an arrow. The arrow points p steps in direction d (which is either up or down). Then, in order to determine the target of the arrow, do the following:

  1. Start at statement s_i
  2. Go p steps in direction d, reaching statement s_j (j would be either i+d or i-d)
  3. Pick component c of statement s_j

That component we picked is what the arrow points to.

The reference type character (i.e. first character) of an arrow is a hash sign (#). It is followed by an offset specification as explained in the Concept section previously.

A contrived example:

<%> nli:belongs_to_namespace @myns
#^  smaoin:is_a              #,,,
#^  smaoin:is_subclass_of    smaoin:Resource

<%> nli:belongs_to_namespace @myns
#^  smaoin:is_a              smaoin:Class

#,1 nli:belongs_to_namespace @myns
<%> smaoin:is_a              #^^
#^  #^5                      myns:Animal

The results of using arrows here are:

[See repo JSON]