alps-io / spec

ALPS Specification documents.
59 stars 13 forks source link

Conditions for adding `rel` tag #111

Closed koriym closed 3 years ago

koriym commented 3 years ago

In the diagram below, all the transitions towards Blog are rel=collection, but

A) Should I give rel=collection only to BlogPosting => Blog, which is essentially an item => collection relationship?

B) Or should I always give rel=collection when linking to a collection type resource no matter where the link from?

image

Code:

 {"id": "goBlog", "type": "safe", "rt": "#Blog", "rel": "collection"},

If the answer is B, it is simple, but if the answer is A, ALPS needs to distinguish between the two IDs?

mamund commented 3 years ago

i re-use rels quite often so, yes, as you show here, the rel="collection" is a way to mark a link to say "follow this link to see a collection".

it can happen on many links -- multiple links in the same representation, too!

koriym commented 3 years ago

Ok! The answer is "B", right?

mamund commented 3 years ago

yes. that's what i do

koriym commented 3 years ago

Arigato.