Re: [T2TRG] [Asdf] [One Data Model Group] Representation issues and protocol bindings

Alexander Pelov <a@ackl.io> Mon, 31 August 2020 15:59 UTC

Return-Path: <alexander@ackl.io>
X-Original-To: t2trg@ietfa.amsl.com
Delivered-To: t2trg@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id F1FC43A1740 for <t2trg@ietfa.amsl.com>; Mon, 31 Aug 2020 08:59:55 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.898
X-Spam-Level:
X-Spam-Status: No, score=-1.898 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=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=ackl-io.20150623.gappssmtp.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 G-NWUXq3CVQP for <t2trg@ietfa.amsl.com>; Mon, 31 Aug 2020 08:59:53 -0700 (PDT)
Received: from mail-io1-xd2d.google.com (mail-io1-xd2d.google.com [IPv6:2607:f8b0:4864:20::d2d]) (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 4A1D03A07E0 for <t2trg@irtf.org>; Mon, 31 Aug 2020 08:59:53 -0700 (PDT)
Received: by mail-io1-xd2d.google.com with SMTP id r9so1069179ioa.2 for <t2trg@irtf.org>; Mon, 31 Aug 2020 08:59:53 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ackl-io.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=R9VzFZujhKjsje2t4O41akGXSgt8a5w5IOlfizm+MfU=; b=y2EA76AQSkxcBgqfGmD9GlM0K83bWD7XubjvOxWxxD2WDbi9P/VCRQbjGedOyqwRY1 bYnhwktQdviex4vG73LgKhrB6bTmC+YY75CUsk11QXDbXJCyUPfx2m5LSi7Dyq6DvMqZ MztZ+ihRXQzX1nEvXceIfhL7Qgw2SGVBglWI/EIwlN4GdiBA5p/utquLRZ/cZowCxbAN QMa5MbsHeVQC8/r99Vk4lr1KZk4CONQ9YMSLyMGFp8vLCQASBMViTh3gZ1BdIYCgHKaU 69b8sj0nLRx3N3u2T1JuDLj9KbfTg8TbOkHxCPUQtI+MK3sFfVLBGVLGEWx87TnfYTKF zLMg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=R9VzFZujhKjsje2t4O41akGXSgt8a5w5IOlfizm+MfU=; b=houfAdueRxjIXkbfoFcYTgFa3IAUKdwm4/6LbpKKJf37xJAjhwjMX/EGxSqCIZkPvv XZVKgSYf9Yk70pRa+8S1Z27WmnXudDO2kEaenCXuu9c24UEq3QqpnLTCmalpnapO77aN RT9NbbmRU0WYwFKX5IoesB7hVxyNMmVa+7foery8Hs/ldiZrj2LH3skTm2kooArAlhrl UWx6VQi7ARlMvJewSsbbe3H8fSU4cnTFXLbB5WYhAETL4s0eVqONeU+9rFMzdFrh8cWU FC4btmJtTzgEH0ZitJGpyl/XSNF5fpmprFSRtg4rzMAJXQkkPY6DgNC8vM2DfsnwmJ3v Kk5g==
X-Gm-Message-State: AOAM531EjkSSe62CB+rv+s1y55+QsbSccWpmFy3oXxbKunKuQNXYHU6X +sK5BRBWS+7qOpvdTAMct7FpULirn3HexumADQA2KA==
X-Google-Smtp-Source: ABdhPJxQ04qDheiUK2r+g2vbbXK8MwrAzxdEtq1+fbgPRgMKWCPczHlNpgrmMGJZksfv2q5oY3B5BFpumjhi/1CQY/8=
X-Received: by 2002:a05:6602:2dd2:: with SMTP id l18mr1798934iow.81.1598889592226; Mon, 31 Aug 2020 08:59:52 -0700 (PDT)
MIME-Version: 1.0
References: <2ED86F4F-2926-4FBB-91A7-39F32FE7A970@tzi.org> <MWHPR11MB1838A7BB2F9D868DBF59B962D2510@MWHPR11MB1838.namprd11.prod.outlook.com> <BYAPR18MB2536E401A07C0F5DFF3376B6CE510@BYAPR18MB2536.namprd18.prod.outlook.com>
In-Reply-To: <BYAPR18MB2536E401A07C0F5DFF3376B6CE510@BYAPR18MB2536.namprd18.prod.outlook.com>
From: Alexander Pelov <a@ackl.io>
Date: Mon, 31 Aug 2020 17:58:47 +0200
Message-ID: <CACQW0EqqtaGd41TyXjWKjv730YD=vc8E79HZsFW=GsJ_0D+d+g@mail.gmail.com>
To: Milan Milenkovic <milan@iotsense.com>
Cc: "Wouter van der Beek (wovander)" <wovander@cisco.com>, Carsten Bormann <cabo@tzi.org>, "asdf@ietf.org" <asdf@ietf.org>, One Data Model Group <onedm@iotliaison.org>, "t2trg@irtf.org" <t2trg@irtf.org>
Content-Type: multipart/alternative; boundary="0000000000002e173205ae2e7edd"
Archived-At: <https://mailarchive.ietf.org/arch/msg/t2trg/h4GbG301GBTjVuSpusjNgUVn1VI>
Subject: Re: [T2TRG] [Asdf] [One Data Model Group] Representation issues and protocol bindings
X-BeenThere: t2trg@irtf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: IRTF Thing-to-Thing Research Group <t2trg.irtf.org>
List-Unsubscribe: <https://www.irtf.org/mailman/options/t2trg>, <mailto:t2trg-request@irtf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/t2trg/>
List-Post: <mailto:t2trg@irtf.org>
List-Help: <mailto:t2trg-request@irtf.org?subject=help>
List-Subscribe: <https://www.irtf.org/mailman/listinfo/t2trg>, <mailto:t2trg-request@irtf.org?subject=subscribe>
X-List-Received-Date: Mon, 31 Aug 2020 15:59:56 -0000

Hi Carsten, all,

These are indeed some interesting questions, and I am not sure to
what extent they can be solved in a generic way.

In our work on adding parsing capabilities to YANG files (see
https://tools.ietf.org/html/draft-petrov-t2trg-youpi-01 ) we've done some
of the things you mentioned. For example, in YANG you have the built-in
capability to describe the range of a value, e.g. if it goes from 0-100, or
from 1-255. That of course would solve the first part of your question.

I think that solving the full problem may be a little bit more delicate.
For example, someone just might choose 0-1000, where 0 is max brightness,
which then goes to min brightness at around 950 and then again to maximum
brightness at 1000. Why would anyone do something like this? I think the
question would be mostly - if someone does it, how to handle it graciously.
There may be something like a mapping, two-way function, that first
transforms the crazy thing into a linear graduation, which can then be
handled in a more "understandable" way.

So probably, a combination of the two:
1) having the hypothesis that a variable is "linear", with known MIN/MAX
2) annotating the MIN/MAX values (e.g. 0=off, 255=bright)
2.1) optionally annotation intermediate values (e.g. 10=very dim)
3) having an (optional) transformation function to/from the linear function
used by ASDF (in case the variable is not linear)

