Re: [netmod] metadata in JSON

Ladislav Lhotka <lhotka@nic.cz> Tue, 26 August 2014 13:32 UTC

Return-Path: <lhotka@nic.cz>
X-Original-To: netmod@ietfa.amsl.com
Delivered-To: netmod@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 622B01A6FF4 for <netmod@ietfa.amsl.com>; Tue, 26 Aug 2014 06:32:24 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.019
X-Spam-Level:
X-Spam-Status: No, score=-1.019 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_CZ=0.445, HOST_EQ_CZ=0.904, MIME_8BIT_HEADER=0.3, RP_MATCHES_RCVD=-0.668] autolearn=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 uR7ZgCftRpAK for <netmod@ietfa.amsl.com>; Tue, 26 Aug 2014 06:32:23 -0700 (PDT)
Received: from mail.nic.cz (mail.nic.cz [IPv6:2001:1488:800:400::400]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id B00461A6FF2 for <netmod@ietf.org>; Tue, 26 Aug 2014 06:32:22 -0700 (PDT)
Received: from [172.29.2.201] (unknown [77.48.225.7]) by mail.nic.cz (Postfix) with ESMTPSA id 217F413F697; Tue, 26 Aug 2014 15:32:21 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=nic.cz; s=default; t=1409059941; bh=pKpHz2CeJBJvhAv4rdfSDo/G2p6Rzb3E63SxuVNR2uo=; h=Content-Type:Mime-Version:Subject:From:In-Reply-To:Date:Cc: Content-Transfer-Encoding:Message-Id:References:To; b=TdpUeEvAusWKoU+OQLhBE9sEY8+OoSQcnq6V1mL3U4HhsJfoQXCZP8rkVbQYlKYgt 1Z3wYROPorMgqNaWVQm65pzyrm0dPxivX3zRmu+af4ZIdhseJ4KM8fuompv7tg0l6t n0JboDJEfcyRPy6/m5t+1mKZ0o5WufTOOXU1zMpo=
Content-Type: text/plain; charset="windows-1252"
Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\))
From: Ladislav Lhotka <lhotka@nic.cz>
In-Reply-To: <20140826.151955.1338003814359491302.mbj@tail-f.com>
Date: Tue, 26 Aug 2014 15:32:16 +0200
Content-Transfer-Encoding: quoted-printable
Message-Id: <3A525146-145D-42D8-8660-80FF6B159F0F@nic.cz>
References: <5BA7630E-B06F-47B5-9ACD-92D9A3512864@nic.cz> <20140731122200.GC64359@elstar.local> <m2zjer2yga.fsf@nic.cz> <20140826.151955.1338003814359491302.mbj@tail-f.com>
To: Martin Björklund <mbj@tail-f.com>
X-Mailer: Apple Mail (2.1878.6)
X-Virus-Scanned: clamav-milter 0.98.1 at mail
X-Virus-Status: Clean
Archived-At: http://mailarchive.ietf.org/arch/msg/netmod/_h2eMKrbLQbKC7zFIkeaJZREFFE
Cc: netmod@ietf.org
Subject: Re: [netmod] metadata in JSON
X-BeenThere: netmod@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: NETMOD WG list <netmod.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/netmod>, <mailto:netmod-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/netmod/>
List-Post: <mailto:netmod@ietf.org>
List-Help: <mailto:netmod-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/netmod>, <mailto:netmod-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 26 Aug 2014 13:32:24 -0000

On 26 Aug 2014, at 15:19, Martin Bjorklund <mbj@tail-f.com> wrote:

