Re: [netmod] Working Group Last Call: Mapping YANG to Document Schema Definition Languages and Validating NETCONF Content
Ladislav Lhotka <lhotka@cesnet.cz> Wed, 14 April 2010 09:04 UTC
Return-Path: <lhotka@cesnet.cz>
X-Original-To: netmod@core3.amsl.com
Delivered-To: netmod@core3.amsl.com
Received: from localhost (localhost [127.0.0.1]) by core3.amsl.com (Postfix) with ESMTP id EC80F3A69ED for <netmod@core3.amsl.com>; Wed, 14 Apr 2010 02:04:18 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: 0.756
X-Spam-Level:
X-Spam-Status: No, score=0.756 tagged_above=-999 required=5 tests=[AWL=-1.794, BAYES_50=0.001, HELO_EQ_CZ=0.445, HOST_EQ_CZ=0.904, J_CHICKENPOX_33=0.6, J_CHICKENPOX_34=0.6]
Received: from mail.ietf.org ([64.170.98.32]) by localhost (core3.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 6HzI+1SZ1KD8 for <netmod@core3.amsl.com>; Wed, 14 Apr 2010 02:04:17 -0700 (PDT)
Received: from office2.cesnet.cz (office2.cesnet.cz [195.113.144.244]) by core3.amsl.com (Postfix) with ESMTP id CF71C3A69F2 for <netmod@ietf.org>; Wed, 14 Apr 2010 02:04:12 -0700 (PDT)
Received: from [172.29.2.201] (asus-gx.lhotka.cesnet.cz [195.113.161.161]) by office2.cesnet.cz (Postfix) with ESMTPSA id 599C82CDE059; Wed, 14 Apr 2010 11:04:05 +0200 (CEST)
From: Ladislav Lhotka <lhotka@cesnet.cz>
To: Martin Bjorklund <mbj@tail-f.com>
In-Reply-To: <20100413.235323.121809708.mbj@tail-f.com>
References: <201003161108.38711.david.partain@ericsson.com> <1270802680.6878.13.camel@missotis> <20100413.235323.121809708.mbj@tail-f.com>
Content-Type: text/plain; charset="UTF-8"
Organization: CESNET
Date: Wed, 14 Apr 2010 11:04:04 +0200
Message-ID: <1271235844.21600.179.camel@missotis>
Mime-Version: 1.0
X-Mailer: Evolution 2.28.1
Content-Transfer-Encoding: 8bit
Cc: netmod@ietf.org
Subject: Re: [netmod] Working Group Last Call: Mapping YANG to Document Schema Definition Languages and Validating NETCONF Content
X-BeenThere: netmod@ietf.org
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: NETMOD WG list <netmod.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/listinfo/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: Wed, 14 Apr 2010 09:04:19 -0000
Hi Martin, thanks for the review, please see comments below. Lada Martin Bjorklund píše v Út 13. 04. 2010 v 23:53 +0200: > ------------------------------------------------------------ > > Section 1. > > accompanying rules for how to model configuration and status > > s/status/state/ Fixed. > > information (in XML syntax) carried by NETCONF. The IETF Operations > > s/(in XML syntax)// Removed. > > ------------------------------------------------------------ > > Section 2. > > I think you should list all the terms you import, with references. No > need to copy & paste their meaning though. For example, if I didn't > know that the term "information set" is defined in [XML] - > checking... - hmm, it wasn't defined there... I think you also need a > reference to xml-infoset. I'll try to list all terms that are not generally known - you probably don't mean terms like "XML element" here. > > ------------------------------------------------------------ > > Section 2. > > "nmf" NETMOD-specific XPath extension functions (see Section 12.6); > > Bad reference to 12.6? Should you have a separate section where you > define the NETMOD-specific XPath extensions? Actually, the reference to 12.6 is all right - that section describes the only XPath extension used in the draft - nmf:evaluate(). I am not sure about the usefulness of a separate section, if there is only one function so far. > > ------------------------------------------------------------ > > Section 2.1. > > o ancestor datatype: Any datytype a given datatype is (transitively) > derived from. > > s/datytype/datatype/ Fixed. > > ------------------------------------------------------------ > > Section 2.1. > > o conceptual data tree: A virtual XML document integrating all > components of a YANG data model, i.e., configuration datastore, > RPC methods (both requests and replies) and notifications. > > s/RPC method/RPC operation/g -- note the 'g' > > and in some cases s/RPC/RPC operation/g Changed all to "RPC operation". I assume that "RPC request" and "RPC reply" is OK. > > You use the terms "conceptual data tree", "conceptual tree schema" and > "conceptual tree" in many places in the document. Are they the same? > If so, stick to one, if not, please defined the other meanings. "conceptual data tree" == "conceptual tree" I agree that this terminology is rather confusing, also because the terms "data tree" and "conceptual" are used in the YANG draft. The idea is as follows: Conceptual tree is an XML instance document such as the one shown in sec. 8.1., and conceptual tree schema is the annotated RELAX NG schema for this instance document. However, the conceptual tree (instance) is not interesting by itself. In fact, the only role of the extra elements with "nmt" prefix is to produce a RELAX NG pattern that demarcates the corresponding part in the conceptual tree schema. For example, to extract the schema for a datastore from the conceptual tree schema, one has to take the subtree of <rng:element name="nmt:top">. As an alternative, I was considering to use special markers directly in the RELAX NG schema for combining the schemas for the datastore, RPCs and notifications in one document. The advantage of the present approach is that the conceptual tree schema as a whole is still a valid RELAX NG schema. I'd appreciate any ideas how to make this setup more straightforward and the description less complex. > > > ------------------------------------------------------------ > > Section 2.1. > > The conceptual tree is normally not instantiated, it only serves as a > conceptual target for its schema. > > I do not understand this. The definition seems recursive. See above. > > ------------------------------------------------------------ > > Section 3. > > While the mapping from YANG to DSDL described in this document is in > principle invertible, the inverse mapping from DSDL to YANG is not in > its scope. > > > AFAICT the mapping is not 100% invertible. A simple (stupid) example > is > > description "See: foo"; > and > reference "foo"; > > which are both mapped to <a:documention>See foo</a:documentation> > > So I wonder what the sentence about invertible mapping really says. > Is the intention that a YANG to DSDL mapping *could* in principle be > invertible, but this one isn't b/c it is out of scope? Well, coming back to the original YANG module is of course impossible (some groupings are expanded by the mapping, augments are applied etc.). One could possibly think about producing a YANG module that is equivalent in the sense that the data model is the same. But I guess it's appropriate to remove this remark completely because the inverse mapping is really out of scope and nobody is interested in it (anymore). > > > ------------------------------------------------------------ > > Section 3. > > To this end, the complexity of the mapping is > distributed into two steps: > > and then you list 3 steps 1-3...? I can only see two steps numbered 1 and 2, what do you mean? > > > ------------------------------------------------------------ > > Section 7. > > 1. The XML instance document can be immediately checked for > grammatical and data type validity using the RELAX NG schema. > > What does "immediately checked" mean? I changed it to "The instance document is checked for ..." > > What does "the RELAX NG schema" refer to? Is it the output from the > first step or the second step? I suggest you use two distinct terms > for these schemas. Right, one RELAX NG schema is the "conceptual tree schema", which is the result of the first mapping step, and the second step then produces a RELAX NG schema for a concrete target instance document. I have to make sure this distinction is clear. > > > ------------------------------------------------------------ > > Section 8.1 > > <nmt:top> > ... configuration and status data ... > > s/status/state/ Fixed. > > ------------------------------------------------------------ > > Section 8.1 > > </nmt:top> > <nmt:rpc-methods> > <nmt:rpc-method> > > Should these be nmt:rpcs and nmt:rpc, to align with YANG? OK, I can change it as you suggest. > > ------------------------------------------------------------ > > Section 8.1. > > In general, these > transformations should be relatively simple - they will typically > > s/should be/are/ ? The simplicity of course also depends on the tools used for the task. So how about "The goal was to make these transformations relatively straightforward - ..."? > > > ------------------------------------------------------------ > > Section 9. > > The > output RELAX NG schema will then contain only named pattern > definitions translated from YANG groupings and typedefs. > > This is somewhat confusing. So far, I thought that the conceptual > tree also contained typedefs and groupings. But this text tells me No the conceptual tree (the instance) only contains elements coming from groupings that are used in the input YANG modules. For modules like ietf-inet-types, the conceptual tree is essentially empty - only contains the top-level "nmt:*" elements. > that is not the case. I think the handling of typedefs and groupings > should be mentioned in 8.1 where it says: > > The schema for the conceptual tree - a single RELAX NG schema with > annotations - therefore has a quite similar logic as the input YANG > module(s), the only major difference being the RELAX NG schema > language. The conceptual tree _schema_ does contain the definitions that are really used. > > > ------------------------------------------------------------ > > Section 9.2. > > s/underline/underscore/ Fixed. > > > ------------------------------------------------------------ > > Section 9.3. > > Translation rule 2 means for example that absolute XPath expressions > appearing in the main configuration data tree always start with "nmt: > netmod-tree/nmt:top/", those appearing in a notification always start > with "nmt:netmod-tree/nmt:notifications/nmt:notification/", etc. > > Should this be "/nmt:netmod-tree/..." ? Yes, but in fact the rule 2 also looks like an unnecessary complication. In the second step, the top-level parts of the XPath expressions have to be adjusted anyway to reflect the target instance document type - for instance, they would become "/nc:rpc-reply/nc:data". In the meantime, I also realized that for XPath expressions appearing inside groupings the first part is actually variable as the same grouping can be used both in the data and in an RPC. So I have to take these cases into account. > > > ------------------------------------------------------------ > > Section 10. > > I cannot see where the conceptual tree is actually defined. There is > one example in 8.1 which shows the netmod-tree top-level container and > its children, but no specification. The description is in the second paragraph of sec. 8.1, although probably insufficient - see above. > > Hmm, section 11 does this for substatements, but it doesn't define the > top-level structure. Shouldn't chapter 11 go before this chapter? Sections 6-8 try to explain the big picture whereas sec. 11 gives a detailed specification of how the individual YANG statements are mapped. I think this order is essentially correct. > > > ------------------------------------------------------------ > > Section 10. > > multiple types) that is to be validated. These document type can be, > > s/type can/types can/ or s/These/the/ "These document types can ..." > > ------------------------------------------------------------ > > Section 10.2. > > The value of the mandatory @context attribute of <sch:rule> (denoted > as XELEM) MUST be set to the absolute path of the context element in > the data tree. > > Is this term "data tree" really "conceptual data tree", or did you > mean "data tree" as defined in YANG? (same for other occurances of > this term). None of them, probably "target instance document" is appropriate here. In the following example, the context value is "/nc:rpc-reply/nc:data/dhcp:dhcp/dhcp:default-lease-time". How would you call it? > > > ------------------------------------------------------------ > > Section 10.2.1. > > For > example, a candidate configuration referring to configuration > parameters or state data of certain hardware will not pass full > validation before the hardware is installed. > > This is a somewhat controversial example. config data cannot refer to > state data. Pick a simpler example, e.g. all leafreaf referential > intergrity tests have to be true in a candidate configuration. OK. Actually, YANG defines validity only as full validity including the referential integrity, so I am thinking about removing this phases stuff from Schematron as well. Any opinions? > > > ------------------------------------------------------------ > > Section 10.4. > > <dsrl:element-map> > <dsrl:parent>XPARENT</dsrl:parent> > <dsrl:name>ELEM</dsrl:name> > <dsrl:default-content>DEFCONT</dsrl:default-content> > </dsrl:element-map> > > Picky: indentation. > Fixed. > > ------------------------------------------------------------ > > Section 10.4. > > The <rng:element>, <rng:group> or <rng:interleave>patterns appearing > > Picky: s/>p/> p/ Fixed. > > > I do not know DSDL enough to have any comments on the contents of > chapter 11 and 12. > > I have not reviewed the Appendices. > > > /martin -- Ladislav Lhotka, CESNET PGP Key ID: E74E8C0C
- [netmod] Working Group Last Call: Mapping YANG to… David Partain
- Re: [netmod] Working Group Last Call: Mapping YAN… Ladislav Lhotka
- Re: [netmod] Working Group Last Call: Mapping YAN… Martin Bjorklund
- Re: [netmod] Working Group Last Call: Mapping YAN… Ladislav Lhotka
- Re: [netmod] Working Group Last Call: Mapping YAN… Martin Bjorklund
- Re: [netmod] Working Group Last Call: Mapping YAN… Ladislav Lhotka
- Re: [netmod] Working Group Last Call: Mapping YAN… Martin Bjorklund