[core] core-interfaces: "n" in SenML examples vs SenML spec

chrysn <chrysn@fsfe.org> Fri, 02 August 2013 17:15 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 D7ECE11E80EE for <core@ietfa.amsl.com>; Fri, 2 Aug 2013 10:15:45 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.599
X-Spam-Level:
X-Spam-Status: No, score=-2.599 tagged_above=-999 required=5 tests=[BAYES_00=-2.599]
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 LwdxmBrLX61p for <core@ietfa.amsl.com>; Fri, 2 Aug 2013 10:15:45 -0700 (PDT)
Received: from prometheus.amsuess.com (prometheus.amsuess.com [IPv6:2a01:4f8:190:3064::2]) by ietfa.amsl.com (Postfix) with ESMTP id 1F0FC11E80E7 for <core@ietf.org>; Fri, 2 Aug 2013 10:15:44 -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 71F6D41663 for <core@ietf.org>; Fri, 2 Aug 2013 19:15:43 +0200 (CEST)
Received: from hephaistos.amsuess.com (poseidon-stable [10.13.14.225]) by mail.amsuess.com (Postfix) with SMTP id 035BB4C138 for <core@ietf.org>; Fri, 2 Aug 2013 19:15:41 +0200 (CEST)
Received: (nullmailer pid 4747 invoked by uid 1000); Fri, 02 Aug 2013 17:15:41 -0000
Date: Fri, 02 Aug 2013 19:15:41 +0200
From: chrysn <chrysn@fsfe.org>
To: core@ietf.org
Message-ID: <20130802171541.GK26649@hephaistos.amsuess.com>
References: <20130802170438.GB8183@hephaistos.amsuess.com>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="WuedheRyq6FDfQ9j"
Content-Disposition: inline
In-Reply-To: <20130802170438.GB8183@hephaistos.amsuess.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
Subject: [core] core-interfaces: "n" in SenML examples vs SenML spec
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:15:46 -0000

hello core-interfaces authors,

when researching for the "SenML unit in link format response" post, i
discovered that core-interfaces, in several places, uses the "n"
parameter of SenML in a way that looks reasonable, but contradicts
draft-jennings-senml-10.

particular examples (some lines removed):

>    Req: GET /s
>    Res: 2.05 Content (application/senml+json)
>    {"e":[
>        { "n": "humidity", "v": 80, "u": "%RH" }],
>    }

>    Req: GET /s/humidity (Accept: application/senml+json)
>    Res: 2.05 Content (application/senml+json)
>    {"e":[
>        { "n": "humidity", "v": 80, "u": "%RH" }],
>    }

>    Req: GET /l
>    Res: 2.05 Content (application/senml+json)
>    {"e":[
>       { "n": "/s/humidity", "v": 80, "u": "%RH" }],
>    }

while it is clear from the context that the values "80" are
representations of the /s/humidity resource, the senml spec says:

>    The Name value is concatenated to the Base Name value to get the name
>    of the sensor.  The resulting name needs to uniquely identify and
>    differentiate the sensor from all others.  If the object is a
>    representation resulting from the request of a URI [RFC3986], then in
>    the absence of the Base Name attribute, this URI is used as the
>    default value of Base Name.  Thus in this case the Name field needs
>    to be unique for that URI, for example an index or subresource name
>    of sensors handled by the URI.

concatenation would, in these cases, give the values

> scheme://host/shumidity
> scheme://host/s/humidityhumidity
> scheme://host/l/s/humidity

respectively. even if it was assumed that the concatenation followed the
rules of relative url concatenation (like in hyperlinks, i don't know
where that is defined), the resulting urls would be

> scheme://host/humidity
> scheme://host/s/humidity
> scheme://host/s/humidity

, which is better but still not there yet. (what makes it even more
difficult, we'd have to distinguish between "GET /s/" and "GET /s", of
which i'm not sure how it is mapped to CoAP -- would the former contain
an empty Uri-Path option?)

i kindly ask for clarification.

best regards
chrysn

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