← Prev in month ← Prev in thread

Associativity of XDI $has statements

From
Erummond Qeed
Date
2009-11-16T07:16:01+00:00
ID
Thread
Associativity of XDI $has statements
After our discussion on last Thursday’s telecon I wanted to
post a note about the $has predicate and the XDI expressions it produces.

 

The rule we established last spring that is that any XDI
$has statement can be simplified into two other XDI statements:

 

1) A single XRI cross-reference (an XRI in parentheses)
containing exactly two XRI segments—the first being the subject of the original
$has statement and the second segment being the object of the original $has
statement. 

 

            +a/$has/+b  <==> 
(+a/+b) 

 

2) A single XRI segment by directly concatenating the
subject of the original $has statement and the object of the original $has
statement. 

 

            +a/$has/+b  <==> 
+a+b 

 

All three express the same underlying semantics, i.e.:

 

            +a/$has/+b  <==> 
(+a/+b)  <==> +a+b  

 

This example is straightforward because the XDI statement
+a+b represents only one $has statement and therefore has only one expansion.
XDI statements consisting of more than two XRI subsegments represent multiple
$has statements and so the number of expansions increases. Let’s take the
example:

 

            +a+b+c+d

 

My understanding is the semantics we want for $has
statements is associativity (http://en.wikipedia.org/wiki/Associativity).
By that I mean that sequence matters, but not the placement of the $has
operation between multiple XRI subsegments that have been associated with $has
statements. If so, this means our example +a+b+c+d expands into all of the
following XDI statements:

 

            +a+b+c/$has/+d
 <==>  (+a+b+c/+d) 
<==>  +a+b+c+d

            +a+b/$has/+c+d
 <==>  (+a+b/+c+d) 
<==>  +a+b+c+d

            +a/$has/+b+c+d
 <==>  (+a/+b+c+d) 
<==>  +a+b+c+d

 

Note that this rule does NOT constrain the use of
cross-references to perform explicit grouping (reification) of XDI statements.
For example:

 

            +a+b(+c+d)

 

…is different from +a+b+c+d because +a+b(+c+d) is a
three-subsegment XRI that has two expansions outside the cross-reference…

 

            +a/$has/+b(+c+d)  <==> 
(+a/+b(+c+d))  <==>  +a+b(+c+d)

            +a+b/$has/(+c+d)  <==> 
(+a+b/(+c+d))  <==>  +a+b(+c+d)

 

…and two variants on these if you also expand inside the cross-reference:

 

            +a/$has/+b(+c/$has/+d)  <==> 
(+a/+b((+c/+d)))  <==>  +a+b(+c+d)

            +a+b/$has/(+c/$has/+d)  <==> 
(+a+b/((+c/+d)))  <==>  +a+b(+c+d)

 

Again, my interpretation is that this is exactly what we
want—the same associativity between $has statements that we have with
left-to-right sequences of English adjectives before a noun:

 

            Boeing                                                        plane
engine cowling color

            Boeing plane                                               engine
cowling color

            Boeing plane engine                                    cowling
color

            Boeing plane engine cowling                        color

            Boeing plane engine cowling color

 

In these five examples, the final word in each column (left
and right) is a noun, and all the words before it are adjectives. If you then
take any combination from the left and then concatenate it with the right (without
changing the sequence), the result is that all but the last word is turned into
an adjective, and “color” is the noun they all describe.

 

I hope this clears up any confusion about $has statements. I
definitely see the need to include some additional clarification about this in
the XDI RDF Graph Model spec.

 

=Drummond
← Prev in month ← Prev in thread