Re: [Json] Proposed rechartering for the JSON WG

Nico Williams <nico@cryptonector.com> Mon, 10 February 2014 17:43 UTC

Return-Path: <nico@cryptonector.com>
X-Original-To: json@ietfa.amsl.com
Delivered-To: json@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 073871A0386 for <json@ietfa.amsl.com>; Mon, 10 Feb 2014 09:43:46 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.378
X-Spam-Level:
X-Spam-Status: No, score=-1.378 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FM_FORGED_GMAIL=0.622, RCVD_IN_DNSWL_NONE=-0.0001] autolearn=no
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id HxEDI2UZHpjk for <json@ietfa.amsl.com>; Mon, 10 Feb 2014 09:43:44 -0800 (PST)
Received: from homiemail-a26.g.dreamhost.com (caiajhbdcbbj.dreamhost.com [208.97.132.119]) by ietfa.amsl.com (Postfix) with ESMTP id 8AF4D1A0405 for <json@ietf.org>; Mon, 10 Feb 2014 09:43:44 -0800 (PST)
Received: from homiemail-a26.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a26.g.dreamhost.com (Postfix) with ESMTP id 4B036B8079 for <json@ietf.org>; Mon, 10 Feb 2014 09:43:44 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=cryptonector.com; h= mime-version:in-reply-to:references:date:message-id:subject:from :to:cc:content-type; s=cryptonector.com; bh=K2d24X3tB9IbxlXaovPN Th5WvXk=; b=s7Q3ApBFPIcvQYd2qPLdxiB64ORAASFa8Qr4aPTJXpMJSf+Jb5fl ZsxwBOwU3xqUbVjNpQxDnIGlCD9DsXQLYldfXjZq8qHNEOSuyRbTBgSYTqAuENli /MgIA2QkFodtao7hquKRkEoj4azg4zdL61EitVWPpvLKZ4SJ2yB77S8=
Received: from mail-wi0-f178.google.com (mail-wi0-f178.google.com [209.85.212.178]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: nico@cryptonector.com) by homiemail-a26.g.dreamhost.com (Postfix) with ESMTPSA id EED12B8057 for <json@ietf.org>; Mon, 10 Feb 2014 09:43:43 -0800 (PST)
Received: by mail-wi0-f178.google.com with SMTP id cc10so3077710wib.11 for <json@ietf.org>; Mon, 10 Feb 2014 09:43:42 -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=00aDRjXPL9GBciQqSQLZosMGl1VfsmA6BZXze5q9rcs=; b=LVqoaWOPSN1yYYg8l2qOeu0aGUvKafrYjxDTw2zrDvLWUoq09H903o54/veIqdnO8V tAlKtbIvSF5xWF0KzeLx4bl4frNVFPa08NPVKkuaFlQNEsqq1cS32N4Ii1UCgo1CImol 4mZvT4kL9VaxOvlK+wdY3RQQr9u4oTxKC2I1ZINcEYJCHeNISziIxX5Hs0PdYfepA/Qd of+re13G+w7/Y+ld+lgcvcKy934mbulMNdyy1mXW+pRzYdaa5rLgpNUYbuDR22mLVt7m zQq39NgkUMlkbMAv0oB3At08oYEfHqvKpSCMSKvo76olFw/ND2wJ35nr2VNTHrXjZSPT +FNA==
MIME-Version: 1.0
X-Received: by 10.180.97.72 with SMTP id dy8mr3890029wib.5.1392054222343; Mon, 10 Feb 2014 09:43:42 -0800 (PST)
Received: by 10.217.108.132 with HTTP; Mon, 10 Feb 2014 09:43:42 -0800 (PST)
In-Reply-To: <CAHBU6isUs76sXdcH5gNMrZKr4XpcZdEziHjrHzUpHDvKXcvyWg@mail.gmail.com>
References: <52D9B39C.5020102@cisco.com> <1C1347D2-0D99-4D49-B4C1-199246167D23@vpnc.org> <CAMm+Lwj0phrmP563tBbZJKHeYw=Azh1as6GZOA6rANPpC6PJgA@mail.gmail.com> <CAHBU6iv+-9xQYAjZdfZk7+GeA6J+sjaV5era3L+PiJ9RoauBYg@mail.gmail.com> <CAMm+Lwh0O4+iuaJMUhYgj+0GS8e9b_nZtNNX91hOmjUypsgkTQ@mail.gmail.com> <CAK3OfOhu0GZY9CVQrqD4SyjHLVEoEg1DtYj_6imZbbHtzX2eEw@mail.gmail.com> <CAHBU6iuR0MPm9q483jBMqTRkGV1f2giGNhp+UciQ7rRnrvcEBA@mail.gmail.com> <CAK3OfOj7Ti+rRGXXdMQwFvErUrbG34N8Wn0JqGhaKBA4=ri-nA@mail.gmail.com> <CAHBU6isUs76sXdcH5gNMrZKr4XpcZdEziHjrHzUpHDvKXcvyWg@mail.gmail.com>
Date: Mon, 10 Feb 2014 11:43:42 -0600
Message-ID: <CAK3OfOj6uU_+NE0Q+P+MxoeyW_Gfpx50-UOHAJaFN10ygmqXDg@mail.gmail.com>
From: Nico Williams <nico@cryptonector.com>
To: Tim Bray <tbray@textuality.com>
Content-Type: text/plain; charset="UTF-8"
Cc: Phillip Hallam-Baker <hallam@gmail.com>, Paul Hoffman <paul.hoffman@vpnc.org>, "json@ietf.org" <json@ietf.org>
Subject: Re: [Json] Proposed rechartering for the JSON WG
X-BeenThere: json@ietf.org
X-Mailman-Version: 2.1.15
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: Mon, 10 Feb 2014 17:43:46 -0000

On Sat, Feb 8, 2014 at 5:52 PM, Tim Bray <tbray@textuality.com> wrote:
> On Sat, Feb 8, 2014 at 2:50 PM, Nico Williams <nico@cryptonector.com> wrote:
>>
>>
>> An XPath/XSLT for JSON would be good.  There's a great candidate for
>> that: http://stedolan.github.io/jq .
>
>
> jq seems like overkill. Wow, would it ever be easy to do a JSON path
> selector.   They practically read themselves
>
> "buffer"/"size"

FYI:

.buffer.size

> //"size"

recurse(.[]).size

> //"buffers"/./"size"

recurse(.[]).buffers[].size

> //"buffers"/0/"size"

recurse(.[]).buffers[0].size

The .name syntax is a bit to type-strong and so you get spurious error
messages (safely ignored).  I think the right thing to do here is to
make .name act like 'empty' when . is not an object, or if name is an
integer, when . is not an array (but .[number] needs to continue to
produce warnings if . is not an array).  That and add ..name syntax,
then '..buffers.0.size' should do what you want without spurious error
messages.  I'll defer to Stephen either way.

BTW, I've needed // in XPath very often.  But I've never needed it
when dealing with JSON data.  The JSON data I've dealt with never had
more than one layer of structure repetition, while XML data I've dealt
with had many.

> //"buffers"/-1/.

This one's a pain as jq doesn't do negative indices, so you have -1 the length.

> "buffer"/./"key"

See above.

Nico
--