Re: [Asdf] Composing sdfThings
Michael Koster <michaeljohnkoster@gmail.com> Thu, 01 April 2021 01:25 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 4660D3A0BA0
for <asdf@ietfa.amsl.com>; Wed, 31 Mar 2021 18:25:25 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.096
X-Spam-Level:
X-Spam-Status: No, score=-2.096 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, RCVD_IN_DNSWL_BLOCKED=0.001, SPF_HELO_NONE=0.001,
SPF_PASS=-0.001, URIBL_BLOCKED=0.001] 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 xhGZask4iavn for <asdf@ietfa.amsl.com>;
Wed, 31 Mar 2021 18:25:20 -0700 (PDT)
Received: from mail-pj1-x102d.google.com (mail-pj1-x102d.google.com
[IPv6:2607:f8b0:4864:20::102d])
(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 AD7BC3A0B93
for <asdf@ietf.org>; Wed, 31 Mar 2021 18:25:20 -0700 (PDT)
Received: by mail-pj1-x102d.google.com with SMTP id
kk2-20020a17090b4a02b02900c777aa746fso105333pjb.3
for <asdf@ietf.org>; Wed, 31 Mar 2021 18:25:20 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
h=from:message-id:mime-version:subject:date:in-reply-to:cc:to
:references; bh=OaF2s/wEogSB1Xu2ElTJDCBXodWaKpNFjN0LIsoRvcI=;
b=NjwkaC+ohIUuFfXoLWQr+8jqxSQx1W+aV4po4H/ySHgRKaugrw6BjFFWVtXBi3ppQi
+kiDP+oBRDKNyPhrXqB+2Z0kNyzl20wUiLz4xoPBECn5W6Xct1gyldcdfSAE8YZpJLaV
9YpZWWdqSGcvHbQHACp7roB9v8Q0dsuIRUZ6Gq+BYkdak8OqbGo1yT/koFjQgaMjhpj5
CZ+iynGyW3ND2gzrtLjlWUcdjUUFaYnyaMEeSDBxvw+kRMyQNZQ2nhhW37ZV3KoAow8c
JfUSrEjW9/v3B9DuIMN0QjUfy2kxyQGPOS7M9YynC10gtYsjYx3g7fhGsZSJt+/nO/ez
pOBA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20161025;
h=x-gm-message-state:from:message-id:mime-version:subject:date
:in-reply-to:cc:to:references;
bh=OaF2s/wEogSB1Xu2ElTJDCBXodWaKpNFjN0LIsoRvcI=;
b=rk4uzBB2es4r2fFryyvjeW1g+pWnb0zkOtFP1o2Ace5n6jQ2cDiuLbN95Zq0YCfgGM
//QZWUGVbHLTIRn+/Exxr1uARWSHJ1TikXPfAFcozTQIYPf80kCod3g/axZnQYQC2qet
4GN8xKt+OBDioQCXhlO8wf9WiHpKGYOLYeNGEPX42Kz+mpg/2jVz0/WsftKiOnHgQNOu
o+/NMJo6gJRRQCINAWCUz2rnMy+auwC0FvtWJysv6i+badGbQq5hTcCSZcD87mg0wvVS
jRuhPm/Kb4QWP0tJA/Pay+f+RIWM5BUIWWwLAIBdNanAVM09ftaaXALxnDuKlGJ81H+H
M9Xg==
X-Gm-Message-State: AOAM531q/w8+C4LONAqINcU696Jl+TegInDAP0pa/txLAh4pHCswWbH/
odH7MlexkOIcHThDqOTgbDzfDkqwnnw=
X-Google-Smtp-Source: ABdhPJxPXixBi7SxNC16v6wLo0QvbYTVPsXX4g3V1tCcI7xXONp2QPJ5FZ/oDN+fhF+IivCSGeIRLQ==
X-Received: by 2002:a17:90b:307:: with SMTP id
ay7mr6234192pjb.110.1617240319016;
Wed, 31 Mar 2021 18:25:19 -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 f23sm3438903pfa.85.2021.03.31.18.25.18
(version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
Wed, 31 Mar 2021 18:25:18 -0700 (PDT)
From: Michael Koster <michaeljohnkoster@gmail.com>
Message-Id: <520D5F8F-81C5-4766-AD7D-50288A71A51C@gmail.com>
Content-Type: multipart/alternative;
boundary="Apple-Mail=_739B264B-45D3-44F3-9854-367D568815A9"
Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.60.0.2.21\))
Date: Wed, 31 Mar 2021 18:25:17 -0700
In-Reply-To: <FD22BAB0-A6BD-4FDC-B180-514105E7A2BF@gmail.com>
Cc: "asdf@ietf.org" <asdf@ietf.org>,
Carsten Bormann <cabo@tzi.org>
To: =?utf-8?Q?Ari_Ker=C3=A4nen?= <ari.keranen=40ericsson.com@dmarc.ietf.org>
References: <5E1F89D1-0E77-4DE2-B302-12F4AB248EA7@tzi.org>
<HE1PR07MB32269680CB56CC9BDEA1DADD857C9@HE1PR07MB3226.eurprd07.prod.outlook.com>
<FD22BAB0-A6BD-4FDC-B180-514105E7A2BF@gmail.com>
X-Mailer: Apple Mail (2.3654.60.0.2.21)
Archived-At: <https://mailarchive.ietf.org/arch/msg/asdf/lPmikKBZatLGKSLY7ZcoeTOiDvs>
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: Thu, 01 Apr 2021 01:25:25 -0000
I don't have an example model but I think where we left off was (architecturally) something like this parameterized quality "multiInstance":
{
"namespace": {
"pg": "https://onedm.org/playground"
},
"sdfThing": {
"OutletStripSKU126442775": {
"sdfRef": "#/sdfThing/GenericOutletStrip",
"multiInstance": {
"const": 6
}
},
"GenericOutletStrip": {
"sdfRef": "#/sdfThing/OutletUnit",
"multiInstance": {
"minimum": 1,
"maximum": 20
}
},
"OutletUnit": {
"sdfObject": {
"PowerSwitch": {
"sdfRef": "pg:/#/sdfObject/On_Off_switch"
},
"OvercurrentTrip": {
"sdfRef": "pg:/#/sdfObject/energy.overload"
},
"EnergyUsage": {
"sdfRef": "pg:/#/sdfObject/energy.consumption"
}
}
}
}
}
> On Mar 31, 2021, at 1:49 PM, Michael Koster <michaeljohnkoster@gmail.com> wrote:
>
> 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
>
- [Asdf] Composing sdfThings Carsten Bormann
- Re: [Asdf] Composing sdfThings Ari Keränen
- Re: [Asdf] Composing sdfThings Carsten Bormann
- Re: [Asdf] Composing sdfThings Michael Koster
- Re: [Asdf] Composing sdfThings Michael Koster
- Re: [Asdf] Composing sdfThings Michael Koster