> Ladislav Lhotka <lhotka@nic.cz> wrote:
>> Hi,
>> 
>> I would like to resolve the issue of metadata encoding in JSON, so let
>> me summarize the options we have. There are actually two valid questions:
>> 
>> 1. Does the specification of the mapping of XML attributes in JSON
>>   belong to the yang-json document, and if so, in what form?
>> 
>> Possible answers:
>> 
>> 1.1. No, as YANG doesn't model XML attributes.
>> 1.2. Yes, as normative text.
>> 1.3. Yes, as non-normative text.
> 
> 1.2
> 
>> For 1.2 and 1.3, we have to answer the second question because I assume
>> most XML attributes in use with YANG-modelled data will have
>> non-null namespace:
>> 
>> 2. How do we represent the namespace of an attribute in JSON?
>> 
>> Possible answers, using
>> 
>>  <elem xmlns:x="http://example.com/ns/URI" x:attr="foo">bar</elem>
>> 
>> as an example:
>> 
>> 2.1. Use Clark's notation [1]:
>> 
>>  "elem": "bar",
>>  "@elem": {
>>    "{http://example.com/ns/URI}attr": "foo"
>>  }
>> 
>> 2.2. Associate somehow every attribute with a YANG module, and then use
>>     the same notation as for encoding the namespace of YANG data nodes:
>> 
>>  "elem": "bar",
>>  "@elem": {
>>    "somemodule:attr": "foo"
>>  }
>> 
>> 2.3. Associate somehow the XML namespace URI with a prefix in JSON and
>>     then use the same notation as for XML:
>> 
>>  "elem": "bar",
>>  "@elem": {
>>    "x:attr": "foo"
>>  }
> 
> 2.1
> 
> And I think the text should specify that the usage of this meta data
> must be defined by a specification that uses this mapping.  This means
> that RESTCONF must specify which attributes are supported in RESTCONF,
> and how they are encoded (i.e. if they have a namespace or not).

Hmm, do you mean that the set of attributes allowed in (a given version of) RESTCONF will be fixed and no other attributes can be used? In this case we probably needn’t bother with attribute namespaces at all.

Lada

> 
> 
> /martin
> 
> 
> 
>> 
>> In both 2.2 and 2.3, we need to say what "somehow" actually means. If we
>> accept 1.3, it could I guess involve a certain amount of hand-waving but
>> leaving it completely unanswered IMO makes the whole thing useless.
>> 
>> I personally think that 2.3 would be a step in a wrong direction because
>> the URI-prefix duality was recognized as a serious problem of XML
>> namespaces [2].
>> 
>> Please indicate your preferences or propose something else.
>> 
>> Thanks, Lada
>> 
>> [1] http://tools.ietf.org/html/draft-saintandre-json-namespaces-00
>> [2] http://blog.jclark.com/2010/01/xml-namespaces.html
>> 
>> Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de> writes:
>> 
>>> On Thu, Jul 31, 2014 at 10:49:07AM +0200, Ladislav Lhotka wrote:
>>>> 
>>>> On 31 Jul 2014, at 07:52, Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de> wrote:
>>>> 
>>>>> On Wed, Jul 30, 2014 at 05:53:30PM +0200, Ladislav Lhotka wrote:
>>>>>> 
>>>>>>>>> understand that this makes the solution somewhat incomplete but it
>>>>>>>>> allows us to finish this document now and to move forward.
>>>>>>>> 
>>>>>>>> That is my priority, too.
>>>>>>> 
>>>>>>> Good. So what speaks against saying that if attribute names clash and
>>>>>>> if attributes are scoped by a module name, then the encoding is XYZ?
>>>>>> 
>>>>>> I thought YANG 1.1 was a good opportunity to decide about how to do this scoping, provided that standard attributes are really needed.
>>>>>> 
>>>>> 
>>>>> Lets keep the discussion focused on the JSON document. Are you OK with
>>>>> the proposal to add text that attribute names may be scoped?
>>>> 
>>>> Yes, if there is no other choice. It is unclear what “scoped” means.
>>>> 
>>> 
>>> Scoped by a namespace, such as 'namespace:identifier'.
>>> 
>>> /js
>>> 
>>> -- 
>>> Juergen Schoenwaelder           Jacobs University Bremen gGmbH
>>> Phone: +49 421 200 3587         Campus Ring 1, 28759 Bremen, Germany
>>> Fax:   +49 421 200 3103         <http://www.jacobs-university.de/>
>> 
>> -- 
>> Ladislav Lhotka, CZ.NIC Labs
>> PGP Key ID: E74E8C0C
>> 
>> _______________________________________________
>> netmod mailing list
>> netmod@ietf.org
>> https://www.ietf.org/mailman/listinfo/netmod

--
Ladislav Lhotka, CZ.NIC Labs
PGP Key ID: E74E8C0C