[calsify] Re: JSContact: supporting multiple names?

Mauro De Gennaro <mauro@stalw.art> Thu, 24 April 2025 08:04 UTC

Return-Path: <mauro@stalw.art>
X-Original-To: calsify@mail2.ietf.org
Delivered-To: calsify@mail2.ietf.org
Received: from localhost (localhost [127.0.0.1]) by mail2.ietf.org (Postfix) with ESMTP id 8F59A2079A7F for <calsify@mail2.ietf.org>; Thu, 24 Apr 2025 01:04:33 -0700 (PDT)
X-Virus-Scanned: amavisd-new at ietf.org
X-Spam-Flag: NO
X-Spam-Score: -2.098
X-Spam-Level:
X-Spam-Status: No, score=-2.098 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: mail2.ietf.org (amavisd-new); dkim=pass (2048-bit key) header.d=stalw.art header.b="HgshJgKT"; dkim=neutral reason="invalid (unsupported algorithm ed25519-sha256)" header.d=stalw.art header.b="8PatCfWK"
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 MLqE5La_ZQWM for <calsify@mail2.ietf.org>; Thu, 24 Apr 2025 01:04:31 -0700 (PDT)
Received: from mail.stalw.art (mail.stalw.art [135.181.195.209]) (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 4E6A52079A76 for <calsify@ietf.org>; Thu, 24 Apr 2025 01:04:31 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; s=202404r; d=stalw.art; c=relaxed/relaxed; h=Message-Id:To:Date:Subject:From; t=1745481870; bh=9DKLapgIU3VBmPxenrXYHdO 9d/8Q8j5yFHlKWFpZ0m0=; b=HgshJgKTojTlA6H/2WjreRAHPmDp9h15Ujk42XN6BZVLj1A5/3 Y4DlGXaQkTkb3fdichhKxmfGHpKnQB1U7W7Au4u3OpUgrtZkgNZWtiLfM8vgcrgsOv1cEP491yS 5CraZiRUkVjrCjsdH40FocfJo33kyuoie9Y26FbLVlzGeSHE6uuFOGBnkLw29bF7bMbdsyDizJh bNuIIlZ7t2MghhrfNwYphNYBRhhtCm9mTLdMxkLHrV2IOdSSfEG0MSbWCbMzd8eCCggJFfXqyfi fzwUiNhoN4D0TzsoRwSMs97E7khMSlpIdBGbpcdx+BXZVsEy0wb9T1cpBAy55jpuqYw==;
DKIM-Signature: v=1; a=ed25519-sha256; s=202404e; d=stalw.art; c=relaxed/relaxed; h=Message-Id:To:Date:Subject:From; t=1745481870; bh=9DKLapgIU3VBmPxenrXYHdO 9d/8Q8j5yFHlKWFpZ0m0=; b=8PatCfWKp9z2f4YSPyw9FoV1YmecK8yyUEN1YksKpvk2DlaEEo 34+zZPH12NcXT49KNLtDTi1Js4hJFBcABFBA==;
From: Mauro De Gennaro <mauro@stalw.art>
Content-Type: multipart/alternative; boundary="Apple-Mail=_13910FE4-CB51-4D9F-98E7-F4CFB5192B24"
Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.700.6.1.9\))
Date: Thu, 24 Apr 2025 10:04:19 +0200
References: <527ae9bd-0d91-4755-8293-a445b5c9c4df@app.fastmail.com> <E39B63F5-AF4D-4C98-A9CE-3C9FF83B8F9C@stalw.art> <1266c24a-b86e-47dd-8248-b4cd4b57cfcd@app.fastmail.com> <E8EC9678-0AA0-4765-8EB6-539DD58D536E@stalw.art> <441b5d57-871d-4665-bd86-dc3c2887c19f@app.fastmail.com>
To: calsify@ietf.org
In-Reply-To: <441b5d57-871d-4665-bd86-dc3c2887c19f@app.fastmail.com>
Message-Id: <96D657C1-64BC-484E-8506-57EDC4299FC3@stalw.art>
X-Mailer: Apple Mail (2.3731.700.6.1.9)
Message-ID-Hash: H5NYIG2UB5I4DBTSQ7XLVGJIKVBFLDMD
X-Message-ID-Hash: H5NYIG2UB5I4DBTSQ7XLVGJIKVBFLDMD
X-MailFrom: mauro@stalw.art
X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-calsify.ietf.org-0; 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: [calsify] Re: JSContact: supporting multiple names?
List-Id: Calendaring and Scheduling Standards Simplification <calsify.ietf.org>
Archived-At: <https://mailarchive.ietf.org/arch/msg/calsify/6dzYiL9GUidO9rQA5dwLhhGpMp4>
List-Archive: <https://mailarchive.ietf.org/arch/browse/calsify>
List-Help: <mailto:calsify-request@ietf.org?subject=help>
List-Owner: <mailto:calsify-owner@ietf.org>
List-Post: <mailto:calsify@ietf.org>
List-Subscribe: <mailto:calsify-join@ietf.org>
List-Unsubscribe: <mailto:calsify-leave@ietf.org>

