[core] core-interfaces: SenML unit in link format response

chrysn <chrysn@fsfe.org> Fri, 02 August 2013 17:04 UTC

Return-Path: <chrysn@fsfe.org>
X-Original-To: core@ietfa.amsl.com
Delivered-To: core@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 4C73321E80E2 for <core@ietfa.amsl.com>; Fri, 2 Aug 2013 10:04:50 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -0.565
X-Spam-Level:
X-Spam-Status: No, score=-0.565 tagged_above=-999 required=5 tests=[AWL=-1.733, BAYES_20=-0.74, RCVD_ILLEGAL_IP=1.908]
Received: from mail.ietf.org ([12.22.58.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id fZauRrgJMjAU for <core@ietfa.amsl.com>; Fri, 2 Aug 2013 10:04:43 -0700 (PDT)
Received: from prometheus.amsuess.com (prometheus.amsuess.com [5.9.147.112]) by ietfa.amsl.com (Postfix) with ESMTP id A99A011E810F for <core@ietf.org>; Fri, 2 Aug 2013 10:04:42 -0700 (PDT)
Received: from mail.amsuess.com (unknown [IPv6:2001:15c0:6765:1:a800:ff:fe57:ab1e]) by prometheus.amsuess.com (Postfix) with ESMTPS id 8C32C41663 for <core@ietf.org>; Fri, 2 Aug 2013 19:04:39 +0200 (CEST)
Received: from hephaistos.amsuess.com (poseidon-stable [10.13.14.225]) by mail.amsuess.com (Postfix) with SMTP id 70AA94C138 for <core@ietf.org>; Fri, 2 Aug 2013 19:04:38 +0200 (CEST)
Received: (nullmailer pid 4621 invoked by uid 1000); Fri, 02 Aug 2013 17:04:38 -0000
Date: Fri, 02 Aug 2013 19:04:38 +0200
From: chrysn <chrysn@fsfe.org>
To: core@ietf.org
Message-ID: <20130802170438.GB8183@hephaistos.amsuess.com>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="dTy3Mrz/UPE2dbVg"
Content-Disposition: inline
User-Agent: Mutt/1.5.21 (2010-09-15)
Subject: [core] core-interfaces: SenML unit in link format response
X-BeenThere: core@ietf.org
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: "Constrained RESTful Environments \(CoRE\) Working Group list" <core.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/core>, <mailto:core-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/core>
List-Post: <mailto:core@ietf.org>
List-Help: <mailto:core-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/core>, <mailto:core-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 02 Aug 2013 17:04:50 -0000

hello people who are interested in core-interfaces and SenML,

as of implementing a data logger that heavily relies on SenML and
core-interfaces in describing its resources, it occurred to me that most
of SenML can be viewed as a way to collect many resources that reside
under a resource (or, when used as core.[l]b, resources that are
scattered on a server).

for example, the queries

> GET /s/light
< OK text/plain
< 123

> GET /s/temp
< OK text/plain
< 27.2

etc.

can be collected to the single query

> GET /s
< OK text/plain
< {"e":[
<       {"n":"/s/light", "v":123, "u": "lx"},
<       {"n":"/s/temp", "v":27.2, "u": "degC"}
< ]}

. several details of the SenML response (eg. name, value, update time) can be
mapped to HTTP or CoAP resource data (eg. url, resource representation,
max-age, respectively).

apart from time stamps (which are often 0, and if not, the response
might contain more than a single representation), an important piece
SenML information that can't be easily mapped to CoAP or HTTP are the
units.

i'd like to publish the units in /.well-known/core, so that the
information can be used even by clients that only support plain text
requests, or to get the information to clients that will always observe
(and to keep packages small will choose the smallest representation,
text/plain). three approaches come to my mind, in order of decreasing
preference:

* </s/light>;if="core.s";rt="core.unit.lx" -- register in the rt=
  subregistry of core-parameters

* </s/light>;if="core.s";unit="lx" -- register at link-relations

* use mime-type parameters -- would work for http, but would need an
  individual content-format codepoint in coap

which approach do you consider most promising?

best regards
chrysn

-- 
To use raw power is to make yourself infinitely vulnerable to greater powers.
  -- Bene Gesserit axiom