Cheers,
Alexander


On Mon, Aug 31, 2020 at 5:22 PM Milan Milenkovic <milan@iotsense.com> wrote:

> Hi Karsten, Wouter et al.
>
> For your example, I was going to suggest the range fraction or % solution
> but Wouter beat me to it.
>
> More importantly, I think we should be pragmatic and aim for the 80%
> solution (which, according to the Pareto principle, may require definition
> of only 20% of use cases ;-).  IMO, luminosity ad brightness are examples
> of a relatively skewed minor use case in a specific domain that is
> consuming disproportionate amounts of time and effort to address and that
> complicates many a solution for what is at best a small benefit.  Such
> things can be tabled, and possibly revisited later, to allow progress on
> solutions for the most common use cases.
>
> Regards,
> Milan Milenkovic, Principal
> IoTsense LLC, www.iotsense.com, +1 650 431-8280
>
> -----Original Message-----
> From: One Data Model Group <onedm@iotliaison.org> On Behalf Of Wouter van
> der Beek (wovander)
> Sent: Monday, August 31, 2020 7:51 AM
> To: Carsten Bormann <cabo@tzi.org>; asdf@ietf.org
> Cc: One Data Model Group <onedm@iotliaison.org>; t2trg@irtf.org
> Subject: RE: [One Data Model Group] [Asdf] Representation issues and
> protocol bindings
>
> Hi Carsten,
>
> I think using JSON as a notation actually helps, It avoids using the more
> precise thus more prescriptive  int32/64/... data types.
> e.g. just Boolean, number and integer as base.
>
> Enum values I hope everyone will start using string value as enum value,
> where the string can have an actual meaning, e.g.
> State = ["stopped, "running", "broken"] instead of [1,2,3] ...
>
> As example I think brightness should be expressed as % in number so that
> one can choose its precision on the wire.
> All examples of 0-254, 0-100, 0..65535 Are ok with me with a specific
> mapping.
> So if one encounters the brightness on system A one should know the actual
> data on the wire so that one can map it to the oneDM model in SDF. If one
> needs to use it on system B, one needs to know how to write the data on the
> wire for System B.
> (note that this only works when everything can be mapped linear, so even
> this simple example is not that simple).
>
> And if there is a need (e.g. origin from an contributing org) we can add
> the more precise int32 as sub type.
> But I think we all experienced that over time resolutions go up, good
> example of this is RGB,  0-255- 8 bits, then 16 bits, 24 bits ...
>
> So I rather would go for the 80% solution, which is already 80% more than
> what is there today.
>
> Kind Regards,
> Wouter
>
> -----Original Message-----
> From: ASDF <asdf-bounces@ietf.org> On Behalf Of Carsten Bormann
> Sent: Monday, August 31, 2020 3:26 PM
> To: asdf@ietf.org
> Cc: One Data Model Group <onedm@iotliaison.org>; t2trg@irtf.org
> Subject: [Asdf] Representation issues and protocol bindings
>
> In today’s OneDM call, Bruce Nordman brought up the issue that, in the
> end, we’ll need concrete representations to talk to devices and use their
> data.
>
> So if we have one ecosystem that uses 0..100 for describing the brightness
> setting for a lamp, another one that uses 0..254 (where 255 means something
> complete different), and a third with 0..65535, what do we do?  (And these
> might also differ whether they describe a emitted light power level or a
> perceptive luminous flux level.)
>
> The underlying problem is that we are abusing data model level description
> techniques (in part borrowed from json-schema.org) to describe
> information models.
> That works reasonably well until we start taking these data model level
> descriptions at face value.  The fact that some converged model uses a
> scale based on the L component of Lu’v’ does not mean that everybody has to
> represent their ecosystem model the same way.
>
> The obvious second problem is that we haven’t tackled a framework for
> describing protocol bindings (which, initially, will mostly be ecosystem
> bindings).  That would be the place where we say how the L component needs
> to mapped to the ecosystem specific concrete representation.  Since that
> mapping, in principle, can have arbitrary complexity, completely covering
> all cases requires Turing-equivalent functionality in a description
> language.  Or we could go for an 80 % solution and then, for the 20 %,
> register mapping components that are more complex in an IANA registry.
>
> Let’s discuss this based on some real-world examples — it is easy to
> construct artificial ones that have more complexity than we actually need.
>
> CCing T2TRG as well because quite a few people there are familiar with the
> problem; maybe we want to have the bulk of the discussion on asdf@ietf.org
> though.
>
> Grüße, Carsten
>
> --
> ASDF mailing list
> ASDF@ietf.org
> https://www.ietf.org/mailman/listinfo/asdf
> --
> ASDF mailing list
> ASDF@ietf.org
> https://www.ietf.org/mailman/listinfo/asdf
>