On Tue, Jun 30, 2009 at 10:28 PM, Peter Keane <pkeane@...> wrote:
We have need to create links between resources that may have any of a large number of relations (e.g., "created-by").
This is a great use case - thanks a lot.
I wish to stay in the realm of Atom (avoiding complexities of RDF). I am reminded somewhat here by the work going on in activities streams.... Anyway, I agree with Sam that it is currently an unsolved problem with wide applicability.
I'm going one step further in eliminating the Atom for individual resources. That would allow you simply to PUT a new photo and set a Link: header in a single, atomic action. Note that as it's raw HTTP there's no encoding necessary so less cycles and bandwidth needlessly burnt, plus less room for error and *significantly* less complexity in the clients:
curl -T building.jpg -H 'Link: <http://example.com/architect/123>; rel="created-by"' http://example.com/building/123
Note that link relations are extensible in that you can specify attributes like "quantity=2" (for the shopping cart), "role=surveyor" (for the buildings) or "interface=eth0" (for cloud infrastructure).
Devil's in the detail though - mostly around partial updates and deletion of links (that is, there should be a way to "delete" a link - perhaps another header like Delete-Link: or an attribute like "expire=now"). Set-Cookie: works because it has expiry, but this doesn't make much sense for a link.
Sam