Re: [Asdf] Extension point mechanism thoughts

Michael Koster <michaeljohnkoster@gmail.com> Wed, 30 March 2022 15:20 UTC

Return-Path: <michaeljohnkoster@gmail.com>
X-Original-To: asdf@ietfa.amsl.com
Delivered-To: asdf@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 185913A088D for <asdf@ietfa.amsl.com>; Wed, 30 Mar 2022 08:20:11 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.108
X-Spam-Level:
X-Spam-Status: No, score=-2.108 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, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com
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 eudvSz3el5tt for <asdf@ietfa.amsl.com>; Wed, 30 Mar 2022 08:20:07 -0700 (PDT)
Received: from mail-pg1-x52b.google.com (mail-pg1-x52b.google.com [IPv6:2607:f8b0:4864:20::52b]) (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 05C8D3A0884 for <asdf@ietf.org>; Wed, 30 Mar 2022 08:20:06 -0700 (PDT)
Received: by mail-pg1-x52b.google.com with SMTP id l129so9343562pga.3 for <asdf@ietf.org>; Wed, 30 Mar 2022 08:20:06 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:mime-version:subject:date:references:to:in-reply-to:message-id; bh=RspjhghubkIVz1IW8mIHwCxv3DAQkIkubVrInTWcCNQ=; b=UtQbpJ96NE6gXsz3B2ceetjnE/kd6x0CXebIzseNnBoAN2o2ZaIBBZuuP8oWTBjxPK tWaI4lKz11Jk7Mdk3q5YHuGUAWM3m91lIMU3zx6cFaGDQjKTp1rT7KTTNPsh+2mH5evC IUi/S6uPj2+07lUTTmEjtK8PfkEXa8ww3ti4h+BQ35Wsp8V3r35qozP9A5BYGM2VhOKS X6qGOb7CeTCU/Lc2sSk7d64XI2tlbkpqxLpE/PiKqpBS1McRhtfdUH/ztujz1YyRe06E 8UX0FoZvNfNy8P+R8ybz94WG/mA3TBtaaZ6cCSGXY40q0qELktilDtuJSu45DzNqj4WE G5Ww==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:mime-version:subject:date:references:to :in-reply-to:message-id; bh=RspjhghubkIVz1IW8mIHwCxv3DAQkIkubVrInTWcCNQ=; b=SbjVaJQkfMz0z3QnAvh3dw0LvES1DRCW/rd4gCV9hsIwFki1Q8Rrz3FEFRmwzM3Hqq c8GrbUj50k9VEGghQZBwMqaRT31Z4cmIf8PwWDB67GiJms3I1/6gh7GwGQfei16kA3CP zi6STeHghmI8KL38xeafA1Y7p5ZEZrXYN+OthlKEEqXigU6BNw4kGnTlAuGoU1FdSexP Wx32AySnpHNTY2FJT4198AVy6CpVo40aMWPJvXbPN508clc7hR1WGRnGzzxxDM26Z6E2 jAaG0Buc0kiY9IHUmiGgRxI0n41l57dIHJWAtJRICu7fX//mTT0eIjFv6f0EAkP9EeA4 /5SA==
X-Gm-Message-State: AOAM532hip3UsZPDhEMJ5948DGKXL28t6jdbOB9oBxQgwskNMIzdKUnX 9OjassFOoIX5X38BSj/VJJPNafBpf1Y=
X-Google-Smtp-Source: ABdhPJxQa7IGEGC3ISI62XEYfSByEy4xgChTuwo6dNdHwWhDXRJg5dI9yNSGRk3nTWBAl+fKW1+V0Q==
X-Received: by 2002:a05:6a00:b95:b0:4fa:ec15:7eb7 with SMTP id g21-20020a056a000b9500b004faec157eb7mr3841pfj.74.1648653605722; Wed, 30 Mar 2022 08:20:05 -0700 (PDT)
Received: from [172.16.0.16] (c-73-170-109-142.hsd1.ca.comcast.net. [73.170.109.142]) by smtp.gmail.com with ESMTPSA id g1-20020a17090adac100b001c67cedd84esm6733096pjx.42.2022.03.30.08.20.05 for <asdf@ietf.org> (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 30 Mar 2022 08:20:05 -0700 (PDT)
From: Michael Koster <michaeljohnkoster@gmail.com>
Content-Type: multipart/alternative; boundary="Apple-Mail=_4607FA74-8E4A-4FDE-AFE2-79E6CCC71FF5"
Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.60.0.2.21\))
Date: Wed, 30 Mar 2022 08:20:03 -0700
References: <F785FFBC-E751-426E-96CC-1601309E759E@gmail.com> <B51007CA-33B6-454D-8477-2DB8DB80EBBD@gmail.com>
To: asdf@ietf.org
In-Reply-To: <B51007CA-33B6-454D-8477-2DB8DB80EBBD@gmail.com>
Message-Id: <A4AE4355-1260-4411-9087-13D68A150474@gmail.com>
X-Mailer: Apple Mail (2.3654.60.0.2.21)
Archived-At: <https://mailarchive.ietf.org/arch/msg/asdf/D6HOdLbIfv7xTrQvuOpwZ6fnX4s>
Subject: Re: [Asdf] Extension point mechanism thoughts
X-BeenThere: asdf@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: "A Semantic Description Format \(SDF\) for Things and their Interactions and Data" <asdf.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/asdf>, <mailto:asdf-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/asdf/>
List-Post: <mailto:asdf@ietf.org>
List-Help: <mailto:asdf-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/asdf>, <mailto:asdf-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 30 Mar 2022 15:20:11 -0000

