[Sml] [draft-ietf-sml-structured-email] Referencing structured data in text/html

Hans-Joerg Happel <happel@audriga.com> Mon, 03 March 2025 16:22 UTC

Return-Path: <happel@audriga.com>
X-Original-To: sml@mail2.ietf.org
Delivered-To: sml@mail2.ietf.org
Received: from localhost (localhost [127.0.0.1]) by mail2.ietf.org (Postfix) with ESMTP id 975775E0F3C for <sml@mail2.ietf.org>; Mon, 3 Mar 2025 08:22:12 -0800 (PST)
X-Virus-Scanned: amavisd-new at ietf.org
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, HTML_MESSAGE=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Received: from mail2.ietf.org ([166.84.6.31]) by localhost (mail2.ietf.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id WPbGtGH-cAJj for <sml@mail2.ietf.org>; Mon, 3 Mar 2025 08:22:06 -0800 (PST)
Received: from mail.audriga.com (mail.audriga.com [IPv6:2a01:4f8:c013:1f9e::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-256) server-digest SHA256) (No client certificate requested) by mail2.ietf.org (Postfix) with ESMTPS id C0B2E5E0ED2 for <sml@ietf.org>; Mon, 3 Mar 2025 08:22:05 -0800 (PST)
Received: from localhost (localhost [127.0.0.1]) by mail.audriga.com (Postfix) with ESMTP id EEFC25E66A5 for <sml@ietf.org>; Mon, 3 Mar 2025 16:22:04 +0000 (UTC)
X-Virus-Scanned: Debian amavis at mail.audriga.com
Received: from mail.audriga.com ([127.0.0.1]) by localhost (mail.audriga.com [127.0.0.1]) (amavis, port 10024) with ESMTP id FU_pGjLewJjI for <sml@ietf.org>; Mon, 3 Mar 2025 16:22:04 +0000 (UTC)
Received: from [192.168.10.116] (ip-109-090-161-242.um36.pools.vodafone-ip.de [109.90.161.242]) by mail.audriga.com (Postfix) with ESMTPSA id 5B18F5E66A3 for <sml@ietf.org>; Mon, 3 Mar 2025 16:22:04 +0000 (UTC)
Content-Type: multipart/alternative; boundary="------------Rrqp08maFUZmrkx1F3gQjDoJ"
Message-ID: <7d1bd4fd-7576-477e-a92e-5e183dfa9ff5@audriga.com>
Date: Mon, 03 Mar 2025 17:22:04 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Content-Language: en-US
To: "sml@ietf.org" <sml@ietf.org>
From: Hans-Joerg Happel <happel@audriga.com>
Message-ID-Hash: PAELZS7SYE65SJDRANJTIAYNJS2O2NBT
X-Message-ID-Hash: PAELZS7SYE65SJDRANJTIAYNJS2O2NBT
X-MailFrom: happel@audriga.com
X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header
X-Mailman-Version: 3.3.9rc6
Precedence: list
Subject: [Sml] [draft-ietf-sml-structured-email] Referencing structured data in text/html
List-Id: Structured Email <sml.ietf.org>
Archived-At: <https://mailarchive.ietf.org/arch/msg/sml/05WpNr_JS_pwae6y7O-kpnNBrUM>
List-Archive: <https://mailarchive.ietf.org/arch/browse/sml>
List-Help: <mailto:sml-request@ietf.org?subject=help>
List-Owner: <mailto:sml-owner@ietf.org>
List-Post: <mailto:sml@ietf.org>
List-Subscribe: <mailto:sml-join@ietf.org>
List-Unsubscribe: <mailto:sml-leave@ietf.org>

Hi,

there was one issue in the recent interim which we could not cover.

It is about how to reference nodes/items from the structured data from 
within the text/html version of the email (slide 7/8 in [1]).

The use case is "partial representation" - i.e. a text/html email with 
additional structured data for added value.

One concrete example might be a cooking newsletter, which may still want 
to provide a fully design text/html experience to the user, but on the 
other hand allow the user additional actions/more efficient use of the 
content by providing additional structured data, such as a structured 
data representation of recipes mentioned in the newsletter.

For the MUA it may then be worthwhile to understand which parts of the 
text/html message are related to which nodes in the structured data.

Since technically, nodes in the JSON-LD structured data are supposed to 
have a (unique) IRI attached as their "@id" property, this would be the 
natural thing to reference.

In Dublin, John suggested to consider fragment identifiers combined with 
the "cid:" URI of the JSON-LD body part (e.g., 
"cid:foo@bar#https://cooking.nyt.com/sheet-pan-chopped-salad").

The problem here is, that an IRI is not allowed as part of the fragment, 
i.e., the example is invalid. While there might be ways to work around 
this in JSON-LD by using namespaces [2], this would impose certain 
additional - potentially error-prone - constraints on the JSON-LD.

The *alternative *would be to simply stick to referencing the IRI using 
the HTTP URI scheme instead of "cid:" ([1], Slide 7]):

     <a data-id=”https://cooking.nyt.com/sheet-pan-chopped-salad” 
href=”...”>sheet-pan chopped salad with chicken</a>

This would miss the "cid"-Reference of course. However, assuming that a 
client would interpret any "data-id" property in the context of SML 
specs, the client could anyhow simply extract node identifiers from any 
suitable MIME part (irrespective of cid) for matching.

Any opinions on that?  (related GitHub issue: 
https://github.com/hhappel/draft-happel-structured-email/issues/5)

Thanks and best,
Hans-Joerg

[1] 
https://datatracker.ietf.org/meeting/interim-2025-sml-02/materials/slides-interim-2025-sml-02-sessa-structured-email-base-spec-00.pdf
[2] https://www.w3.org/TR/json-ld11/#iri-expansion-within-a-context