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
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:
- Start at statement
s_i
- Go
p
steps in directiond
, reaching statements_j
(j
would be eitheri+d
ori-d
) - Pick component
c
of statements_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:
- Statements 1, 2 and 3 share the subject
- Statements 4 and 5 share the subject
- Statements 6, 7 and 8 share the subject
- Statements 3 and 8 share the predicate
- Statements 2, 5 and 7 share the object