Re: [Json] Schema Requirements (Was: Re: Nudging the English-language vs. formalisms discussion forward)

Nico Williams <> Thu, 20 February 2014 17:28 UTC

Return-Path: <>
Received: from localhost ( []) by (Postfix) with ESMTP id EE7121A025E for <>; Thu, 20 Feb 2014 09:28:49 -0800 (PST)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -1.378
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 ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id GVSfoHaLUH_y for <>; Thu, 20 Feb 2014 09:28:48 -0800 (PST)
Received: from ( []) by (Postfix) with ESMTP id 6D92C1A0252 for <>; Thu, 20 Feb 2014 09:28:48 -0800 (PST)
Received: from (localhost []) by (Postfix) with ESMTP id B10392AC07A for <>; Thu, 20 Feb 2014 09:28:44 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed;; h= mime-version:in-reply-to:references:date:message-id:subject:from :to:cc:content-type;; bh=3KWUvowvE7IsRnzMt2Tl tbaQrLM=; b=FqoSPtAsX3iGOiEi8v3JTBco68HQyLh74vNie22/nXgS30VPNOvH eilhhw1WqK6LY/ERPKrUEm3lP4Q0xVu6+gtDMfl4S9GI6tsXpymnmsMfftMw3obQ ICQ71ggmThclDktx358HD3bgvEqfBKDH/A1hbMlIsoY80qOa/OBOnng=
Received: from ( []) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: by (Postfix) with ESMTPSA id 34FD82AC079 for <>; Thu, 20 Feb 2014 09:28:43 -0800 (PST)
Received: by with SMTP id t61so1726876wes.36 for <>; Thu, 20 Feb 2014 09:28:42 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=20130820; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=QCpVaRRIevoM1nZF0SZvMU8Q0715HohjdMXShhhtvsM=; b=GLpvZtywarPMgvEVcSznm77jz/0txDJxpOgpyFOMJaAvxUJjzDIY22VKNKbAkqP9ui xcBxSQXzEJj6kwRcUihRpa2+riankpk19gEOZrXrguPrlUbhFF9a/uf4r10+wabg1L3w bB4J2hFUC47vIZ25586Ewxe00MN45LkO7TOz8AtNsIRqkl/ThDZ7eoz6BVmwBAKo+g5b 99c2AA8E4c13ceBhTYpQuP50JXaYAPO0rE0vsErc2dWwCX8erh+9Gq1MrdCDhDytKOWh s2THc7DyJ5Qh6VdAg8ZLdRxscKe2/ZqOHZqOkLKJ/0+Qp6l+XvCLHdNFVQjm/gAwtHac BY9Q==
MIME-Version: 1.0
X-Received: by with SMTP id ef3mr8135016wib.39.1392916932524; Thu, 20 Feb 2014 09:22:12 -0800 (PST)
Received: by with HTTP; Thu, 20 Feb 2014 09:22:12 -0800 (PST)
In-Reply-To: <FE06CD427A4044B995F57C4926A1C8C2@codalogic>
References: <> <> <> <> <> <> <> <> <> <357740A8AA0F4316BE630917321FAB4D@codalogic> <B1EBE05A69362F001777F807@cyrus.local> <47BB9131737D42218A6382DEF45BBE2C@codalogic> <> <AF211B67DB3D453D9DE8F8FA53886F73@codalogic> <> <FE06CD427A4044B995F57C4926A1C8C2@codalogic>
Date: Thu, 20 Feb 2014 11:22:12 -0600
Message-ID: <>
From: Nico Williams <>
To: Pete Cordell <>
Content-Type: text/plain; charset=UTF-8
Cc: Carsten Bormann <>, Phillip Hallam-Baker <>, JSON WG <>
Subject: Re: [Json] Schema Requirements (Was: Re: Nudging the English-language vs. formalisms discussion forward)
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: "JavaScript Object Notation \(JSON\) WG mailing list" <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-Subscribe: <>, <>
X-List-Received-Date: Thu, 20 Feb 2014 17:28:50 -0000

On Thu, Feb 20, 2014 at 10:55 AM, Pete Cordell <> wrote:
> My position is that, having recognised that Dates represent a case where
> microformats are useful, perhaps we should not assume that these are the
> only cases.  IP addresses?  Crypto OIDs?  Dates on Mars?

There are two ways to deal with alternative representations:

 - convert to/from a canonical representation and use that one for interchange
 - use a discriminated union (XDR) / CHOICE (ASN.1, same thing)

I think any decent schema will need to allow for the latter, and not
just because of types that have multiple possible representations.

As for the former, it's always an option, schema or not.  And it's
more efficient to have receiver-makes-right in this case (dates &
timestamps), though that does require having a fixed set of
representations that can be sent, else a negotiation would be

This seems obvious enough that we shouldn't dwell on it.

The real question is: which schema(s) should we be copying/learning
from?  So far the answer seems to be down to:

 - Schematron
 - RelaxNG compact
 - Web IDL

I think that's a fine starting point.

If you want to talk about requirements, I think we should consider things like:

 - which grammar parsing algorithms we want to support: LR, LALR(1),
LALR(k), GLR, ...

 - the basic metaphor:
    - types! (a-la ASN.1, only without the tags, no IOS, ...)
    - pattern matching rules! (something like collections of
XPath-like expressions)
    - something else

The metaphor thing gets to, in part, the purpose of the schema:

 - documentation for sure, validation no doubt, but, code generation
(into C, Java, JS, C#, ...)?  (IMO: yes)


 - extensibility (meta: to have it or not; if yes, how)

 - modularity (meta: to have it or not; if yes, how)

Oh, and:

 - one schema language, or more?  (IMO: inevitably we'll end up with more)

I may have missed some things.  But I think that's a decent set of
attributes from which to start a schema requirements discussion.