Re: [Asdf] Composing sdfThings

Michael Koster <michaeljohnkoster@gmail.com> Wed, 31 March 2021 20:49 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 AE3DE3A36CC for <asdf@ietfa.amsl.com>; Wed, 31 Mar 2021 13:49:30 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.097
X-Spam-Level:
X-Spam-Status: No, score=-2.097 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, RCVD_IN_DNSWL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=unavailable 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 QJ6-ZyzIVipq for <asdf@ietfa.amsl.com>; Wed, 31 Mar 2021 13:49:26 -0700 (PDT)
Received: from mail-pg1-x535.google.com (mail-pg1-x535.google.com [IPv6:2607:f8b0:4864:20::535]) (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 0B5F43A36CB for <asdf@ietf.org>; Wed, 31 Mar 2021 13:49:25 -0700 (PDT)
Received: by mail-pg1-x535.google.com with SMTP id i6so167846pgs.1 for <asdf@ietf.org>; Wed, 31 Mar 2021 13:49:25 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=gfSwLBNhxd68iQItdPCHumlLlKmvpYstnCxUtq74bmo=; b=aVjdaq8T+++OloH0DS85fU6cn+T0MuIuaBDsCaybfMx/V+HPbEE2aq2k5hthEkxX11 ebgF95Zdw3FmCklqOmx5R4QIuPPIXMQikIiVqPEfC52ZZAod+OKusE46fPulVOs5OFAJ S7Xf1jNse8jOxZhy1WJBMWKNp5VhMBhDj37Hg7c0faQQ5mW/g7AeSMtx6FLSvCF0VxaK vgU1S/WjWdGc+yNL5N2lYrDsBeoCH21e2fpSJYTEE8lZW8vwjd2k7SvHdXsSDT//FBig AbpaSKpwYNdZimCw18DXB4NZ2lTa7T/jX73lyMGswJ92TCbCJn4puDFSlUxNzgOpo2ZD FNqg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=gfSwLBNhxd68iQItdPCHumlLlKmvpYstnCxUtq74bmo=; b=JZ5SH6UkoUzCFI39Khtt5i8KJOH231pg9eh5iNsRP0tyKcoto3DvPM9CUANiGfPPlJ zQQSMQmV5ioLB7TMMBULex4+dL7Se2bDiG3yePc22zmUOAtSmGzq5w/qKjdg9qZVOsz0 h0lobQpz4+TBkYW6IuT6KLYK2C8yPdtTS3iYZ1TGK9EH/wFUdDNZ7ZtzXnTKs9FNbQ3d 5gQQSwEUHWYNqAnLpN4aj/xs5D4vK7cGXM/9k+SNcAyVkOQgWmiIRMQi9pj99F2Nufla JnpZizlMwnCv8xKAGFRK2VVIvcAs+oZg+tAYoL7vB94xKTXtMgxnld6UCHmx2jmd4zAi uvyQ==
X-Gm-Message-State: AOAM530jagvDbBo7B9G0mxrE781IntLrvRliW5N8AYdNsoGNnqbOOk/I 2Oh20vTvpkv8huox44W65cZMaE3sAoM=
X-Google-Smtp-Source: ABdhPJy5sIZVc0v9YIRoqLegBELAGcbOY9TH0I2XxhJQXpKGbWrxGZ3fVNbiaOtM57o2OpGvklClqQ==
X-Received: by 2002:aa7:86cf:0:b029:20a:f9d5:da77 with SMTP id h15-20020aa786cf0000b029020af9d5da77mr4632675pfo.16.1617223764723; Wed, 31 Mar 2021 13:49:24 -0700 (PDT)
Received: from [172.16.0.10] (c-71-202-145-92.hsd1.ca.comcast.net. [71.202.145.92]) by smtp.gmail.com with ESMTPSA id t12sm3538236pga.85.2021.03.31.13.49.23 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 31 Mar 2021 13:49:24 -0700 (PDT)
Content-Type: text/plain; charset=utf-8
Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.60.0.2.21\))
From: Michael Koster <michaeljohnkoster@gmail.com>
In-Reply-To: <HE1PR07MB32269680CB56CC9BDEA1DADD857C9@HE1PR07MB3226.eurprd07.prod.outlook.com>
Date: Wed, 31 Mar 2021 13:49:23 -0700
Cc: "asdf@ietf.org" <asdf@ietf.org>, Carsten Bormann <cabo@tzi.org>
Content-Transfer-Encoding: quoted-printable
Message-Id: <FD22BAB0-A6BD-4FDC-B180-514105E7A2BF@gmail.com>
References: <5E1F89D1-0E77-4DE2-B302-12F4AB248EA7@tzi.org> <HE1PR07MB32269680CB56CC9BDEA1DADD857C9@HE1PR07MB3226.eurprd07.prod.outlook.com>
To: =?utf-8?Q?Ari_Ker=C3=A4nen?= <ari.keranen=40ericsson.com@dmarc.ietf.org>
X-Mailer: Apple Mail (2.3654.60.0.2.21)
Archived-At: <https://mailarchive.ietf.org/arch/msg/asdf/7bXMgdWv7BBEt_Hx0N6_nbf9-Qg>
Subject: Re: [Asdf] Composing sdfThings
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, 31 Mar 2021 20:49:31 -0000

