Re: [core] Link target attributes in CoRAL (was: Review of CoRAL)

Christian M. Amsüss <christian@amsuess.com> Mon, 05 November 2018 12:36 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 A31C5128CFD for <core@ietfa.amsl.com>; Mon, 5 Nov 2018 04:36:11 -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 V_EujvcvKjCj for <core@ietfa.amsl.com>; Mon, 5 Nov 2018 04:36:09 -0800 (PST)
Received: from prometheus.amsuess.com (alt.prometheus.amsuess.com [IPv6:2a01:4f8:190:3064::3]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id F1D191298C5 for <core@ietf.org>; Mon, 5 Nov 2018 04:36:08 -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 0A50241E9D; Mon, 5 Nov 2018 13:36:07 +0100 (CET)
Received: from poseidon-mailbox.amsuess.com (hermes.amsuess.com [10.13.13.254]) by poseidon-mailhub.amsuess.com (Postfix) with ESMTP id 7A2C810A; Mon, 5 Nov 2018 13:36:05 +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 2E21B5B; Mon, 5 Nov 2018 13:36:05 +0100 (CET)
Received: (nullmailer pid 13712 invoked by uid 1000); Mon, 05 Nov 2018 12:36:04 -0000
Date: Mon, 05 Nov 2018 13:36:04 +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: <20181105123604.GA9680@hephaistos.amsuess.com>
References: <CAAzbHvYk9dUvGmYsX1U=0qcU7330bYO6YjGAa51gFKMGGoy-Dg@mail.gmail.com>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="wRRV7LY7NUeQGEoC"
Content-Disposition: inline
In-Reply-To: <CAAzbHvYk9dUvGmYsX1U=0qcU7330bYO6YjGAa51gFKMGGoy-Dg@mail.gmail.com>
User-Agent: Mutt/1.10.1 (2018-07-13)
Archived-At: <https://mailarchive.ietf.org/arch/msg/core/8yiXvsa23p4ta8rLEuywdQSN1eE>
Subject: Re: [core] Link target attributes in CoRAL (was: 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: Mon, 05 Nov 2018 12:36:12 -0000

Hi,

On Mon, Nov 05, 2018 at 12:57:10PM +0100, Klaus Hartke wrote:
> > * ibd: Then, it can say something like "MUST NOT occur in a CoRAL
> >   document as attributes, but are expressed as link relations, nested
> >   links and link relations, respectively" to indicate that their
> >   information is not lost in the transition.
> 
> This is true for "rel" and "anchor", but not for potential new
> attributes defined in the future. I don't think CoRAL should try to
> accommodate those, so I'd just forbid all of them (without giving a
> mapping to CoRAL) as it is now.

Non-target link attributes are something I'd discourage in general;
would you, when someone does define new non-target attributes, encourage
them to specify how they'd be expressed in CoRAL?

(RDF would typically do some form of reificiation there, or provide an
intermediate anonymous node).

> Since in CoRAL it's possible to make statements about link targets
> (here: the literal "Überschrift"), something like this would look
> natural to me:
> 
>       #using iana = <http://www.iana.org/assignments/relation/>
>       #using attr = <http://TBD2/>
> 
>       iana:terms-of-service </tos> {
>          attr:title "Nutzungsbedingungen" { attr:hreflang "de" }
>          attr:title "Terms of use"        { attr:hreflang "en" }
>       }
> 
>    <=>
> 
>       </tos>; rel=terms-of-service;
>          title*=UTF-8'de'Nutzungsbedingungen;
>          title*=UTF-8'en'Terms%20of%20use

That's kind of neat and kind of scary. The scary comes from the
implications of

    hosts </present> {
        attr:title "Gift" { attr:hreflang "en" }
        attr:title "Geschenk" { attr:hreflang "de" }
    }
    hosts </posion> {
        attr:title "Poison" { attr:hreflang "en" }
        attr:title "Gift" { attr:hreflang "de" }
    }

which may be read to imply that there is a string "Gift" that is both
English and German and describes both resources.

I think it can still work b/c none of that would survive a naïve
round-trip to RDF, and a converter would need to make

    </present> attr:title "Gift"@en, "Geschenk"@de .
    </poison> attr:title "Poison"@en, "Gift"@de .

out of it because RDF statements can't have literals in their subject,
but that issue would need to be well-understood, and literals would need
to be described along the lines of "Two literals are only interchangable
if they have the same literal value *and* all their properties are
identical", where it is not possible to give a literal properties
outside of where it is defined (for that would create a different
literal).

> Another, related question is how to express link target attributes
> containing multiple, white-space separated values.

Yes; I have a similar proposal for that in micrurus[1], but it does not
go as far as converting to URIs or numerics yet.

[1]: https://gitlab.com/chrysn/micrurus/blob/master/README.rst#special-provisions-for-link-format-conversions

> If there's a guarantee that there won't be any new link target
> attributes in the future (for RFC 6690 link serializations), then we
> could skip the whole mapping topic and just define a new, more natural
> set of link relation types:

I don't think we need a guarantee for that. We can, as they pop up, for
some funny-string-valued attributes define equivalent more semantic
attributes, each with their own mapping. So a general CoRAL processor
you could encounter both `attr: rt="x y"` or `split-attr:rt rt:x,
split-attr rt:y` and needs to know of the equivalence.

A profile like links-CoRAL could then say that types need to be
expressed using the split attributes.

I would, in general, discourage defining new white-space-separated
attributes, and in particular I already do so in RD, for the RD would
need to know that an attribute is such a one for usable lookup.

As for the prefix, attr:rt, attr:if and attr:ct have registries, so we
could treat non-URI bare values in analogy to link relation types.
(Those produce currently uncompressible URIs, leading to profile-defined
URIs in what will be another thread).

Best regards
Chrisian

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