[Asdf] Sensor design pattern thoughts

Michael Koster <michaeljohnkoster@gmail.com> Mon, 03 May 2021 18:39 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 518AA3A1FC8 for <asdf@ietfa.amsl.com>; Mon, 3 May 2021 11:39:17 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-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 7zgK-1P1GVjs for <asdf@ietfa.amsl.com>; Mon, 3 May 2021 11:39:15 -0700 (PDT)
Received: from mail-pl1-x62c.google.com (mail-pl1-x62c.google.com [IPv6:2607:f8b0:4864:20::62c]) (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 D68A53A1FC7 for <asdf@ietf.org>; Mon, 3 May 2021 11:39:15 -0700 (PDT)
Received: by mail-pl1-x62c.google.com with SMTP id s20so3309376plr.13 for <asdf@ietf.org>; Mon, 03 May 2021 11:39:15 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:content-transfer-encoding:mime-version:subject:message-id:date :cc:to; bh=za97FtMORPM0/1kvmE3SHm999h2gRAo8sTgEGZDXUYs=; b=cemVdLyrZ5D8kMRXvZ2vWQ0dju7oxlmXaSmnWVGGxDvcrhqMuzAv4IdCx2dcz57An7 cTHiuI7oZNfzUdstJapbKR++xGnYW8oKHN/xJbzpnbGIo26d8UHfaAmrwrHGrsfxDXmb rZ8Gma0PkoiFWQp4EDueiNiSG9KTdsdo5ysTYc3PJ2dMhq4R5plfrpvaR9JeN1O9yVqd 8GUBOp3HsRWfwWPSvvwdkEvTF78syHqjFmC1zvGz3Yo4t5QYOGqECTwmKUj4AyODVXqE JNaE2qwimOF5g61h0jOWi97A+/8/xYf2daZTqrMD+P1TQ5ZNswrbdaYMAojJLsNhY0zq hKAw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:content-transfer-encoding:mime-version :subject:message-id:date:cc:to; bh=za97FtMORPM0/1kvmE3SHm999h2gRAo8sTgEGZDXUYs=; b=gvjm2PZJ8GJs/HujBpWZYkr1vrLAYGH1/j3BpmAVy5AphK6qw7MIhjuMUUbogrubvC wZGETrYVrp7sDWFQoO5c+3Lx42qRncYf0GJfUnR5Sf2e0HZpH6ZXWh0AZJ69wM43jR/X 7rIzPnzJ7X8FtdYcrCUj5mYP+ZKHx7EwsqpMGlS/DeGsnF9/5Z2WwoKMy06KQM+Y7eMT QNTTSFId0qtoW6rgdAVE20hinmfxXAo5/6w3QxgS9Dj7qmyDVeuR2Pf4QT01PzEiACjF IiwgANj8m6PcsYOHgKs4Q97Y0j/YJqt/XYbmWqR59V9cGyMhIYPiAKxlQs8dSHzBI1km GuCQ==
X-Gm-Message-State: AOAM531Re8JUHdrSNyHqTF1xXFFSS4Hx7cA21igUBLfuC90xA3zChc1i k7yQufS9KEH54dFbL2OiA5lOUP+eyGI=
X-Google-Smtp-Source: ABdhPJy8GxDtWtu6Uy7gcsGxGUOtQkcsMaC5XcoYGB/L/fUATY3ckRwF90efEL0+vpsi9SKOZjDzcQ==
X-Received: by 2002:a17:902:e8d5:b029:e6:cabb:d07 with SMTP id v21-20020a170902e8d5b02900e6cabb0d07mr21523550plg.3.1620067154441; Mon, 03 May 2021 11:39:14 -0700 (PDT)
Received: from [172.16.0.8] (c-71-202-145-92.hsd1.ca.comcast.net. [71.202.145.92]) by smtp.gmail.com with ESMTPSA id r32sm267280pgm.49.2021.05.03.11.39.13 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 May 2021 11:39:13 -0700 (PDT)
From: Michael Koster <michaeljohnkoster@gmail.com>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.60.0.2.21\))
Message-Id: <B84C6B80-3AD2-44FF-8025-9031171B6A20@gmail.com>
Date: Mon, 03 May 2021 11:39:11 -0700
Cc: asdf@ietf.org
To: One Data Model Group <onedm@iotliaison.org>
X-Mailer: Apple Mail (2.3654.60.0.2.21)
Archived-At: <https://mailarchive.ietf.org/arch/msg/asdf/c7_eKH4iusm6N_oTo_jwNpE0Ngw>
Subject: [Asdf] Sensor design pattern 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: Mon, 03 May 2021 18:39:17 -0000

Hi,

Here are some follow-on thoughts from today's OneDM discussion about sensor modeling and sensor types, quantities, and units.

asdf cc'd for interest 

I think, to some extent, the ambiguity around handling quantities and units comes from multiple sources:

- We don't have a good system model

In the general sense, the system model is underspecified. We are modeling systems of interconnected devices, not physical systems with devices installed at well-defined instrumentation and control points. We might compensate by building more into the models, based on assumptions of autonomy and agency in the system, both computational agency as well as descriptive/configuration agency. We assume that devices need to be able to discover each other and interoperate autonomously. We see system intermediaries as a sign of architectural weakness, and somehow extend that to external system models.

So the models end up embodying some of what might be system level information, and the boundary is unclear. Ideally the model organization would support the pattern found in the O&M ontology, roughly:

Physical feature (FoI) <--> measurement situation (sensing element) <--> sensing process (logial affordances, q+u, scale) <--> communication system (device and network) <--> application logic

I used to think we could bypass a lot of this for "simple IoT devices", but I'm beginning to see the advantage of decoupling the relationships in the modeling to make it easier for those who just want simple devices. In OneDM we model the logical affordances. We might consider scales, quantities, and units to be part of instance bindings, especially as these can easily be converted and adapted.

- It's not clear where the product/instance constraints and customization is introduced.

Does an IPSO Smart Object model represent a device or a function block? Well, obviously it's a function block. Hmm but it seems to encapsulate a lot of the system features like specialization around a particular measurement quantity. For example, an industrial temperature transmitter is a specific product that contains some specialized sensing element with common configuration, processing, and communication. Most of the product is interchangeable and only gets the specialization when it's assembled.

Our models are similar. Having units and range information allows customization, and we define a "Temperature Sensor" as an object type. What is the particular tradeoff being made here? Temperature sensor in many ways seems more like a composed type than a building block. Temperature sensing seems to be a specialization that may add some unique qualities but for the most part only sets the quantities, units, and range.

A good counterpoint is concentration sensing in mixtures. There are only a few units (mol/mol, ppm...), but many potential components (CO, CO2, O2, methane, total HC, and so on). Here is seems to make sense to define a concentration sensor and provide a category enum for what material is being sensed.

Maybe it would make sense to move some specialization to the sdfThing layer as a practice, and think about maximum reuse of object definitions. What if we had generic sensing building blocks and a good type system for quantities and units that can become part of a system model and device models. Then we can assemble product descriptions for things on the shelf, as well as measurement descriptions that are agnostic to the product or device being used.

Maybe there will be interoperability levels, with conformance to the more abstract object building blocks (affordances) on a fundamental level, and constrained object/thing definitions (units, quantities, etc.) working on a more practical level. 

Best regards,

Michael