Re: [core] Review of draft-ietf-core-coral -02

Klaus Hartke <hartke@projectcool.de> Sun, 12 January 2020 11:27 UTC

Return-Path: <hartke@projectcool.de>
X-Original-To: core@ietfa.amsl.com
Delivered-To: core@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 8F18F12004A; Sun, 12 Jan 2020 03:27:11 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.899
X-Spam-Level:
X-Spam-Status: No, score=-1.899 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=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 mEbdjXrTWmGV; Sun, 12 Jan 2020 03:27:09 -0800 (PST)
Received: from wp382.webpack.hosteurope.de (wp382.webpack.hosteurope.de [IPv6:2a01:488:42:1000:50ed:8597::]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 5CF8C120043; Sun, 12 Jan 2020 03:27:08 -0800 (PST)
Received: from mail-qk1-f180.google.com ([209.85.222.180]); authenticated by wp382.webpack.hosteurope.de running ExIM with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) id 1iqbOb-0002zG-Gf; Sun, 12 Jan 2020 12:27:05 +0100
Received: by mail-qk1-f180.google.com with SMTP id a203so6141602qkc.3; Sun, 12 Jan 2020 03:27:05 -0800 (PST)
X-Gm-Message-State: APjAAAVe3ndDna2AFhx4qFkxFeO9wOQQdEk3NipQUIgSZu8s6E9NUOGj ppJtSysYLheOYmqesTV5ld9TKycKixq7iFI2qO4=
X-Google-Smtp-Source: APXvYqxtjJYLhEYeUcy1ni7RNsxdoOXx0EmoAiqOh+dclXcAWKQkNq/wDc0GaYGdLTEtd6F0qLJIxxcekBulX+HlABs=
X-Received: by 2002:a37:9bc2:: with SMTP id d185mr6920497qke.422.1578828424139; Sun, 12 Jan 2020 03:27:04 -0800 (PST)
MIME-Version: 1.0
References: <000101d5c905$adec9480$09c5bd80$@augustcellars.com>
In-Reply-To: <000101d5c905$adec9480$09c5bd80$@augustcellars.com>
From: Klaus Hartke <hartke@projectcool.de>
Date: Sun, 12 Jan 2020 12:26:28 +0100
X-Gmail-Original-Message-ID: <CAAzbHvbw6gXdzjF1Q_Vw1kaDM_cGeXcxe_c6_ErvJcXq_my8gQ@mail.gmail.com>
Message-ID: <CAAzbHvbw6gXdzjF1Q_Vw1kaDM_cGeXcxe_c6_ErvJcXq_my8gQ@mail.gmail.com>
To: Jim Schaad <ietf@augustcellars.com>
Cc: draft-ietf-core-coral@ietf.org, "core@ietf.org WG" <core@ietf.org>
Content-Type: text/plain; charset="UTF-8"
X-bounce-key: webpack.hosteurope.de; hartke@projectcool.de; 1578828429; f66fa92e;
X-HE-SMSGID: 1iqbOb-0002zG-Gf
Archived-At: <https://mailarchive.ietf.org/arch/msg/core/WfVPbK19PlTPBrOTyETYYsYU4IU>
Subject: Re: [core] Review of draft-ietf-core-coral -02
X-BeenThere: core@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: "Constrained RESTful Environments \(CoRE\) Working Group list" <core.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/core>, <mailto:core-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/core/>
List-Post: <mailto:core@ietf.org>
List-Help: <mailto:core-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/core>, <mailto:core-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sun, 12 Jan 2020 11:27:11 -0000

Jim Schaad wrote:
> The change of text by adding the last paragraph of section 3.1.1 took me by
> surprise.  It does not match what my understanding of how things are going
> to be parsed.  It took me quite a while to realize that there is a set of
> conflicting statements here.  To me, the text appears to state that when
> parsing  document there is a single environment, and that environment
> consists of two variables.  However, when parsing a link or a form there is
> a new pair of variables that are added to this environment.  Thus in my mind
> the environment consists of a stack of variable pairs not just a single pair
> of variables.

In draft-ietf-core-coral-02, the environment consists of the two
variables, but each scope creates a new environment that is discarded
at the end of the scope. So, yes, there's a stack of environments
involved, not just a single environment. (This hasn't changed since
draft-hartke-t2trg-coral-03.)

The idea behind this is that a processor should be able to skip over
an entire sub-tree without having to process all the directives in it.
Before CoRAL used CBOR, each sub-tree used to be prefixed by its
number of bytes rather than its number of data items, so skipping over
a sub-tree could be implemented by simply bumping a pointer and doing
a bounds check.

> Section 3.2.1 - There is a MUST NOT in the last paragraph, is the receiver
> of a document supposed to enforce this in some manner if it is in a location
> that it does not currently care about.  Some things can be checked such as
> an integer where a text string is required, but for form fields this would
> seem to be not generally enforceable.

The intention here was to say that the MUST NOT applies to data types
that are syntactically not allowed (like a Boolean as a link relation
type) but not to data types that are semantically not allowed (like a
Boolean as a form field value that is supposed to indicate a content
format).

> Section 4.2.3.3 - I think I might be missing some restrictions here and want
> to verify.  Consider the following document:
>
> #using a = <http://coapapp.org/app1>
>
> a:2#tag </tos>
>
> In this case, is the result of the processing
> <http://coapapp.org/app12#tag>?

According to the ABNF in section 4.1, the second line would tokenize as

  identifier("a") punctuator(":") integer(2)
        punctuator("#") identifier("tag") iriref("/tos")

Section 4.2.3.3 requires two identifiers separated by a colon, so this
line is currently a syntax error.

If you, for example, have

   #using a = <http://coapapp.org/app1>

    a:b2 </tos>

instead, the second line would tokenize as

   identifier("a") punctuator(":") identifier("b2") iriref("/tos")
   \______________________________________________/
                    qualified-name
   \______________________________________________/ \____________/
                          IRI                             IRI
   \______________________________________________/ \____________/
                    relation-type                     link-target
   \_____________________________________________________________/
                              link

and the result of processing a:b2 would be <http://coapapp.org/app1b2>.

Best regards,
Klaus