Hi Robert,

I the vCardConvertedProps proposal, it's a step in the right direction. I’ve been exploring a slightly different approach that might help address some of the representation mismatches between vCard <-> JSContact and iCal <-> JSCalendar, while also streamlining the data format.
The idea is: since we already evaluate JSON Pointers to handle localizations, why not extend this concept by using patch objects to represent all vCard/iCal parameters that don’t have a natural place in JSContact or JSCalendar? This would allow us to keep the core format clean and consistent by centralizing all those extra parameters in one place.

Here's an example vCard:

BEGIN:VCARD
VERSION:4.0
FN;ALTID=9;X-CUSTOM=abc:Gabriel García Márquez
TITLE;ALTID=3;LANGUAGE=EN:novelist
TITLE;ALTID=1;X-PROP=xyz;LANGUAGE=es:escritor
TITLE;ALTID=2;X-PROP=tyu;LANGUAGE=es:novelista
EMAIL;X-FOO=Bar:gabriel@writer.com
item1.X-FOO;X-BAR=Hello:World!
END:VCARD

Could be represented in JSContact like this:


{
  "name": {
    "full": "Gabriel García Márquez"
  },
  "titles": {
    "t1": {
      "kind": "title",
      "name": "novelist"
    }
  },
  "emails": {
    "email1": {
      "address": "gabriel@writer.com"
    }
  },
  "localizations": {
    "es": {
      "titles/t1/name": "escritor"
    }
  },
  "vCardParams": {
    "name/full": {
      "ALTID": "9",
      "X-CUSTOM": "abc"
    },
    "name/title/t1": {
      "ALTID": "3"
    },
    "localizations/es/names/title/t1": {
      "ALTID": "1",
      "X-PROP": "xyz"
    },
    "emails/email1": {
      "x-foo": "Bar"
    }
  },
  "vCardProps": [
    [
      "TITLE",
      {
        "ALTID": "2",
        "LANGUAGE": "ES",
        "X-PROP": "tyu"
      },
      "novelista"
    ],
    [
      "x-foo",
      {
        "x-bar": "Hello",
        "group": "item1"
      },
      "unknown",
      "World!"
    ]
  ]
}

The only slightly awkward case is where we end up patching a localization entry itself (e.g. localizations/es/titles/t1/name). While not ideal, I think this trade-off is worth it given how much cleaner and more structured the rest of the format becomes.


Best,
Mauro


> On 23 Apr 2025, at 18:58, Robert Stepanek <rsto=40fastmailteam.com@dmarc.ietf.org> wrote:
> 
> Hi Mauro,
> 
> thanks for the clarification.
> 
> On Wed, Apr 23, 2025, at 5:40 PM, Mauro De Gennaro wrote:
>> I went through my notes and the issue I had found with the full name was not about multiple FNs but rather related to parameters in FN fields. This is because JSContact defines the name.full property as a String:
>> [...]
>> So it doesn’t seem possible to represent vCard parameters in the main full name. For example, let’s take the flowing vCard object:
> 
> 
> We might indeed be missing something for preserving such cases during conversion. Mario might chime in and correct me here.
> 
> One option would be to introduce a new conversion-specific JSCalendar property in addition to the ones already defined in RFC 9555. That new property would be defined to achieve what the ICalComponent "convertedProperties" property in jscalendar-icalendar, section 5.1.1 does for iCalendar conversion:
> 
> Here is draft off the top of my head:
> 
> vCardConvertedProps: String[VCardConvertedProperty]
> This contains conversion-related information about the vCard properties that got partially or fully converted to a JSContact object. Each key defines the path to a property of the JSContact object on which the "vCardConvertedProps" property is set on. The value for each key contains information about the vCard property which converted to the  property located at that key.
> 
> The VCardConvertedProperty object has the following properties:
> 
> - name (mandatory): String. the name of the vCard property
> - params: String[String] (optional) This contains parameters of the vCard property. The value MUST comply with vCard parameters formatted in jCard.
> - valueType: String (optional) This is the name of the vCard property value type in lowercase.
> 
>> "name": {
>> "full": “ {
>>     value: "Wile E. Coyote”.
>>     "vCardParams": {
>> “ALT-ID": “2”,
>> “X-CUSTOM”: “abc”
>> }
>>   }
>> }
> 
> With the "vCardConvertedProperties" this might look like:
> 
> "name": {
> "full": "Wile E. Coyote",
> "vCardConvertedProps": {
> "full": {
> "name": "fn",
> "params": {
> "alt-id": "2",
> "x-custom": "abc"
> }
> }
> }
> }
> 
> which would have the benefit of also allowing to preserve parameters for other properties that got converted to the name property.
> 
> Regards,
> Robert
> _______________________________________________
> calsify mailing list -- calsify@ietf.org
> To unsubscribe send an email to calsify-leave@ietf.org