Re: [core] SenML and its use in core-interfaces (follow-up on bn/n URI clarification)

Cullen Jennings <fluffy@iii.ca> Sat, 01 April 2017 15:51 UTC

Return-Path: <fluffy@iii.ca>
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 E9F7612954B for <core@ietfa.amsl.com>; Sat, 1 Apr 2017 08:51:01 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.924
X-Spam-Level:
X-Spam-Status: No, score=-2.924 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DATE_IN_PAST_12_24=1.049, HTML_MESSAGE=0.001, MIME_HTML_ONLY=0.723, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-2.796, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
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 a9wREMSlLuQo for <core@ietfa.amsl.com>; Sat, 1 Apr 2017 08:50:59 -0700 (PDT)
Received: from smtp85.iad3a.emailsrvr.com (smtp85.iad3a.emailsrvr.com [173.203.187.85]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 89E051295DF for <core@ietf.org>; Sat, 1 Apr 2017 08:50:59 -0700 (PDT)
Received: from smtp11.relay.iad3a.emailsrvr.com (localhost [127.0.0.1]) by smtp11.relay.iad3a.emailsrvr.com (SMTP Server) with ESMTP id E3C7953AB; Sat, 1 Apr 2017 11:50:48 -0400 (EDT)
X-Auth-ID: fluffy@iii.ca
Received: by smtp11.relay.iad3a.emailsrvr.com (Authenticated sender: fluffy-AT-iii.ca) with ESMTPSA id 2D9F65357; Sat, 1 Apr 2017 11:50:47 -0400 (EDT)
X-Sender-Id: fluffy@iii.ca
Received: from rtp-vpn4-1944.cisco.com ([UNAVAILABLE]. [173.38.117.86]) (using TLSv1 with cipher DHE-RSA-AES256-SHA) by 0.0.0.0:587 (trex/5.7.12); Sat, 01 Apr 2017 11:50:48 -0400
Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\))
Content-Type: text/html; charset="utf-8"
X-Apple-Base-Url: x-msg://14/
X-Apple-Mail-Remote-Attachments: YES
From: Cullen Jennings <fluffy@iii.ca>
In-Reply-To: <20170324113150.hrxznr44n5zdivud@hephaistos.amsuess.com>
X-Apple-Windows-Friendly: 1
Date: Fri, 31 Mar 2017 19:16:02 -0500
Cc: core <core@ietf.org>
Content-Transfer-Encoding: quoted-printable
Message-Id: <D4C202B1-0E95-44DF-8D0D-EC91C60522C8@iii.ca>
References: <20170324113150.hrxznr44n5zdivud@hephaistos.amsuess.com>
X-Uniform-Type-Identifier: com.apple.mail-draft
To: Christian Amsüss <c.amsuess@energyharvesting.at>
X-Mailer: Apple Mail (2.3124)
Archived-At: <https://mailarchive.ietf.org/arch/msg/core/tt7ufNRuxsk2CmzYpW-hUZruaEk>
Subject: Re: [core] SenML and its use in core-interfaces (follow-up on bn/n URI clarification)
X-BeenThere: core@ietf.org
X-Mailman-Version: 2.1.22
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: <https://mailarchive.ietf.org/arch/browse/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: Sat, 01 Apr 2017 15:51:02 -0000


Might be good to have a short phone call about this. I don't think I understand what problem we are trying to solve.

Most the sensors I am dealing with do not have long term stable DNS names. In fact often IP addressed only and in a non unique address space. 

So the HTTP URL one might be doing a HTTP GET on might look like 


And might return 

[
     {"n":"urn:dev:ow:10e2073a01080063","u":"Cel","v":23.1}
]

Note that one of the key principals of SenML is that the name "must result in a globally unique identifier for the resource." This is a key property and critical to applications that process SenML for analytics , ML etc. 

The above is what I mostly what I was thinking about but I can easily imagine that there might be some cases where the device has a long term stable DNS address. So perhaps we have a light bulb that has the long term stable DNS name http://light22.building3.example.com" class="" rel="nofollow">light22.building3.example.com and has a light and temperature resources 

I can imagine that an HTTP GET on 


returning 

[
{ "bn":"http://light22.building3.example.com_s" class="" rel="nofollow">light22.building3.example.com-s-" }
{"n": "light", "v": 123, "u": "lx"},
{"n:" "temp", "v": 27.2, "u": "degC"}
]

I do not think we should support turning a SenML document where you can only figure out the unique name of the sensor is by looking at information outside the SenML document. 

So with that context ... I thought we had fleshed out a way for the URI approach to work and it was the "bn" indicated effectively the HTTP ref. 

I do not think that 

[{"n": "/s/light", "v": 123, "u": "lx"}] 

is a valid SenML in because the name is not globally unique.  If we added an bh (or h) attribute that looked like 

"n": "light", "v": 123, "u": "lx"}] 

