What is the purpose of "rel" links?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

What is the purpose of "rel" links?

Age Mooij
Hi

I've been looking at links and link walking and I noticed that Riak very often returns a special type of link with rel="up" instead of a riaktag, which is illegal for users to create.

What is the purpose of this link? (beyond the reasonably obvious "this key belongs to bucket X). Why was it added?
Are there other "rels" than "up"? 
Can they be followed through link walking?

This behavior is not documented anywhere that I (or Google) could find.

Age

PS
Also, all the docs on links, even the 1.4 docs, still refer to the old "/riak/bucket/key" format for specifying a link target. Riak 1.3.1 rejects this format with a bad request error!

HTTP/1.1 400 Bad Request
Content-Length: 89
Content-Type: text/plain
Date: Fri, 12 Jul 2013 20:46:50 GMT
Server: MochiWeb/1.1 WebMachine/1.9.2 (someone had painted it blue)

Invalid Link header. Links must be of the form
</buckets/BUCKET/keys/KEY>; riaktag="TAG"


_______________________________________________
riak-users mailing list
[hidden email]
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
Reply | Threaded
Open this post in threaded view
|

Re: What is the purpose of "rel" links?

Age Mooij
Anyone?

On Jul 12, 2013, at 22:52, Age Mooij <[hidden email]> wrote:

Hi

I've been looking at links and link walking and I noticed that Riak very often returns a special type of link with rel="up" instead of a riaktag, which is illegal for users to create.

What is the purpose of this link? (beyond the reasonably obvious "this key belongs to bucket X). Why was it added?
Are there other "rels" than "up"? 
Can they be followed through link walking?

This behavior is not documented anywhere that I (or Google) could find.

Age

PS
Also, all the docs on links, even the 1.4 docs, still refer to the old "/riak/bucket/key" format for specifying a link target. Riak 1.3.1 rejects this format with a bad request error!

HTTP/1.1 400 Bad Request
Content-Length: 89
Content-Type: text/plain
Date: Fri, 12 Jul 2013 20:46:50 GMT
Server: MochiWeb/1.1 WebMachine/1.9.2 (someone had painted it blue)

Invalid Link header. Links must be of the form
</buckets/BUCKET/keys/KEY>; riaktag="TAG"



_______________________________________________
riak-users mailing list
[hidden email]
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
Reply | Threaded
Open this post in threaded view
|

Re: What is the purpose of "rel" links?

Justin Sheehy
In reply to this post by Age Mooij
Hi, Age.

The Link header in HTTP as used by Riak is defined by RFC 5988. In the Link Relation Type registry (http://tools.ietf.org/html/rfc5988#section-6.2.2) you can see that the relation type "up" refers to a parent document in a hierarchy of documents. In Riak, this means the bucket a key is in.

These are not Riak's own links, but rather an additional use of the Link header form which may be useful to some clients.

I hope that this helps.

-Justin



On Jul 12, 2013, at 1:52 PM, Age Mooij <[hidden email]> wrote:

> Hi
>
> I've been looking at links and link walking and I noticed that Riak very often returns a special type of link with rel="up" instead of a riaktag, which is illegal for users to create.
>
> What is the purpose of this link? (beyond the reasonably obvious "this key belongs to bucket X). Why was it added?
> Are there other "rels" than "up"?
> Can they be followed through link walking?
>
> This behavior is not documented anywhere that I (or Google) could find.
>
> Age




_______________________________________________
riak-users mailing list
[hidden email]
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
Reply | Threaded
Open this post in threaded view
|

Re: What is the purpose of "rel" links?

Age Mooij
Thanks Justin. That makes it clear.

When it comes to modeling links for my Scala client library, I think I'll ignore "rel" links then, since they cannot be created (directly) by users and they cannot be walked using the link walking API.

In general, it would be helpful for the docs to be a bit more explicit about these and whether or not they are parts of the Riak link API.

Thanks,
Age


On Jul 22, 2013, at 16:19, Justin Sheehy <[hidden email]> wrote:

> Hi, Age.
>
> The Link header in HTTP as used by Riak is defined by RFC 5988. In the Link Relation Type registry (http://tools.ietf.org/html/rfc5988#section-6.2.2) you can see that the relation type "up" refers to a parent document in a hierarchy of documents. In Riak, this means the bucket a key is in.
>
> These are not Riak's own links, but rather an additional use of the Link header form which may be useful to some clients.
>
> I hope that this helps.
>
> -Justin
>
>
>
> On Jul 12, 2013, at 1:52 PM, Age Mooij <[hidden email]> wrote:
>
>> Hi
>>
>> I've been looking at links and link walking and I noticed that Riak very often returns a special type of link with rel="up" instead of a riaktag, which is illegal for users to create.
>>
>> What is the purpose of this link? (beyond the reasonably obvious "this key belongs to bucket X). Why was it added?
>> Are there other "rels" than "up"?
>> Can they be followed through link walking?
>>
>> This behavior is not documented anywhere that I (or Google) could find.
>>
>> Age
>
>
>


_______________________________________________
riak-users mailing list
[hidden email]
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com