Re: [core] [T2TRG] Review of CoRAL

Christian M. Amsüss <christian@amsuess.com> Sat, 10 November 2018 09:54 UTC

Return-Path: <christian@amsuess.com>
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 47EAF130E13 for <core@ietfa.amsl.com>; Sat, 10 Nov 2018 01:54:43 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -0.921
X-Spam-Level:
X-Spam-Status: No, score=-0.921 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, FROM_EXCESS_BASE64=0.979] autolearn=no 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 HjkNZLTmWklU for <core@ietfa.amsl.com>; Sat, 10 Nov 2018 01:54:40 -0800 (PST)
Received: from prometheus.amsuess.com (prometheus.amsuess.com [5.9.147.112]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 21AB7130DE4 for <core@ietf.org>; Sat, 10 Nov 2018 01:54:39 -0800 (PST)
Received: from poseidon-mailhub.amsuess.com (unknown [IPv6:2a02:b18:c13b:8010:a800:ff:fede:b1bd]) by prometheus.amsuess.com (Postfix) with ESMTPS id 19CF341F8C; Sat, 10 Nov 2018 10:54:38 +0100 (CET)
Received: from poseidon-mailbox.amsuess.com (unknown [IPv6:2a02:b18:c13b:8010:a800:ff:fede:b1bf]) by poseidon-mailhub.amsuess.com (Postfix) with ESMTP id 0266039; Sat, 10 Nov 2018 10:54:37 +0100 (CET)
Received: from hephaistos.amsuess.com (hephaistos.amsuess.com [IPv6:2a02:b18:c13b:8010::71b]) by poseidon-mailbox.amsuess.com (Postfix) with ESMTPSA id 8115D2E; Sat, 10 Nov 2018 10:54:36 +0100 (CET)
Received: (nullmailer pid 19399 invoked by uid 1000); Sat, 10 Nov 2018 09:54:35 -0000
Date: Sat, 10 Nov 2018 10:54:35 +0100
From: "Christian M. Amsüss" <christian@amsuess.com>
To: Klaus Hartke <hartke@projectcool.de>
Cc: "core@ietf.org WG" <core@ietf.org>
Message-ID: <20181110095435.GC5888@hephaistos.amsuess.com>
References: <20181031164534.GA4995@hephaistos.amsuess.com> <CAAzbHvYPRLMZFh2Yi7jwM8ZzVMXcLmqe20Qeo2LjD9xCu4=9QA@mail.gmail.com> <20181105120109.GC12165@hephaistos.amsuess.com> <CAAzbHvajs0LgApHX6BgV-FngU51G+mGxbYCpyTqt_pJwchDGFQ@mail.gmail.com>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="V0207lvV8h4k8FAm"
Content-Disposition: inline
In-Reply-To: <CAAzbHvajs0LgApHX6BgV-FngU51G+mGxbYCpyTqt_pJwchDGFQ@mail.gmail.com>
User-Agent: Mutt/1.10.1 (2018-07-13)
Archived-At: <https://mailarchive.ietf.org/arch/msg/core/zZPkYPLxMeeZ631DZzKpItwt6FM>
Subject: Re: [core] [T2TRG] Review of CoRAL
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: Sat, 10 Nov 2018 09:54:43 -0000

On Sat, Nov 10, 2018 at 10:08:55AM +0100, Klaus Hartke wrote:
> Christian Amsüss wrote:
> > > The draft currently specifies that a base IRI is resolved against the
> > > current context IRI, not the previous base IRI.
> >
> > Thanks; likewise, I missed updating the current relation number. Both
> > being fixed.

Oh: I did not fix all of it. What my original code did was change the
context IRI as well (which I had fixed), but I kept working off the same
base IRI.

> I just checked how Turtle does it, and it seems that in Turtle a base
> IRI is resolved against the previous base IRI.

I checked HTML, but they only allow a single base href. XML's (and thus
Atom's) xml:base URIs can't be relative references anyway. In JSON-LD,
the @base must be in the @context if I understand the text right, so
there can only be one like in HTML.

>     #base <foo/>
>     #base <bar/>
>
> Advantage: Since link targets are more likely to be relative to the
> context than to the previous link targets, this should generate
> slightly more compact CBOR representations.

I'd think that situations of deep links will be rather unlikely anyway
(if / says something about /foo/bar/, it probably says something about
/foo/ too, and /foo/bar/ will be linked to from /foo/ and not / in the
likely cases.)

> Document with base IRIs relative to previous base IRI:
> 
>     #base <foo/>
>     #base <../bar/>
> 
> Advantages: Since the context IRI is not used after the first base IRI
> directive, a processor can reuse the memory for the context IRI to
> store the base IRI instead of having to allocate memory for both. It
> would match the intuition of people who are familiar with Turtle.

I'd rather think of it as "updated in-place" than "freed and reused",
but yes, it might be more RAM efficient (esp. interesting with non-zero
nesting limits). Transfering intuition from related formats is a bonus
too, so...

> Would it make sense to switch?

yes.

Christian

-- 
To use raw power is to make yourself infinitely vulnerable to greater powers.
  -- Bene Gesserit axiom