RE: [AS2] Deprecate "url" in favor of "id" and "self" link relations

On Sep 4, 2014 3:40 AM, "Markus Lanthaler" <markus.lanthaler@gmx.net> wrote:
>
[snip]
>
> Hmm... so we now have
>
>    id = @id
>    duplicates (points to ids)
>    self (dereferenceable IRIs)
>

duplicates is largely an artifact from 1.0 that I've never seen an
adequate use of (actually, in 1.0 the situation was worse). I'd
happily be willing to drop "duplicates" entirely.

"self" would only really be useful/necessary if the "id" is not
dereferenceable. I have no problem recommending that "id" always be
dereferenceable.

>    url ("preferred" alternate)
>    alternate (more alternates)
>
>    multiple "embedded links"
>
> Sorry, but this sounds overly complex to me. Could you please explain briefly what use cases this design is trying to address?
>

Can be illustrated by example:

{
  "id": "http://api.example.org/notes/1",
  "displayName": "A Note",
  "content": "This is a note",
  "mediaType": "text/html",
  "url": "http://www.example.org/notes/1",
  "alternate": {
    "id": "http://www.example.org/notes/1.pdf",
    "mediaType": "application/pdf"
  },
  "icon": "http://cdn.example.org/images/note.png",
  "image": "http://cdn.example.org/notes/1/img1.png"
}

* "id" is the Identity;
* "url" and "alternate" provide representations of the note itself;
* and "icon"/"image" provide links to embedded content (rel="icon", rel="image")

Interpreting this ought to be straightforward and unambiguous. There
really isn't much room for simplification (all you'd end up doing is
shifting bits around without actually eliminating anything). For
instance, suppose we decided to go with the "links" object approach
used elsewhere, we'd end up with something like (unless I've
misunderstood something):

{
  "id": "http://api.example.org/notes/1",
  "displayName": "A Note",
  "content": "This is a note",
  "links": [
    {
      "src": "http://www.example.org/notes/1",
      "type": "text/html",
      "rel": "alternate"
    },
    {
      "src": "http://www.example.org/notes/1.pdf",
      "type": "application/pdf",
      "rel": "alternate"
    },
    {
      "src": "http://cdn.example.org/images/note.png",
      "rel": "icon"
    },
    {
      "src": "http://cdn.example.org/notes/1/img1.png",
      "rel": "image"
    }
  ]
}

- James

>
> Thanks,
> Markus
>
>
>
> --
> Markus Lanthaler
> @markuslanthaler
>
>
>
> --
> You received this message because you are subscribed to the Google Groups "Activity Streams" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to activity-streams+unsubscribe@googlegroups.com.
> To post to this group, send email to activity-streams@googlegroups.com.
> Visit this group at http://groups.google.com/group/activity-streams.
> For more options, visit https://groups.google.com/d/optout.

Received on Thursday, 4 September 2014 15:09:26 UTC