This looks a lot like "multiInstance" that we previously had as a quality that applies to objects and things when they are composed.

From the earlier discussion, we noted that multiple instances are not an inherent quality of an object definition, but depend on the context in which the definition is used. (discuss?)

One seeming exception is LWM2M where there is the idea of multi-instance resources (properties), but these are essentially arrays and can be modeled with JSO array. 

In that sense, ithe need for a new pattern comes in when we compose a thing out of objects or other things, and don't want to name them. I would suggest that we may not always want to index them either, and there may be some cases where we simply want a collection.

The statement we can make (whether we index the items or not) is that the items are all identical in terms of qualities and external semantics. 

This makes it problematic to try to make some of them mandatory and not others. A min-max scheme seems most reasonable as a constraint to apply to construction of a composed thing. An sdfThing representing a particular SKU outlet strip will have a fixed number of outlet instances. Maybe we could use min=max to describe a fixed number of instances.

One idea we explored earlier is a multi-instance quality that can take a parameter value. When you want to bound the range, you define minimum and maximum in the model. When you want to specify a fixed number of instances, you use a constant definition.

If we adopt a parameterized scheme, it could account for both indexed and non-indexed use cases. I will see if I can find some examples from the earlier discussion.

Best regards,

Michael


> On Mar 31, 2021, at 11:44 AM, Ari Keränen <ari.keranen=40ericsson.com@dmarc.ietf.org> wrote:
> 
> Here's another strawman, based on Carsten's example, of a potential design with array of sdfObjects:
> https://github.com/one-data-model/exploratory/blob/master/sdfThing/fridgemultifreezer.sdf.json
> 
> It uses new "minItems" and "maxItems" qualities (similar to JSO min/maxItems for array type) to define how many freezer Objects can there be in the Thing.
> 
> This seems like a reasonable design, but there are still open questions like how to address those objects. One option is to use JSON pointer array syntax, e.g., a pointer to the 7th freezer object could look like:
> #/sdfThing/FridgeMulti-freezer/sdfObject/freezer/6
> 
> However, given the definition is not an actual array (it's JSON object with two new qualities), something like additional processing steps on the model would need to be applied before the JSON pointers can be used as such.
> 
> Another question is whether we should have minItems quality or should we use only sdfRequired also here. Unless we want to invent new wildcard syntax for sdfRequired, seems that sdfRequired would need to have separate pointer for each required instance. That could result in excessively large sdfRequired blocks so minItems seems like a reasonable shorthand for that.
> 
> 
> Cheers,
> Ari
> 
> On 29.3.2021, 19.13, "ASDF" <asdf-bounces@ietf.org> wrote:
>> 
>> After today’s OneDM discussion, I put together a quick strawman that shows how to put together a fridge-freezer out of two refrigeration components.
>> 
>> https://github.com/one-data-model/exploratory/blob/master/sdfThing/fridgefreezer.sdf.json
>> 
>> This demonstrate static named composition.
>> It does not show how to do Ari’s use case of numbered composition (an array of sdfThings or sdfObjects in an sdfThing).
>> It also doesn’t demonstrate dynamic composition.
>> 
>> Grüße, Carsten
>> 
> 
> -- 
> ASDF mailing list
> ASDF@ietf.org
> https://www.ietf.org/mailman/listinfo/asdf