Re: [core] SenML JSON syntax (with multiple base objects)

Alexander Pelov <alexander.pelov@telecom-bretagne.eu> Tue, 27 October 2015 21:41 UTC

Return-Path: <alexander.pelov@telecom-bretagne.eu>
X-Original-To: core@ietfa.amsl.com
Delivered-To: core@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 927391AD355 for <core@ietfa.amsl.com>; Tue, 27 Oct 2015 14:41:13 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -3.95
X-Spam-Level:
X-Spam-Status: No, score=-3.95 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HELO_EQ_FR=0.35, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001] autolearn=ham
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 GajZ8FjG_2LI for <core@ietfa.amsl.com>; Tue, 27 Oct 2015 14:41:12 -0700 (PDT)
Received: from zproxy220.enst-bretagne.fr (zproxy220.enst-bretagne.fr [192.108.117.9]) by ietfa.amsl.com (Postfix) with ESMTP id B36B41AD34C for <core@ietf.org>; Tue, 27 Oct 2015 14:41:11 -0700 (PDT)
Received: from localhost (localhost [127.0.0.1]) by zproxy220.enst-bretagne.fr (Postfix) with ESMTP id C590630282; Tue, 27 Oct 2015 22:41:10 +0100 (CET)
Received: from zproxy220.enst-bretagne.fr ([127.0.0.1]) by localhost (zproxy220.enst-bretagne.fr [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id 82UxqLpeEJm9; Tue, 27 Oct 2015 22:41:10 +0100 (CET)
Received: from localhost (localhost [127.0.0.1]) by zproxy220.enst-bretagne.fr (Postfix) with ESMTP id 05B663028A; Tue, 27 Oct 2015 22:41:10 +0100 (CET)
DKIM-Filter: OpenDKIM Filter v2.9.0 zproxy220.enst-bretagne.fr 05B663028A
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telecom-bretagne.eu; s=CFDC2CFA-4654-11E5-AACD-7BCC68B6580D; t=1445982070; bh=86LxzHG6sG46C5BQB0twOr7KNgAfux1D5s+UNiLYZZ8=; h=Content-Type:Mime-Version:Subject:From:Date:Message-Id:To; b=b63llAqzShm172kMXC4t5NTjO0KUUlQn8bRYFBKDJvvlzyPdolWgQTPtxzurwst8q 26MW2iWwvSpsvj6rT80LBjfoXBZGKxWYYqiaMALfq8hLX9z52sCRCZ3wSCRPoRpNhj jt6Qr3W1yJIpgsL6bCCeKhhA+wloYbYJ2fvzAPMU=
X-Virus-Scanned: amavisd-new at zproxy220.enst-bretagne.fr
Received: from zproxy220.enst-bretagne.fr ([127.0.0.1]) by localhost (zproxy220.enst-bretagne.fr [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 0gaB669Za7ty; Tue, 27 Oct 2015 22:41:09 +0100 (CET)
Received: from [10.221.2.68] (smb-adpcdg1-01.hotspot.hub-one.net [213.174.99.129]) by zproxy220.enst-bretagne.fr (Postfix) with ESMTPSA id 9DC9530282; Tue, 27 Oct 2015 22:41:09 +0100 (CET)
Content-Type: multipart/alternative; boundary="Apple-Mail=_7B8AD0D4-E159-43B4-BDBD-4070E3F4200A"
Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\))
From: Alexander Pelov <alexander.pelov@telecom-bretagne.eu>
In-Reply-To: <etPan.562feb29.7756d8aa.168ed@nar.local>
Date: Tue, 27 Oct 2015 22:41:08 +0100
Message-Id: <24329BF5-6F54-4C75-978D-08613150D393@telecom-bretagne.eu>
References: <58C4BBDD-895C-4946-983A-405C6E5B760D@ericsson.com> <DAFB7C72-CF08-438E-B681-10918717A5D5@gmail.com> <20151020184630.GI5451@hephaistos.amsuess.com> <956423E0-BA70-4F4F-B0CD-6423203BC2BD@gmail.com> <3CEB5B46-504F-4F4C-B3B8-294625FAF6EA@iii.ca> <etPan.562f3207.2001ece.168ed@nar.local> <1191FB43-D8B3-4535-AA0A-7DB23EAC61A8@telecom-bretagne.eu> <etPan.562feb29.7756d8aa.168ed@nar.local>
To: Carsten Bormann <cabo@tzi.org>
X-Mailer: Apple Mail (2.2104)
Archived-At: <http://mailarchive.ietf.org/arch/msg/core/e6zI49K6cUUQ65eJn9It8MJgUZM>
Cc: core <core@ietf.org>, "draft-jennings-core-senml@tools.ietf.org" <draft-jennings-core-senml@tools.ietf.org>, Christian Amsüss <c.amsuess@energyharvesting.at>
Subject: Re: [core] SenML JSON syntax (with multiple base objects)
X-BeenThere: core@ietf.org
X-Mailman-Version: 2.1.15
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: Tue, 27 Oct 2015 21:41:13 -0000

> Le 27 oct. 2015 à 22:22, Carsten Bormann <cabo@tzi.org> a écrit :
> 
>> Where, for every element:
> 
>> - if it is NOT an array, it is the key, and the following element is the corresponding value.
>> - if it IS an array, its first element provides the key, and the rest of the array is the value, which is a DMM (processed recursively).
> 
> (Why is the array always a DMM?  Should be just any sequence of values that are in the multimap under the key given.)
> 
> 

Yes, this could be any sequence. I chose to make it specifically an array, as to facilitate the encoding/decoding procedure. I suppose this could be also a map, or other sequence.. As long as there is interest in it.
> Sounds worthy of a CBOR tag.  Do you have this written up?
> 
> 

Yep, I have a draft version (not submitted), called - as you proposed - CBOR Ordered Collection of Pairs (COCOP). 
> (I’d get rid of “deterministic”, I think the thing is just ordered.)
> 
>> This allows for an efficient encoding of DMM, where the keys can be of any type EXCEPT arrays. 
> 
> I don’t understand the last comment.  If the key is an array, say for the multimap equivalent of {“a”: “b”, [1]: [2]}, you could represent it with OMM([“a”, “b”, [[1], [2]]]), where OMM is the tag for ordered multimaps.  Yes, this requires a little care when encoding the keys.  (There are a few other details about the data model semantics that probably need to be written down.)
> 
> 

Actually, you are right. With some care, this case is also handled.
> Grüße, Carsten
> 

Best,
Alexander