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

Nico Williams <nico@cryptonector.com> Thu, 07 November 2013 19:08 UTC

Return-Path: <nico@cryptonector.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 7044B11E8222 for <json@ietfa.amsl.com>; Thu, 7 Nov 2013 11:08:37 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.961
X-Spam-Level:
X-Spam-Status: No, score=-1.961 tagged_above=-999 required=5 tests=[AWL=0.016, BAYES_00=-2.599, FM_FORGED_GMAIL=0.622]
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 935IasmP29Dg for <json@ietfa.amsl.com>; Thu, 7 Nov 2013 11:08:31 -0800 (PST)
Received: from homiemail-a90.g.dreamhost.com (caiajhbdcagg.dreamhost.com [208.97.132.66]) by ietfa.amsl.com (Postfix) with ESMTP id 37EF211E8118 for <json@ietf.org>; Thu, 7 Nov 2013 11:08:23 -0800 (PST)
Received: from homiemail-a90.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a90.g.dreamhost.com (Postfix) with ESMTP id 7C0452AC078 for <json@ietf.org>; Thu, 7 Nov 2013 11:08:22 -0800 (PST)
Received: from mail-wi0-f176.google.com (mail-wi0-f176.google.com [209.85.212.176]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: nico@cryptonector.com) by homiemail-a90.g.dreamhost.com (Postfix) with ESMTPSA id 2B1002AC099 for <json@ietf.org>; Thu, 7 Nov 2013 11:08:22 -0800 (PST)
Received: by mail-wi0-f176.google.com with SMTP id ex4so1126089wid.15 for <json@ietf.org>; Thu, 07 Nov 2013 11:08:20 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=gLrtlUl9XjDtX0s2yhD5eunzyUmfAX9Y15gg020990I=; b=jnL4EycL4VkIJVZe5KannVyrUEeJ0EBG7Lz972SIFw/yVppb7Mo2vkoTfOMMJsqDPM Z6DI8MuRrpRiFcqy77io3WeeaFHY0gj6kI0phcu/qDmVIODwbLuKb9UPwDYBGYTEcDFK Lo9JQh+Ma3ZbrVNXxvjrOVB8dIzISBNWcnHf6droS0U+jveM7ok+q4f5UgCJVFZFirjq 6WCFiBxywN5cfsKuGwJmBfVxABbtRTEhGSDOr9IrmIRoZHqUsZN58sjw2PHfcHCsy/cU GNtoYNuqp5eP7zX3zg5oktAUGLXj1CEYcAbJsJhyweCNzMLX1gErFISUTGlytdyfxCb2 GYzg==
MIME-Version: 1.0
X-Received: by 10.194.94.137 with SMTP id dc9mr7882601wjb.38.1383851300291; Thu, 07 Nov 2013 11:08:20 -0800 (PST)
Received: by 10.216.151.136 with HTTP; Thu, 7 Nov 2013 11:08:20 -0800 (PST)
In-Reply-To: <CAGrxA26so9tZzBeQiLH-14ASU+JGDCBi5StJLrRVhsQB1aA0og@mail.gmail.com>
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> <CAGrxA26so9tZzBeQiLH-14ASU+JGDCBi5StJLrRVhsQB1aA0og@mail.gmail.com>
Date: Thu, 07 Nov 2013 13:08:20 -0600
Message-ID: <CAK3OfOhH2FkZdyHf2G32G+bef=PnTWsYERS=3UXVsjEz8CeUCQ@mail.gmail.com>
From: Nico Williams <nico@cryptonector.com>
To: Tatu Saloranta <tsaloranta@gmail.com>
Content-Type: text/plain; charset="UTF-8"
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 19:08:37 -0000

On Thu, Nov 7, 2013 at 12:55 PM, Tatu Saloranta <tsaloranta@gmail.com> wrote:
> On Wed, Nov 6, 2013 at 9:58 AM, Nico Williams <nico@cryptonector.com> wrote:
>> 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.

That's fair.

JSON (and XML) allow for such complex schemas (explicit or otherwise)
that we end up needing XSLT- and jq-like query languages.  It'd be
nice if such complexity could be avoided in many cases, but there's a
trade-off: flattening the schema will simply move the complexity into
object names (keys) and result in if ladders in actual code.  Perhaps
this should be noted somewhere, but there's more pressing things to do
I think.

> 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.

Right.  Having something like XSLT for JSON (jq!) really helps.

Nico
--