Re: [apps-discuss] JSON Hypertext Application Language

James M Snell <> Sat, 09 June 2012 01:04 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id C1D1E11E80FE for <>; Fri, 8 Jun 2012 18:04:54 -0700 (PDT)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -2.363
X-Spam-Status: No, score=-2.363 tagged_above=-999 required=5 tests=[AWL=1.236, BAYES_00=-2.599, RCVD_IN_DNSWL_LOW=-1]
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id 4z7PMUVnuAZx for <>; Fri, 8 Jun 2012 18:04:53 -0700 (PDT)
Received: from ( []) by (Postfix) with ESMTP id 44FC111E80E2 for <>; Fri, 8 Jun 2012 18:04:53 -0700 (PDT)
Received: by wibhj8 with SMTP id hj8so905025wib.13 for <>; Fri, 08 Jun 2012 18:04:52 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; bh=8IBLwuziz53Pmjb1G9m3U8IpPD4/1Q+lG233f+LE0nk=; b=OTtGD17lK9l2kLoVWs+x6+mMXfrvwG/NIn8rXKw6DPeXMP7wOmR4HHmLzAFUccIO+9 kWuPpFJMbnfyy91c4/IOdkyfkiFgGlG6s4SSc491Clo7LsrWjG82AWonYQxPVzAMPN/T 8mM2o2SBelKd8ujCCPjvo/IXL+jJmFFMAIG8YOWMt/rgye+ha3iSYWFlu36zyM3/0q3Y yxRz3S4VZeoQpuYcYi/RCfZpZlhjhjxBIeY6P+wuND6zHyemrIdDmPMZjSgo2BjHE5A8 /OGjFAln8aLR1OAS6XnkITrVz1phvHcKgOI+KERsmHmg1wJp6ww5H13q6/YgsO/1slzK yoZg==
Received: by with SMTP id fl4mr4501861wib.2.1339203892185; Fri, 08 Jun 2012 18:04:52 -0700 (PDT)
MIME-Version: 1.0
Received: by with HTTP; Fri, 8 Jun 2012 18:04:31 -0700 (PDT)
In-Reply-To: <>
References: <> <> <> <>
From: James M Snell <>
Date: Fri, 08 Jun 2012 18:04:31 -0700
Message-ID: <>
To: Martin Thomson <>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Subject: Re: [apps-discuss] JSON Hypertext Application Language
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: General discussion of application-layer protocols <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-Subscribe: <>, <>
X-List-Received-Date: Sat, 09 Jun 2012 01:04:55 -0000

On Fri, Jun 8, 2012 at 2:02 PM, Martin Thomson <> wrote:
> On 8 June 2012 12:36, Mike Kelly <> wrote:
>> Technically, according to the Web Linking specification referenced a
>> link relation type should either be registered with IANA or a URI.
>> Exposing an HTML document describing the semantics of the link at its
>> URI provides an avenue for making sense of a link that clearly can
>> work. I've written a 'browser' for HAL which lets you surf a HAL API
>> and allows you to pull up documentation as-you-go for relations that
>> are URIs.
> No question, HAL let's you walk the graph, but it takes a human being
> to make any sense of anything.  So, as I said, next to useless.

I think the most important consideration with this is: what will
developers *actually* do with the additional metadata vs. what they
*are able* to do. There is a distinct, and very practical difference.

Within the Atom format, when we defined the structure of a generic
link, we allowed for all kinds of additional metadata and that model
served as part of the basis for RFC 5988. And while the structure
allows for a great deal of potential use cases, the overall majority
of ACTUAL code focus solely on two attributes: the rel and the href.
Everything else tends to be ignored except in very specific
application cases. It's great that we can enable specific cases, but
we should not assume, necessarily, that a greater capacity for more
metadata is always a good thing.

Within the Activity Streams format ( there is
also working going on to define a basic mechanism for links within a
JSON Activity Stream. The mechanism I have proposed is very similar to
that seen in HAL except that it skips the object structure for a link
and just goes with Strings containing absolute IRI's. For example:

  "totalItems": 10,
  "links": {
    "next": "",
    "previous": ""
  "items": [ ... ]

In this case, a developer is already going to have a reasonable
assumption as to what kind of resource the next and previous links
point to; and all the other metadata that is typically associated with
the generic link model simply is not necessary. An application that
understands how to process multi-paged activity streams following this
convention is going to know already to go looking for the next and
previous properties under link so there is no need at all (in this
case) for a "generic browser". The code necessary to support an
implementation of this is going to be very clear and concise.

It comes down to a tradeoff. Either we have a focused, concise,
efficient, minimal serialization that requires more application
specific handling or we have a generic, verbose, less-efficient
serialization that allows more generalized reasoning and browsing.
There are valid arguments for both, for certain, but I can see many
scenarios where HAL will just be way too verbose to be practical.

- James