One more point, the schema extension mechanism provides for the first stage of development for new language features to be deployed in an organized way. 

For example, ext:meta could be the larval stage of a proposal for a built-in category "sdfMeta" in a later version of SDF. 


> On Mar 30, 2022, at 8:08 AM, Michael Koster <michaeljohnkoster@gmail.com> wrote:
> 
> I intended to add another entity to the schema that works in the same way as sdfData and can be applied to any definition, but is intended to provide named metadata items to any definition.
> 
> It'sr a way of adding a category as an extension, rather than a simple quality.
> 
>> On Mar 30, 2022, at 7:51 AM, Michael Koster <michaeljohnkoster@gmail.com <mailto:michaeljohnkoster@gmail.com>> wrote:
>> 
>> If we provide a generalized schema extension mechanism, it should be easy to use it to add a generic extension that applies the dataqualities constraint, and reuse that to provide a more developer-friendly interface that doesn't require the developer to add schema extensions for the simple use case of adding custom metadata to definitions.
>> 
>> extensionNamespace: { ext:" https://example.com/sdfextension <https://example.com/sdfextension>" }
>> 
>> at https://example.com/sdfextension <https://example.com/sdfextension> we define a schema extension that adds the "meta" quality to commonqualities and applies the existing dataqualities constraint to items that are defined by the new extension ( here in jso language but could also be cddl ):
>> 
> should say category, not quality, and it needs to be added to thingqualities, objectqualities, proertyqualities, actionqualities, and eventqualities
>> {
>>   id: https://example.com/sdfextension <https://example.com/sdfextension> 
>>   schemaextension: ...sdfSchema/commonqualities: { additionalProperties: meta: { $ref:dataqualities } }
>> }
>> 
>> 
>> now we can use ext:meta when we want to attach custom metadata to a definition
>> 
>> sdfThing:
>> 
>>   ObjectTemplate:
>>     ...
>>     ext:meta:
>>       TypeID: 
>>         type: integer
>>         minimum: 0
>>         maximum: 65535
>>       InstanceID:
>>         type: integer
>>         minimum: 0
>>         maximum: 65535
>>     # resources, etc.
>>     sdfProperty: {}
>>     sdfThing: {}
>> 
>> 
>>   Timer:
>>     sdfRef: /#/sdfThing/ObjectTemplate
>>     ext:meta:
>>       TypeID: { const: 43000 }
>>       InstanceID: { default: 0 }
>>     # resources, etc.
>> 
>> 
>>   TimerInstance:
>>      sdfRef: /#/sdfThing/Timer
>>     ext:meta:
>>       InstanceID: { const: 1001 }
>>     # resources, etc.
>> 
>> 
>> 
>