OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

xdi message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: [no subject]


...then you would look in the XRID that "=A" returns for "*(=B)" for the
Local Access URI, and then use the appropriate service (such as X2R) to do
an HTTP "GET" for Resource "C".

But if you want to address *attributes of the link relationship between "=A"
"=B", then you need to address *the link object itself* (in OO terms, this
is the association object expressing the relationship between "=A" and
"=B".) Thankfully, XRI cross-reference syntax gives you a simple, elegant
way to do this:

	xri://(=A*(=B))

Notice that because this XRI authority segment consists of a single
cross-reference, it is a single Logical Authority with NO delegation. Just
like any other Logical Authority, this XDI node can have its own attribute
types, instance, and versions. In other words...

	xri://(=A*(=B))/C

...would be the address of a Type (such as $contract) that describes the
link relationship between "=A" and "=B". Note that each address NOT a node
under the Logical Authority that "=A" calls "=B", but a node under the
Logical Authority with the value "(=A*(=B))". Since this cross-reference is
at the Logical Authority level, to resolve it an XRI resolver must take the
following steps:

1) Check its current cache for a Logical Authority with the value
"(=A*(=B))". If that fails, then...
2) Look "inside" the cross-reference for the first subsegment, which is "=A"
(note that this rule about looking "inside" the cross-reference is purely an
XDI resolution rule, not a XRI resolution rule).
3) Resolve the Logical Authority "=A" to its current Physical Authority for
"=A", for example, "!!1000".
4) Request "!!1000" to resolve the Logical Authority "(=A*B)" or
"(=A*(=B))", respectively.
5) From the Local Access URI in the resulting XRID, do an XDI GET on the
resource "C".

Now, once that part is clear, here's the full formula for an XDI rights
path, meaning addressing Data through a link contract. This formula assumes
that the XRI begins with the Logical Authority segment - see note at the end
of this message about including a Physical Authority segment):

	xri://(=A*(=B)/$contract/instance.x/($v/x)*(+type/instance.y/($v/y))

Note especially the final segment, i.e., "/($v/x)*(+type/item.y/($v/y))".
This is where each link contract contains links to the Data it covers. Of
course these links may branch out, i.e., a link contract may reference a
business card which may in turn reference a phone number. This would look
like:

	xri://(=A*(=B)/$contract/personal/($v/1)*(+business.card/personal/
	($v/3))*(+phone.number/home/$v/2)

Note again that this absolute XRI still only has four segments (it's missing
the optional Physical Authority segment - again see my note at the end of
this message), but it has two levels of linking in the fourth (Version)
segment.

To help illustrate this, here's what the XDI documents (using the Universal
markup model) corresponding to each of these XRIs would look (including the
Backrefs that indicate the corresponding Refs).

1)	xri://(=A*(=B)/$contract/instance.x/($v/x)*(+type/instance.y/($v/y))
	
<Resource>
	<XRI>
		<Logical>=A</Logical>
		<Type>+type</Type>
		<Instance>item.y</Instance>
		<Version>$v/y</Version>
	</XRI>
	<Backrefs>
		<Backref>
			<XRI>
				<Logical>=A*(=B)</Logical>
				<Type>$contract</Type>
				<Instance>item.x</Instance>
				<Version>$v/x</Version>
			</XRI>
		</Backref>
	</Backrefs>
	<Data>some data here</Data>
</Resource>	

2)	xri://(=A*(=B)/$contract/personal/($v/1)*(+business.card/personal/
	($v/3))*(+phone.number/home/$v/2)

<Resource>
	<XRI>
		<Logical>=A</Logical>
		<Type>+phone.number</Type>
		<Instance>home</Instance>
		<Version>$v/2</Version>
	</XRI>
	<Backrefs>
		<Backref>
			<XRI>
				<Logical>=A</Logical>
				<Type>+business.card</Type>
				<Instance>personal</Instance>
				<Version>$v/3</Version>
			</XRI>
			<Backrefs>
				<Backref>
					<XRI>
						<Logical>=A*(=B)</Logical>
						<Type>$contract</Type>
	
<Instance>personal</Instance>
						<Version>$v/x</Version>
					</XRI>
				</Backref>
			</Backrefs>
		</Backref>
	</Backrefs>
	<Data>800-555-1212</Data>
</Resource>	

(Note: in doing this example I realized that the nested Backrefs shown above
to show the two-level chain of back-references are not supported by the v2
universal schema. Thankfully the upgrade to support this is trivial.)

A final point is that if you need to address *a particular physical instance
of a Resource at a particular Physical Authority*, you can do that just by
adding the Physical Authority segment at the start of the XRI. To illustrate
with the two XRIs above, if the Physical Authority was "!!1000", the full
five-segment XRI and corresponding XDI documents would be:

1)	xri://!!1000/(=A*(=B)/$contract/item.x/($v/x)*(+type/item.y/($v/y))

<Resource>
	<XRI>
		<Physical>!!1000</Physical>
		<Logical>=A</Logical>
		<Type>+type</Type>
		<Instance>item.y</Instance>
		<Version>$v/y</Version>
	</XRI>
	<Backrefs>
		<Backref>
			<XRI>
				<Logical>=A*(=B)</Logical>
				<Type>$contract</Type>
				<Instance>item.x</Instance>
				<Version>$v/x</Version>
			</XRI>
		</Backref>
	</Backrefs>
	<Data>some data here</Data>
</Resource>	


2)	xri://!!1000/(=A*(=B)/$contract/personal/($v/1)*
	(+business.card/personal/($v/3))*(+phone.number/home/$v/2)

<Resource>
	<XRI>
		<Physical>!!1000</Physical>
		<Logical>=A</Logical>
		<Type>+phone.number</Type>
		<Instance>home</Instance>
		<Version>$v/2</Version>
	</XRI>
	<Backrefs>
		<Backref>
			<XRI>
				<Logical>=A</Logical>
				<Type>+business.card</Type>
				<Instance>personal</Instance>
				<Version>$v/3</Version>
			</XRI>
			<Backrefs>
				<Backref>
					<XRI>
						<Logical>=A*(=B)</Logical>
						<Type>$contract</Type>
	
<Instance>personal</Instance>
						<Version>$v/x</Version>
					</XRI>
				</Backref>
			</Backrefs>
		</Backref>
	</Backrefs>
	<Data>800-555-1212</Data>
</Resource>	

Note that in neither XDI document was it necessary to repeat the <Physical>
element in the latter XRIs because the rule is that if a higher level XRI
subelement is NOT present, the XRI is relative to the first ancestor
Resource that has the next higher subelement.

=Drummond 




[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]