Re: [Json] Link-relation expressed in JSON?

Tatu Saloranta <tsaloranta@gmail.com> Thu, 07 November 2013 18:55 UTC

Return-Path: <tsaloranta@gmail.com>
X-Original-To: json@ietfa.amsl.com
Delivered-To: json@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id AF48E21E8144 for <json@ietfa.amsl.com>; Thu, 7 Nov 2013 10:55:11 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.183
X-Spam-Level:
X-Spam-Status: No, score=-2.183 tagged_above=-999 required=5 tests=[AWL=0.417, BAYES_00=-2.599, HTML_MESSAGE=0.001, NO_RELAYS=-0.001]
Received: from mail.ietf.org ([12.22.58.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id v2sm9R1P3FOl for <json@ietfa.amsl.com>; Thu, 7 Nov 2013 10:55:11 -0800 (PST)
Received: from mail-wg0-x236.google.com (mail-wg0-x236.google.com [IPv6:2a00:1450:400c:c00::236]) by ietfa.amsl.com (Postfix) with ESMTP id 262E521E81F9 for <json@ietf.org>; Thu, 7 Nov 2013 10:55:10 -0800 (PST)
Received: by mail-wg0-f54.google.com with SMTP id c11so946914wgh.21 for <json@ietf.org>; Thu, 07 Nov 2013 10:55:05 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=1+tTcdInZa6rvCbxEEJoklkNqeIroGTTyMKOU9zzde8=; b=k02JJg7loLDP3EiMLOvlvzxVJvA1fbEZevCXdqAJsdT+4BBLgUgvQfD7ZgVTsE0A+s u5j2spRA+cUDC85HCk8OoKtLdetzTZlZqWiKKCAqw0WJvmT5FbROxCZRcbRGsVA0mN6I T/FfBx9GDAr/MziNK6sZgQIQrbG4mkrnzL63lY/zKdQ0BETOKkEQ2AB+tZOzr9DEfZd6 pFI0bwR3N5RoCtPL2rpZqeYWcVK1ldB0YshS9o2K23GAkn8UuHhMgT6aXxY5fH4ZhlUa 4X48yBnL3E3vdRLjWaOgXWppvHURjQ36uzSN9aMv+x4AoASjSIvtskl5lOb7M50SW0LV yP6Q==
MIME-Version: 1.0
X-Received: by 10.180.221.106 with SMTP id qd10mr3832865wic.57.1383850505691; Thu, 07 Nov 2013 10:55:05 -0800 (PST)
Received: by 10.227.61.195 with HTTP; Thu, 7 Nov 2013 10:55:05 -0800 (PST)
In-Reply-To: <20131106175806.GO18713@localhost>
References: <CABzCy2By1_yF6DY8_SiGiYJRCWFDo1zT3b4V87n4JZ0PfS6H7A@mail.gmail.com> <255AEB83-31FE-47BD-894F-B4270A13B144@mnot.net> <CABzCy2BqHt-YSxOChHPnDar=MCt6v9N4U7TePbQ-4+ei2b4BYQ@mail.gmail.com> <A8E0F3AC-D6C0-4519-9FE9-A0CCA8554820@mnot.net> <CABzCy2Bw2xdcT9w9=Kna6BOZmqBi_CS+UkEv7s-kG577WfmqSQ@mail.gmail.com> <5233254B-21BA-4311-BBC6-B23246727516@mnot.net> <CABzCy2Cs_pKL7Rf52eusEXMgFP1-i00m+dcQ9rtOwFbcYCjbPw@mail.gmail.com> <CAGrxA27LEojA44Q+6jn9i3DsOjB+Ba9oNKW55FGnJaa-jnRQ9Q@mail.gmail.com> <CAK3OfOiF54TGMKt6nVMuvcJ+mFw2quW6ztjgzDoV-tsJUoKMpg@mail.gmail.com> <CAGrxA27ks2s2Ea7RTZT8euHCvwFrQ2v6y1FoO3p6Wb9_gdCmBA@mail.gmail.com> <20131106175806.GO18713@localhost>
Date: Thu, 07 Nov 2013 10:55:05 -0800
Message-ID: <CAGrxA26so9tZzBeQiLH-14ASU+JGDCBi5StJLrRVhsQB1aA0og@mail.gmail.com>
From: Tatu Saloranta <tsaloranta@gmail.com>
To: Nico Williams <nico@cryptonector.com>
Content-Type: multipart/alternative; boundary="001a1134ccb2d06d4004ea9acdbd"
Cc: Mark Nottingham <mnot@mnot.net>, Nat Sakimura <sakimura@gmail.com>, JSON WG <json@ietf.org>
Subject: Re: [Json] Link-relation expressed in JSON?
X-BeenThere: json@ietf.org
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: "JavaScript Object Notation \(JSON\) WG mailing list" <json.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/json>, <mailto:json-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/json>
List-Post: <mailto:json@ietf.org>
List-Help: <mailto:json-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/json>, <mailto:json-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 07 Nov 2013 18:55:13 -0000

On Wed, Nov 6, 2013 at 9:58 AM, Nico Williams <nico@cryptonector.com> wrote:

> On Wed, Nov 06, 2013 at 09:36:39AM -0800, Tatu Saloranta wrote:
> > On Wed, Nov 6, 2013 at 9:28 AM, Nico Williams <nico@cryptonector.com>
> wrote:
> > > [...]
> >
> > Put another way: you seem to be saying that if one only uses Tree-based
> > representation and expression language(s), it is possible to deal with
> any
> > valid JSON structure. Of course. And that is beside the point.
>
> I'm saying that given *sufficiently* complex metadata (like that
> discussed in this thread) it might not be possible to simplify it enough
> (because it'd be unsatisfactory) to avoid the need for advanced
> destructuring capabilities in your programming language or libraries.
>

> I'm not saying that one ought to use Lisp, jq, or whatever.  Or that we
> should carelessly write specs that end up requiring such languages in
> practice.
>
> The questions here seem to be: whether the metadata in this thread could
> be simplified, and if not whether it's worth specifying a schema.  My
> answer to the second part is "yes" because clearly such complexity can
> be handled and it's better to have a schema than not if the pattern will
> repeat often.
>

Fair enough. I agree in that there are complex cases. My point is that
complexity of structure is a choice, and should be made explicit. Based on
JSON usage I have seen, I think modellers are not always aware of
complexities or resulting trade-offs.

To reiterate what I was trying to say was just that I think it is necessary
to not only consider aesthetics of JSON representation, but also its usage
and impedance to usage of data beyond simple transfer or storage.
And that certain kind of polymorphism that is easy in JSON (and
json-centric schemas) -- such as "Object or Array" -- do not map well to
object definitions of programming languages.

-+ Tatu +-