Re: [core] SenML JSON syntax (with multiple base objects)
Alexander Pelov <alexander.pelov@telecom-bretagne.eu> Tue, 27 October 2015 20:02 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 6A0621ACEF1 for <core@ietfa.amsl.com>; Tue, 27 Oct 2015 13:02:36 -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 LbOTAm0cjR8W for <core@ietfa.amsl.com>; Tue, 27 Oct 2015 13:02:33 -0700 (PDT)
Received: from zproxy210.enst-bretagne.fr (zproxy210.enst-bretagne.fr [192.108.117.8]) by ietfa.amsl.com (Postfix) with ESMTP id 22A8B1ACEEE for <core@ietf.org>; Tue, 27 Oct 2015 13:02:33 -0700 (PDT)
Received: from localhost (localhost [127.0.0.1]) by zproxy210.enst-bretagne.fr (Postfix) with ESMTP id 35D6123248F; Tue, 27 Oct 2015 21:02:32 +0100 (CET)
Received: from zproxy210.enst-bretagne.fr ([127.0.0.1]) by localhost (zproxy210.enst-bretagne.fr [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id 01cuzaRSklm3; Tue, 27 Oct 2015 21:02:31 +0100 (CET)
Received: from localhost (localhost [127.0.0.1]) by zproxy210.enst-bretagne.fr (Postfix) with ESMTP id F4221232483; Tue, 27 Oct 2015 21:02:30 +0100 (CET)
DKIM-Filter: OpenDKIM Filter v2.9.0 zproxy210.enst-bretagne.fr F4221232483
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telecom-bretagne.eu; s=CFDC2CFA-4654-11E5-AACD-7BCC68B6580D; t=1445976151; bh=T29FWiqhIRR8G9VVzdTV046X33koZNwsA5FS4CrmvAs=; h=Content-Type:Mime-Version:Subject:From:Date:Message-Id:To; b=v68lAu51G2e3US4AYlCOKpOF49sOm4umAqt3Yvk00YCQHpq4w3y8Um5fF0zYaluU8 4MbiiMBCTXOuXNvr5tisPUfIL1VL2JHNY2vyaWDa3mv4VJeG4eNGPC9+9S//dHoGGT siEh1ksIZKvCg+UGewEVslSe4mq/PRGvmVxHPnM0=
X-Virus-Scanned: amavisd-new at zproxy210.enst-bretagne.fr
Received: from zproxy210.enst-bretagne.fr ([127.0.0.1]) by localhost (zproxy210.enst-bretagne.fr [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id F3nQTTLAKS5K; Tue, 27 Oct 2015 21:02:30 +0100 (CET)
Received: from [10.221.2.69] (smb-adpcdg1-01.hotspot.hub-one.net [213.174.99.129]) by zproxy210.enst-bretagne.fr (Postfix) with ESMTPSA id A1839232490; Tue, 27 Oct 2015 21:02:30 +0100 (CET)
Content-Type: multipart/alternative; boundary="Apple-Mail=_318D91B6-62C2-4864-9893-078D4C57567C"
Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\))
From: Alexander Pelov <alexander.pelov@telecom-bretagne.eu>
In-Reply-To: <etPan.562f3207.2001ece.168ed@nar.local>
Date: Tue, 27 Oct 2015 21:02:29 +0100
Message-Id: <1191FB43-D8B3-4535-AA0A-7DB23EAC61A8@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>
To: Carsten Bormann <cabo@tzi.org>
X-Mailer: Apple Mail (2.2104)
Archived-At: <http://mailarchive.ietf.org/arch/msg/core/ok0XqX_ndyPsxPI4CsgAVQUIq88>
Cc: Christian Amsüss <c.amsuess@energyharvesting.at>, core <core@ietf.org>, "draft-jennings-core-senml@tools.ietf.org" <draft-jennings-core-senml@tools.ietf.org>
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 20:02:36 -0000
Dear all, I’m not sure to whether this has been discussed, so please forgive my ignorance on the topic. At one point, we considered the use of Deterministic Multimaps in CoOL. A deterministic multimap, is a map, which can have duplicated key entries, and where the order of the elements is preserved. It seems to me that this structure fits perfectly the need of SenML. Unfortunately, there is no native JSON/CBOR support for deterministic multimaps (DMMs). However, there is an extremely efficient way of representing them with arrays. In fact, it is as efficient, as the native map representation. The representation is the following: [element1, element2, …, elementN] 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). This allows for an efficient encoding of DMM, where the keys can be of any type EXCEPT arrays. In addition, it is fully compatible with JSON and CBOR. In CBOR we could have the luxury of allocating a tag for DMMs. ------------------------------------------------------------------------------------------------------------- Two simple examples: 1) [key1, value1, key2, value2, …, keyN, valueN] Is interpreted as a DMM with the following structure: { key1 : value1, key2 : value2, … keyN : valueN } // note that key1 can be the same as key2, …, keyN, and the order is preserved 2) [key1, value1, key2, value2, [key3, keyA1, valueA1, keyA2, valueA2, [keyA3, keyB1, valueB1, keyB2, valueB2]], …, keyN, valueN] Is interpreted as a DMM with the following structure: { key1 : value1, key2 : value2, key3 : { keyA1 : valueA1, keyA2 : valueA2, keyA3 : { keyB1, valueB1, keyB2, valueB2 } }, … keyN : valueN } ------------------------------------------------------------------------------------------------------------- Best, Alexander > Le 27 oct. 2015 à 09:12, Carsten Bormann <cabo@tzi.org> a écrit : > > Maps (JSON objects) are not fully compatible with streaming processing — you don’t know in which order the map elements will arrive. > So this is OK if the assumption is that each element of the top level array will be fully ingested before acting on it. > (Yes, we already have this problem with the other metadata in the measurements objects.) > > I still like the two-level structure*) that we have been discussing, as it allows processing the elements of the measurements arrays knowing there is no serial dependency between their entries. Might *look* more complicated, but actually is simpler, because the code can focus positionally on either processing base information or on processing measurements. > > Grüße, Carsten > > *) as in [+(base, [+measurement])] > On 27 October 2015 at 07:06:56, Cullen Jennings (fluffy@iii.ca <mailto:fluffy@iii.ca>) wrote: > >> If a base name is found in the the object, it applies to all the values in that object > _______________________________________________ > core mailing list > core@ietf.org <mailto:core@ietf.org> > https://www.ietf.org/mailman/listinfo/core <https://www.ietf.org/mailman/listinfo/core>
- [core] SenML JSON syntax (with multiple base obje… Ari Keränen
- Re: [core] SenML JSON syntax (with multiple base … Michael Koster
- Re: [core] SenML JSON syntax (with multiple base … Carsten Bormann
- Re: [core] SenML JSON syntax (with multiple base … Christian Amsüss
- Re: [core] SenML JSON syntax (with multiple base … Michael Koster
- Re: [core] SenML JSON syntax (with multiple base … Cullen Jennings
- Re: [core] SenML JSON syntax (with multiple base … Carsten Bormann
- Re: [core] SenML JSON syntax (with multiple base … Alexander Pelov
- Re: [core] SenML JSON syntax (with multiple base … Carsten Bormann
- Re: [core] SenML JSON syntax (with multiple base … Alexander Pelov