Where the h is the same as the URL in the GET, I can see how we could get that transform to something that might work but is seem more or or less the same as using "n" or "bn". 

So with all that said .... I don't think I am clearly understanding what the problems is we are trying to solve. 

Thanks, Cullen





On Mar 24, 2017, at 6:31 AM, Christian Amsüss <c.amsuess@energyharvesting.at> wrote:

Hello SenML authors, and hello CoRE Interfaces authors,

I'd like to follow up on the IETF96 (Berlin) discussion on using URIs
with SenML after reviewing the mails on the topic and the discussion
footage. The point of the URI concatenation discussion back then was to
allow CoRE Interfaces to do what they are currently doing, being

GET /l/
[{"n": "/s/light", "v": 123, "u": "lx"},
{"n:" "/s/temp", "v": 27.2, "u": "degC"}]

which is supposed to mean the /s/light and /s/temp resources on the
origin server, and not /l//s/light etc. as it will by the SenML spec.


In the Berlin discussion, there was a rough agreement on taking a route
where URI users could use a different attribute to denote their
anchor/href; this would avoid the pitfalls of doing URI concatenation
wrong for people who don't use URIs there anyway.

This has not been fleshed out or at least explored since then AFAICT,
and I'd like to at least see that there is a route of extensions CoRE
interfaces can use if we publish SenML as it is now.

Two questions need answering IMO:

* Do we want to be able to share documents between "URI users" and
 "non-URI users"? In many cases this will be possible; for example,
 batches (as opposed to linked batches as above) would just work with
 the current name building, and thus be usable by non-URI-aware clients
 as well.

* If we want to keep them apart, how would we deal with the requirement
 of having mandatory uniquely identifying names? A linked batch would
 certainly not want to repeat names once in "n" and once in "h"
 notation.


For a strawman proposal, I'd assume the answers are "we want to allow
mixed usership", and "the unique name requirement stays". Then we could
construct an extension like this:

Resolved records have, in addition to their name, a URI name ("href"),
which is optional to use but can be mandated to use in certain
applications (eg. CoRE interfaces). The URI name is formed by doing
RFC3986 relative URI resolution of the "h" property relative to the "bh"
base attribute relative to the requested URI. If the "h" property is
absent on a record, its "n" property provides a default value. If the
"bh" property is absent on the first record, the "bn" property provides
a default value.

This scheme has the properties that

+ Batches (or generally, collections that worked so far) work equally
 well for non-URI and URI users.
+ Representations stay as compact as they are.
+ The CoRE interfaces can refer to the records' URI names and thus be
 sure that users must take the necessary steps to resolve relativities
 correctly, while simpler SenML users arrive at resolved names by
 concatenating.
~ Evaluating the name of, say, linked batch resources still gives a
 unique name. It might or might not be a valid URI, and might or might
 not be dereferncable, but since it's agreed on that a name is not
 necessarily a URI, that's OK. For example, the linked batch of the
 first example would give resolved "n":"coap://host/l//s/light" (or
 even, for other examples, "n":"coap://host/l/http://remote/resource"),
 but that would still be a unique name.
- It doesn't survive representation as Resolved Records. (But are they
 intended to be serialized again at all? How do other extensions cope
 with Resolved Records?)
- It defines properties that would, in actual use, barely (if at all)
 show up. In particular, the CoRE Interfaces examples could stay as
 they are and never use "h"/"bh". If we just dropped the arguments and
 only defined a URI property, we're even worse again in the next point:
- This has a smell of applications defining how to interpret the name,
 which is what Cullen has already argued against in the July thread.

If we can live with the above downsides or those of another form of URI
extension (which might have fewer or others), then I think we can
procede with SenML as it is, otherwise we should either come up with a
better URI story, or need SenML to accomodate such uses.

What do you think?

Best regards
Christian

--
Christian Amsüss                      | Energy Harvesting Solutions GmbH
founder, system architect             | headquarter:
mailto:c.amsuess@energyharvesting.at  | Arbeitergasse 15, A-4400 Steyr
tel:+43-664-97-90-6-39                | http://www.energyharvesting.at/" class="" rel="nofollow">http://www.energyharvesting.at/
                                     | ATU68476614
_______________________________________________
core mailing list
core@ietf.org
https://www.ietf.org/mailman/listinfo/core