<?xml version="1.0" encoding="US-ASCII"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [

<!ENTITY RFC6020 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.6020.xml">
<!ENTITY RFC7223 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.7223.xml">
<!ENTITY RFC7277 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.7277.xml">
<!ENTITY RFC7950 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.7950.xml">
<!ENTITY I-D.lam-teas-usage-info-model-net-topology SYSTEM "http://xml2rfc.ietf.org/public/rfc/bibxml3/reference.I-D.draft-lam-teas-usage-info-model-net-topology-03.xml">
]>
<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>

<?rfc strict="yes" ?>

<?rfc toc="yes"?>

<?rfc tocdepth="3"?>

<?rfc symrefs="no"?>

<?rfc sortrefs="yes" ?>

<?rfc compact="no" ?>

<?rfc subcompact="no" ?>

<rfc category="info" docName="draft-mansfield-netmod-uml-to-yang-03" ipr="trust200902">

  <front>

    <title abbrev="Guidelines UML to YANG">Guidelines for Translation of UML Information Model to YANG Data Model</title>

   <author fullname="Scott Mansfield" initials="S.M." role="editor"
            surname="Mansfield">
      <organization>Ericsson Inc.</organization>

      <address>
        <postal>
          <street></street>

          <city></city>

          <region></region>

          <code></code>

          <country>USA</country>
        </postal>

        <phone>+1 724 931 9316</phone>

        <email>scott.mansfield@ericsson.com</email>

      </address>
    </author>
   
    <author fullname="Bernd Zeuner" initials="B.Z." 
            surname="Zeuner">
      <organization>Deutsche Telekom AG</organization>

      <address>
        <postal>
          <street>Heinrich-Hertz-Str, 3-7</street>

          <city>Darmstadt</city>

          <region></region>

          <code>64295</code>

          <country>Germany</country>
        </postal>

        <phone>+49 6151 58-12086</phone>

        <email>b.zeuner@telekom.de</email>

      </address>
    </author>
   
   <author fullname="Nigel Davis" initials="N.D." 
            surname="Davis">
      <organization>Ciena</organization>

      <address>
        <postal>
          <street></street>

          <city></city>

          <region></region>

          <code></code>

          <country>United Kingdom</country>
        </postal>

        <phone></phone>

        <email>ndavis@ciena.com</email>

      </address>
    </author>
   
   <author fullname="Yun Xiang" initials="Y.X." 
            surname="Yun">
      <organization>Fiberhome</organization>

      <address>
        <postal>
          <street></street>

          <city></city>

          <region></region>

          <code></code>

          <country>China</country>
        </postal>

        <phone></phone>

        <email>yunxig@fiberhome.com.cn</email>

      </address>
    </author>

   <author fullname="Yuji Tochio" initials="Y.T." 
            surname="Tochio">
      <organization>Fujitsu</organization>

      <address>
        <postal>
          <street></street>

          <city></city>

          <region></region>

          <code></code>

          <country>Japan</country>
        </postal>

        <phone></phone>

        <email>tochio@jp.fujitsu.com</email>

      </address>
    </author>
   
    <author fullname="Hing-Kam Lam" initials="K.L." 
            surname="Lam">
      <organization>Nokia</organization>

      <address>
        <postal>
          <street></street>

          <city></city>

          <region></region>

          <code></code>

          <country>USA</country>
        </postal>

        <phone>+1 732 331 3476</phone>

        <email>kam.lam@nokia.com</email>

      </address>
    </author>
   
   <author fullname="Eve Varma" initials="E.V." 
            surname="Varma">
      <organization>Nokia</organization>

      <address>
        <postal>
          <street></street>

          <city></city>

          <region></region>

          <code></code>

          <country>USA</country>
        </postal>

        <phone></phone>

        <email>eve.varma@nokia.com</email>

      </address>
    </author>
   
    <date month="October" year="2016" />

    <area>Operations and Management</area>

    <workgroup>NETMOD Working Group</workgroup>

    <keyword>UML</keyword>
    <keyword>Information modeling</keyword>

    <abstract>
      <t>This document defines guidelines for translation of data modeled with UML to YANG including mapping of object classes, attributes, data types, associations, interfaces, operations and operation parameters, notifications, and lifecycle.</t>
    </abstract>
  </front>

  <middle>
    <section title="Introduction">
      <t>As discussed in <xref target="I-D.lam-teas-usage-info-model-net-topology">draft-lam-teas-usage-info-model-net-topology</xref> a Data Model (DM) may be derived from an Information Model (IM).  However, in order to assure a consistent and valid data modelling language representation that enables maximum interoperability, translation guidelines are required. A set of translation rules also assists in development of automated tooling.</t>
      <t>This draft defines guidelines for translation of data modelled with <xref target="OMG-UML-2.4">UML</xref> (as constrained by the ONF's <xref target="ONF-TR-514">UML Modeling Guidelines</xref>) to YANG (defined in <xref target="RFC6020">RFC6020</xref> and <xref target="RFC7950">YANG 1.1</xref>) including mapping of object classes, attributes, data types, associations, interfaces, operations and operation parameters, notifications, and lifecycle.</t>
    </section>
      
     <section title="Terminology">
            <t>The following terms are defined in <xref target="RFC6020">RFC6020</xref></t>
     <t><list style="symbols">
             <t>anydata</t>
             <t>anyxml</t>
             <t>augment</t>
             <t>container</t>
             <t>data node</t>
             <t>identity</t>
             <t>instance identifier</t>
             <t>leaf</t>
             <t>leaf-list</t>
             <t>list</t>
             <t>module</t>
             <t>submodule</t>
      </list></t>
         <t>The following terms are defined in <xref target="OMG-UML-2.4">UML 2.4</xref></t>
         <t><list style="symbols">
             <t>association</t>
             <t>attribute</t>
             <t>data type</t>
             <t>interface</t>
             <t>object class</t>
             <t>operation</t>
             <t>parameter</t>
             <t>signal (used to model notifications)</t>
         </list></t>
     </section>
     
     <section title="Overview">
        <t>This document defines translation rules for all constructs used in a UML based IM to a data model using YANG.</t>
         <t>While some mapping rules are straightforward, an IM in UML uses some constructs that cannot be mapped directly to a DM using YANG and conventions are described to make the translation predictable.  Additionally, in some cases multiple mapping approaches are possible and selection among these is also necessary to assure interoperability.</t>
         <t>Mapping guidelines for these constructs are provided in the following sections.</t>
     </section>
     
     <section title="Mapping Guidelines">
    <section title="Mapping Guideline Considerations">
      <t>Where "??" is inserted in the table, it means that the specific mapping is for further study as it is either as yet unclear how to map the construct or that there are multiple ways of doing the mapping and a single one needs to be selected.</t>
      <t>A table will be included summarizing constructs in UML that do not directly map to YANG and where in this draft the associated guidelines for mapping these constructs will be provided.</t>
    </section>
      <section title="Mapping of Object Classes">

<figure anchor="object-class-mapping" title="Mapping of Object Classes">
<preamble></preamble>
<artwork align="left"><![CDATA[
+-------------------------------------------------------------------+
|                           Object Class                            |
| - Real object classes having/inheriting at least one attribute    |
|   identified as "partOfObjectKey" will be mapped to a "list"      |
|   statement                                                       |
| - Real object classes not having/inheriting any attribute         |
|   identified as "partOfObjectKey" will be mapped to a "container" |
|   statement                                                       |
| - Abstract object classes used for inheritance will be mapped     |
|   to a "grouping" statement                                       |
+-------------------------------------------------------------------+
| UML Artifact          | YANG Artifact         | Comment           |
+-------------------------------------------------------------------+
| documentation         | "description"         | Multiple "applied |
| "Applied comments"    | substatement          | comments" defined |
| (carried in XMI as    |                       | in UML, need to be|
|  "ownedComment")      |                       | collapsed into a  |
|                       |                       | single            |
|                       |                       | "description"     |
|                       |                       | substatement.     |
+-------------------------------------------------------------------+
| superclass(es)        | "grouping" statement  | Concrete          |
|                       |                       | superclasses are  |
|                       |                       | then mapped to    |
|                       |                       | container/list    |
|                       |                       | which uses these  |
|                       |                       | groupings.        |
+-------------------------------------------------------------------+
| abstract              | "grouping" statement  | It is possible    |
|                       |                       | that the          |
|                       |                       | superclass or     |
|                       |                       | abstract class    |
|                       |                       | contains the key  |
|                       |                       | attribute for the |
|                       |                       | instantiated      |
|                       |                       | subclass, this    |
|                       |                       | requires the      |
|                       |                       | creation of the   |
|                       |                       | grouping but later|
|                       |                       | when the subclass |
|                       |                       | is instantiated   |
|                       |                       | the key value must|
|                       |                       | be identified from|
|                       |                       | within the        |
|                       |                       | grouping.         |
+-------------------------------------------------------------------+
| object identifier     | list::"key"           | It is possible    |
|                       | substatement          | that the super-   |
| Note: Attributes used |                       | class or abstract |
| as object identifier  |                       | class contains the|
| are defined in UML by |                       | key attribute for |
| the attribute         |                       | the instantiated  |
| property              |                       | subclass.         |
| "partOfObjectKey".    |                       |                   |
+-------------------------------------------------------------------+
| object identifier list|                       | The splitting of a|
|                       |                       | list attribute    |
| Does not appear in the|                       | (marked as key)   |
| UML when mapping to   |                       | into a single key |
| YANG.                 |                       | attribute and an  |
|                       |                       | additional list   |
|                       |                       | attribute will be |
|                       |                       | done in UML during|
|                       |                       | Pruning and       |
|                       |                       | Refactoring.  i.e.|
|                       |                       | The mapping tool  |
|                       |                       | will never get a  |
|                       |                       | list attribute    |
|                       |                       | which is part of  |
|                       |                       | the object        |
|                       |                       | identifier.       |
+-------------------------------------------------------------------+
| objectCreationNotific-| "notification"        | Goes beyond the   |
| ation                 | statement             | simple "a notific-|
| [YES/NO/NA]           |                       | ation has to be   |
|                       |                       | sent": a tool can |
|                       |                       | construct the sig-|
|                       |                       | ature of the noti-|
|                       |                       | cation by reading |
|                       |                       | the created       |
|                       |                       | object.           |
+-------------------------------------------------------------------+
| objectDeletionNotific-| "notification"        | Goes beyond the   |
| ation                 | statement             | simple "a notific-|
| [YES/NO/NA]           |                       | ation has to be   |
|                       |                       | sent": a tool can |
|                       |                       | construct the sig-|
|                       |                       | ature of the noti-|
|                       |                       | cation by reading |
|                       |                       | the deleted       |
|                       |                       | object. (i.e. not |
|                       |                       | necessary to      |
|                       |                       | provide the       |
|                       |                       | attributes of the |
|                       |                       | deleted object).  |
+-------------------------------------------------------------------+
| muliplicity >1 on     | list::"min-elements"  | min-elements      |
| association to the    | "max-elements"        |  default = 0      |
| class                 | substatements         | max-elements      |
|                       |                       |  default=unbounded|
|                       |                       | mandatory         |
|                       |                       |  default=false    |
+-------------------------------------------------------------------+
| <<Reference>>         | "reference"           |                   |
|                       | substatement          |                   |
+-------------------------------------------------------------------+
| <<Example>>           | Ignore Example        |                   |
|                       | elements and all      |                   |
|                       | composed parts        |                   |
+-------------------------------------------------------------------+
| lifecycleState        | "status"              | <<UML>> -> "YANG" |
|                       | substatement          | <<Deprecated>>    |
|                       |                       | "deprecated",     |
|                       |                       | <<Experimental>>  |
|                       |                       | description,      |
|                       |                       | <<Faulty>>        |
|                       |                       | description,      |
|                       |                       |<<LikelyToChange>> |
|                       |                       | description,      |
|                       |                       | <<Mature>>        |
|                       |                       | "current",        |
|                       |                       | <<Obsolete>>      |
|                       |                       | "obsolete",       |
|                       |                       | <<Preliminary>>   |
|                       |                       | description       |
+-------------------------------------------------------------------+
| Proxy Class           | "choice"              |                   |
| XOR                   | substatement          |                   |
+-------------------------------------------------------------------+
| support               | "if-feature"          | Support and       |
|                       | substatement          | condition belong  |
+-----------------------+                       | together. If the  |
| condition             |                       | "support" is cond-|
|                       |                       | itional, then the |
|                       |                       | "condition"       |
|                       |                       | explains the cond-|
|                       |                       | itions under which|
|                       |                       | the class has to  |
|                       |                       | be supported.     |
+-------------------------------------------------------------------+
| operation             | "action"              | YANG 1.0 supports |
|                       | substatement          | only rpc -> add   |
|                       |                       | prefix to the rpc |
|                       |                       | name; i.e.        |
|                       |                       | objectClass::rpc; |
|                       |                       | "action" requires |
|                       |                       | YANG 1.1          |
+-------------------------------------------------------------------+
| Conditional PACs      | container::presence"  |                   |
|                       | substatement          |                   |
+-------------------------------------------------------------------+
| constraint property   | list::"unique"        | UML is not able to|
|                       | substatement          | define a group    |
|                       |                       | of attributes to be
|                       |                       | unique as YANG can|
|                       |                       | do using the      |
|                       |                       | "unique"          |
|                       |                       | substatement.     |
+-------------------------------------------------------------------+
| {<constraint>}        | "when" substatement   |                   |
+-------------------------------------------------------------------+
]]></artwork>
<postamble></postamble>
</figure>

<figure anchor="object-class-mapping-example-abstract" title="Example of Abstract Object Class Mapping (Available in PDF or HTML versions)">
<preamble></preamble>
<artwork src="object-class-mapping-example-abstract.jpg" type="image/jpg">
</artwork>
<postamble></postamble>
</figure>

<figure anchor="object-class-mapping-example-not-abstract" title="Example of Non-Abstract Object Class Mapping (Available in PDF or HTML versions)">
<preamble></preamble>
<artwork src="object-class-mapping-example-not-abstract.jpg" type="image/jpg">
</artwork>
<postamble></postamble>
</figure>

      </section>
   
      <section title="Mapping of Attributes">
<figure anchor="attribute-mapping" title="Mapping of Attributes">
<preamble></preamble>
<artwork align="left"><![CDATA[
+-------------------------------------------------------------------+
|       Attribute --> "leaf" (single) or "leaf list" (multiple)     |
|                        statement                                  |
+-------------------------------------------------------------------+
| UML Artifact          | YANG Artifact         | Comment           |
+-------------------------------------------------------------------+
| documentation         | "description"         | Multiple "applied |
| "Applied comments"    | substatement          | comments" defined |
| (carried in XMI as    |                       | in UML, need to be|
|  "ownedComment")      |                       | collapsed into a  |
|                       |                       | single            |
|                       |                       | "description"     |
|                       |                       | substatement.     |
+-------------------------------------------------------------------+
| type                  | "type" substatement   |                   |
|                       | (built-in or derived) |                   |
+-------------------------------------------------------------------+
| readOnly              | "config" substatement | config            |
|                       | (false)               | default = true    |
+-------------------------------------------------------------------+
| isOrdered             | "ordered-by"          | ordered-by        |
|                       | substatement          | default = system  |
|                       |("system" or "user")   |                   |
+-------------------------------------------------------------------+
| isUnique              | No unique             | Only relevant for |
|                       | sub-statement in      | multi-valued      |
|                       | leaf-list             | attributes.       |
+-------------------------------------------------------------------+
| Multiplicity          | "mandatory" or        | min-elements      |
| (carried in XMI as    | "min-elements" and    |  default = 0      |
| lowerValue and        | "max-elements"        | max-elements      |
| upperValue)           | substatements         |  default=unbounded|
|                       | [0..1]=>no mapping    | mandatory         |
|                       |   needed; is default  |  default=false    |
|                       |   substatement=false  |                   |
|                       | [1]=>mandatory        |                   |
|                       |   substatement=true   |                   |
|                       | [0..x]=> no mapping   |                   |
|                       |   needed; is default  |                   |
|                       | [1..x]=> min-elements |                   |
|                       |   substatement = 1    |                   |
|                       | [0..3]=> max-elements |                   |
|                       |   substatement = 3    |                   |
+-------------------------------------------------------------------+
| defaultValue          | "default"             | If a default value|
|                       | substatement          | exists and it is  |
|                       |                       | the desired value,|
|                       |                       | the parameter does|
|                       |                       | not have to be    |
|                       |                       | explicitly config-|
|                       |                       | ured by the user. |
+-------------------------------------------------------------------+
| isInvariant           | "extension"           |                   |
|                       | substatement ->       |                   |
|                       | ompExt:isInvariant    |                   |
+-------------------------------------------------------------------+
| valueRange            | For string type:      | The tool should   |
|                       |   "pattern" and/or    | provide a warning |
|                       |   "length substatement| at the output of  |
|                       | of "type" substatement| mapping process   |
|                       | For integer and       | notifying when one|
|                       |     decimal type:     | or more UML       |
|                       |   "range" substatement| valueRange        |
|                       | of "type" substatement| definitions are   |
|                       | For all other typed   | contained in the  |
|                       | attributes and for    | description       |
|                       | string or integer or  | substatement of   |
|                       | decimal typed         | the corresponding |
|                       | attributes where the  | leaf or leaf-list.|
|                       | UML definition is not | When the value of |
|                       | compliant to YANG:    | "valueRange" is   |
|                       | "description"         | "null", "NA",     |
|                       | substatement          | "See data type",  |
|                       |                       | the tool ignores  |
|                       |                       | it and doesn't    |
|                       |                       | print out "range" |
|                       |                       | substatement.     |
+-------------------------------------------------------------------+
| passedByReference     | if passedByReference =| Relevant only to  |
|                       | true -> type leafref {| attributes that   |
|                       | path "/<object>/      | have an object    |
|                       | <objectidentifier>"}  | class defined as  |
|                       |                       | their type.       |
|                       | if passedByReference =|                   |
|                       | false -> either "list"|                   |
|                       | statement (key        |                   |
|                       | property, multiple    |                   |
|                       | instances) or         |                   |
|                       | "container" statement(|                   |
|                       | single instance)      |                   |
+-------------------------------------------------------------------+
| partOfObjectKey > 0   | list::"key"           | It is possible that
|                       | substatement          | the (abstract)    |
|                       |                       | superclass contains
|                       |                       | the key attribute |
|                       |                       | for the           |
|                       |                       | instantiated      |
|                       |                       | subclass.         |
+-------------------------------------------------------------------+
| unit                  | "units" substatement  |                   |
+-------------------------------------------------------------------+
| <<Reference>>         | "reference"           |                   |
|                       | substatement          |                   |
+-------------------------------------------------------------------+
| <<Example>>           | Ignore Example        |                   |
|                       | elements and all      |                   |
|                       | composed parts        |                   |
+-------------------------------------------------------------------+
| lifecycleState        | "status"              | <<UML>> -> "YANG" |
|                       | substatement          | <<Deprecated>>    |
|                       |                       | "deprecated",     |
|                       |                       | <<Experimental>>  |
|                       |                       | description,      |
|                       |                       | <<Faulty>>        |
|                       |                       | description,      |
|                       |                       |<<LikelyToChange>> |
|                       |                       | description,      |
|                       |                       | <<Mature>>        |
|                       |                       | "current",        |
|                       |                       | <<Obsolete>>      |
|                       |                       | "obsolete",       |
|                       |                       | <<Preliminary>>   |
|                       |                       | description       |
+-------------------------------------------------------------------+
| support               | For conditional       | Support and       |
|                       | support only:         | condition belong  |
+-----------------------+                       | together. If the  |
| condition             | "if-feature"          | "support" is cond-|
|                       | substatement          | itional, then the |
|                       |                       | "condition"       |
|                       | "when" substatement if| explains the cond-|
|                       | condition can be      | itions under which|
|                       | formalized as XPath   | the class has to  |
|                       | expression (i.e., it  | be supported.     |
|                       | is conditioned by the |                   |
|                       | value of another      |                   |
|                       | attribute)            |                   |
+-------------------------------------------------------------------+
| error notfication??   | "must"                |                   |
|                       | substatement          |                   |
+-------------------------------------------------------------------+
| {<constraint>}        | "when" substatement   |                   |
+-------------------------------------------------------------------+
]]></artwork>
<postamble></postamble>
</figure>

<figure anchor="attribute-mapping-example" title="Example of Attribute Mapping (Available in PDF or HTML versions)">
<preamble></preamble>
<artwork src="attribute-mapping-example.jpg" type="image/jpg">
</artwork>
<postamble></postamble>
</figure>

      </section>
      
      <section title="Mapping of Types">
<figure anchor="type-mapping" title="Mapping of Types">
<preamble></preamble>
<artwork align="left"><![CDATA[
+-------------------------------------------------------------------+
|                             Types                                 |
+-------------------------------------------------------------------+
| UML Artifact          | YANG Artifact         | Comment           |
+-------------------------------------------------------------------+
| Primitive Type        | Built-In Type if      | e.g., Integer     |
|                       | defined               |                   |
+-------------------------------------------------------------------+
| Complex Data Type     | "grouping" statement  | e.g., date-time   |
|                       |                       |                   |
+-------------------------------------------------------------------+
| Enumeration           | "enum" statement      |                   |
+-------------------------------------------------------------------+
]]></artwork>
<postamble></postamble>
</figure>
      <section title="Mapping of Primitive Types">
<figure anchor="primitive-type-mapping" title="Mapping of Primitive Types">
<preamble></preamble>
<artwork align="left"><![CDATA[
+-------------------------------------------------------------------+
|               Primitive Type -> "typeDef" statement               |
+-------------------------------------------------------------------+
| UML Artifact          | YANG Artifact         | Comment           |
+-------------------------------------------------------------------+
| documentation         | "description"         | Multiple "applied |
| "Applied comments"    | substatement          | comments" defined |
| (carried in XMI as    |                       | in UML, need to be|
|  "ownedComment")      |                       | collapsed into a  |
|                       |                       | single            |
|                       |                       | "description"     |
|                       |                       | substatement.     |
+-------------------------------------------------------------------+
| type                  | "type" substatement   |                   |
|                       | (built-in type or     |                   |
|                       | derived type)         |                   |
+-------------------------------------------------------------------+
| defaultValue          | "default" substatment | If a default value|
|                       |                       | exists and it is  |
|                       |                       | the desired value,|
|                       |                       | the parameter does|
|                       |                       | not have to be    |
|                       |                       | explicitly        |
|                       |                       | configured by the |
|                       |                       | user. When the    |
|                       |                       | value of          |
|                       |                       | "defaultValue" is |
|                       |                       | "NA", the tool    |
|                       |                       | ignores it and    |
|                       |                       | doesn't print out |
|                       |                       | "default"         |
|                       |                       | substatement.     |
+-------------------------------------------------------------------+
| unit                  | "units" substatement  |                   |
+-------------------------------------------------------------------+
| <<Reference>>         | "reference"           |                   |
|                       | substatement          |                   |
+-------------------------------------------------------------------+
| <<Example>>           | Ignore Example        |                   |
|                       | elements and all      |                   |
|                       | composed parts        |                   |
+-------------------------------------------------------------------+
| lifecycleState        | "status"              | <<UML>> -> "YANG" |
|                       | substatement          | <<Deprecated>>    |
|                       |                       | "deprecated",     |
|                       |                       | <<Experimental>>  |
|                       |                       | description,      |
|                       |                       | <<Faulty>>        |
|                       |                       | description,      |
|                       |                       |<<LikelyToChange>> |
|                       |                       | description,      |
|                       |                       | <<Mature>>        |
|                       |                       | "current",        |
|                       |                       | <<Obsolete>>      |
|                       |                       | "obsolete",       |
|                       |                       | <<Preliminary>>   |
|                       |                       | description       |
+-------------------------------------------------------------------+
]]></artwork>
<postamble></postamble>
</figure>
      </section>

      <section title="Mapping of Complex Data Types">
<figure anchor="complex-type-mapping" title="Mapping of Complex Data Types">
<preamble></preamble>
<artwork align="left"><![CDATA[
+-------------------------------------------------------------------+
|               Complex Data Type -> "grouping" statement           |
+-------------------------------------------------------------------+
| UML Artifact          | YANG Artifact         | Comment           |
+-------------------------------------------------------------------+
| documentation         | "description"         | Multiple "applied |
| "Applied comments"    | substatement          | comments" defined |
| (carried in XMI as    |                       | in UML, need to be|
|  "ownedComment")      |                       | collapsed into a  |
|                       |                       | single            |
|                       |                       | "description"     |
|                       |                       | substatement.     |
+-------------------------------------------------------------------+
| not used              | "action" substatement |                   |
+-------------------------------------------------------------------+
| XOR                   | "choice"              |                   |
|                       | substatement          |                   |
+-------------------------------------------------------------------+
| <<Reference>>         | "reference"           |                   |
|                       | substatement          |                   |
+-------------------------------------------------------------------+
| <<Example>>           | Ignore Example        |                   |
|                       | elements and all      |                   |
|                       | composed parts        |                   |
+-------------------------------------------------------------------+
| lifecycleState        | "status"              | <<UML>> -> "YANG" |
|                       | substatement          | <<Deprecated>>    |
|                       |                       | "deprecated",     |
|                       |                       | <<Experimental>>  |
|                       |                       | description,      |
|                       |                       | <<Faulty>>        |
|                       |                       | description,      |
|                       |                       |<<LikelyToChange>> |
|                       |                       | description,      |
|                       |                       | <<Mature>>        |
|                       |                       | "current",        |
|                       |                       | <<Obsolete>>      |
|                       |                       | "obsolete",       |
|                       |                       | <<Preliminary>>   |
|                       |                       | description       |
+-------------------------------------------------------------------+
| complex attribute     | "uses" statement      |                   |
+-------------------------------------------------------------------+
]]></artwork>
<postamble></postamble>
</figure>
<t> Leaf and leaf-list can only use built-in types, typeDef types or enumerations in their type substatement; i.e., not groupings. Complex data types with more than one item (e.g., name value pair) can only be defined using groupings. Groupings can only be used by grouping, container and list statements.</t>
<figure anchor="complex-data-type-mapping-example" title="Example of Complex Data Type Mapping (Available in PDF or HTML versions)">
<preamble></preamble>
<artwork src="complex-data-type-mapping-example.jpg" type="image/jpg">
</artwork>
<postamble></postamble>
</figure>

      </section>
    </section>
      <section title="Mapping of Enumeration Types">
<figure anchor="Enumeration-mapping" title="Mapping of Enumeration Types">
<preamble></preamble>
<artwork align="left"><![CDATA[
+-------------------------------------------------------------------+
|               Enumeration Type -> "enum" statement                |
|       typedef for reusable (indirect usage) enumerations          |
|                        identity statement?                        |
+-------------------------------------------------------------------+
| UML Artifact          | YANG Artifact         | Comment           |
+-------------------------------------------------------------------+
| documentation         | "description"         | Multiple "applied |
| "Applied comments"    | substatement          | comments" defined |
| (carried in XMI as    |                       | in UML, need to be|
|  "ownedComment")      |                       | collapsed into a  |
|                       |                       | single            |
|                       |                       | "description"     |
|                       |                       | substatement.     |
+-------------------------------------------------------------------+
| literal name          | enum name             |                   |
+-------------------------------------------------------------------+
| literal integer       | "value"               |                   |
|                       | substatement          |                   |
+-------------------------------------------------------------------+
| isLeaf = true         | "enum"                | UML definition "" |
| isLeaf = false        | substatement          |                   |
|                       | "identity"/"base"     |                   |
|                       | pattern               |                   |
+-------------------------------------------------------------------+
| <<Reference>>         | "reference"           |                   |
|                       | substatement          |                   |
+-------------------------------------------------------------------+
| <<Example>>           | Ignore Example        |                   |
|                       | elements and all      |                   |
|                       | composed parts        |                   |
+-------------------------------------------------------------------+
| lifecycleState        | "status"              | <<UML>> -> "YANG" |
|                       | substatement          | <<Deprecated>>    |
|                       |                       | "deprecated",     |
|                       |                       | <<Experimental>>  |
|                       |                       | description,      |
|                       |                       | <<Faulty>>        |
|                       |                       | description,      |
|                       |                       |<<LikelyToChange>> |
|                       |                       | description,      |
|                       |                       | <<Mature>>        |
|                       |                       | "current",        |
|                       |                       | <<Obsolete>>      |
|                       |                       | "obsolete",       |
|                       |                       | <<Preliminary>>   |
|                       |                       | description       |
+-------------------------------------------------------------------+
]]></artwork>
<postamble></postamble>
</figure>

<figure anchor="enumeration-type-mapping-example" title="Example of Enumeration Type Mapping (Available in PDF or HTML versions)">
<preamble></preamble>
<artwork src="enumeration-type-mapping-example.jpg" type="image/jpg">
</artwork>
<postamble></postamble>
</figure>

      </section>

     
      <section title="Mapping of Associations">
<figure anchor="association-mapping" title="Mapping of Associations">
<preamble></preamble>
<artwork align="left"><![CDATA[
+-------------------------------------------------------------------+
|                          Associations                             |
+-------------------------------------------------------------------+
| UML Artifact          | YANG Artifact         | Comment           |
+-------------------------------------------------------------------+
| Inheritance           | abstract superclass:  | Multiple          |
|                       | "grouping" statement  | inheritance can   |
|                       |                       | also be mapped    |
|                       | concrete superclass:  | using "groupings" |
|                       | "augment" statement   | Need to define    |
|                       |                       | when augment is   |
|                       |                       | used.  Note:      |
|                       |                       | Augmentation can  |
|                       |                       | be conditional.   |
+-------------------------------------------------------------------+
| Composition with      | "container" statement | How to map "passed|
| (aggregation=         | containing "list"     | by reference"??   |
|    'composite')       | statement(s) (multiple|                   |
| "passed by value"     | contained instances)  |                   |
|                       | or "container" state- |                   |
|                       | ment(s) (single       |                   |
|                       | contained instances)  |                   |
+-------------------------------------------------------------------+
| Aggregation with      | "leafref" statement   | How to map "passed|
| (aggregation='shared')|                       | by value"??       |
| "passed by reference" |                       |                   |
+-------------------------------------------------------------------+
]]></artwork>
<postamble></postamble>
</figure>
<figure anchor="association-mapping-example-1" title="Association Mapping Example 1 (Available in PDF or HTML versions)">
<preamble></preamble>
<artwork src="association-mapping-example-1.jpg" type="image/jpg">
</artwork>
<postamble></postamble>
</figure>

<figure anchor="association-mapping-example-2" title="Association Mapping Example 2 (Available in PDF or HTML versions)">
<preamble></preamble>
<artwork src="association-mapping-example-2.jpg" type="image/jpg">
</artwork>
<postamble></postamble>
</figure>

<figure anchor="association-mapping-example-3" title="Association Mapping Example 3 (Available in PDF or HTML versions)">
<preamble></preamble>
<artwork src="association-mapping-example-3.jpg" type="image/jpg">
</artwork>
<postamble></postamble>
</figure>

<figure anchor="association-mapping-example-4" title="Association Mapping Example 4 (Available in PDF or HTML versions)">
<preamble></preamble>
<artwork src="association-mapping-example-4.jpg" type="image/jpg">
</artwork>
<postamble></postamble>
</figure>

<figure anchor="association-mapping-example-5" title="Association Mapping Example 5 (Available in PDF or HTML versions)">
<preamble></preamble>
<artwork src="association-mapping-example-5.jpg" type="image/jpg">
</artwork>
<postamble></postamble>
</figure>

<figure anchor="association-mapping-summary" title="Association Mapping Summary">
<preamble></preamble>
<artwork align="left"><![CDATA[
                  +-------------------------------------------------+
                  |                       UML                       |
                  +-------------------------------------------------+
                  | containment | association |     inheritance     |
+-------------------------------------------------------------------+
| YANG | nesting  |      X      |             |                     |
|      +------------------------------------------------------------+
|      | grouping |             |             |          X          |
|      |          |             |             |abstract superclasses|
|      +------------------------------------------------------------+
|      | augment  |             |             |          X          |
|      |          |             |             |concrete superclasses|
|      +------------------------------------------------------------+
|      | leafref  |             |      X      |                     |
+-------------------------------------------------------------------+
]]></artwork>
<postamble></postamble>
</figure>

      </section>

      <section title="Mapping of Interfaces">
<figure anchor="interface-mapping" title="Mapping of Interfaces (grouping of operations">
<preamble></preamble>
<artwork align="left"><![CDATA[
+-------------------------------------------------------------------+
|                     UML Interface -> Container??                  |
+-------------------------------------------------------------------+
| documentation         | "description"         | Multiple "applied |
| "Applied comments"    | substatement          | comments" defined |
| (carried in XMI as    |                       | in UML, need to be|
|  "ownedComment")      |                       | collapsed into a  |
|                       |                       | single            |
|                       |                       | "description"     |
|                       |                       | substatement.     |
+-------------------------------------------------------------------+
| abstract              | "grouping" statement  |                   |
+-------------------------------------------------------------------+
| <<Reference>>         | "reference"           |                   |
|                       | substatement          |                   |
+-------------------------------------------------------------------+
| <<Example>>           | Ignore Example        |                   |
|                       | elements and all      |                   |
|                       | composed parts        |                   |
+-------------------------------------------------------------------+
| lifecycleState        | "status"              | <<UML>> -> "YANG" |
|                       | substatement          | <<Deprecated>>    |
|                       |                       | "deprecated",     |
|                       |                       | <<Experimental>>  |
|                       |                       | description,      |
|                       |                       | <<Faulty>>        |
|                       |                       | description,      |
|                       |                       |<<LikelyToChange>> |
|                       |                       | description,      |
|                       |                       | <<Mature>>        |
|                       |                       | "current",        |
|                       |                       | <<Obsolete>>      |
|                       |                       | "obsolete",       |
|                       |                       | <<Preliminary>>   |
|                       |                       | description       |
+-------------------------------------------------------------------+
| support               | "if-feature"          | Support and       |
|                       | substatement          | condition belong  |
+-----------------------+                       | together. If the  |
| condition             |                       | "support" is cond-|
|                       |                       | itional, then the |
|                       |                       | "condition"       |
|                       |                       | explains the cond-|
|                       |                       | itions under which|
|                       |                       | the class has to  |
|                       |                       | be supported.     |
+-------------------------------------------------------------------+
]]></artwork>
<postamble></postamble>
</figure>
      </section>

      <section title="Mapping of Operations">
<figure anchor="operation-mapping" title="Mapping of Operations">
<preamble></preamble>
<artwork align="left"><![CDATA[
+-------------------------------------------------------------------+
|             Operation -> "action" and "rpc" statements            |
| (RFC 6020:  The difference between an action and an rpc is that an|
| action is tied to a node in the data tree, whereas an rpc is      |
| associated at the module level.)                                  |
+-------------------------------------------------------------------+
| documentation         | "description"         | Multiple "applied |
| "Applied comments"    | substatement          | comments" defined |
| (carried in XMI as    |                       | in UML, need to be|
|  "ownedComment")      |                       | collapsed into a  |
|                       |                       | single            |
|                       |                       | "description"     |
|                       |                       | substatement.     |
+-------------------------------------------------------------------+
| pre-condition         | "extension"           | RFC 6020; During  |
|                       | substatement ->       | the NETCONF       |
|                       | ompExt:preCondition   | <edit-config> pro-|
|                       |                       | cessing errors are|
|                       |                       | already sent for: |
|                       |                       | - Delete requests |
|                       |                       |   for non-existent|
|                       |                       |   data.           |
|                       |                       | - Create requests |
|                       |                       |   for existing    |
|                       |                       |   data.           |
|                       |                       | - Insert requests |
|                       |                       |   with "before" or|
|                       |                       |   "after" para-   |
|                       |                       |   meters that do  |
|                       |                       |   not exist.      |
+-------------------------------------------------------------------+
| post-condition        | "extension"           |                   |
|                       | substatement          |                   |
|                       | ompExt:postCondition  |                   |
+-------------------------------------------------------------------+
| input parameter       | "input" substatement  |                   |
+-------------------------------------------------------------------+
| output parameter      | "output" substatement |                   |
+-------------------------------------------------------------------+
| operation exceptions  | "extension"           |                   |
|                       | substatement          |                   |
| Internal Error        | ompExt:operationExceptions                |
| Unable to Comply      |                                           |
| Comm Loss             | +--------------------------------------+  |
| Invalid Input         | | error-tag        | error-app-tag     |  |
| Not Implemented       | +--------------------------------------+  |
| Duplicate             | | operation-failed | too-many-elements |  |
| Entity Not Found      | |                  | too-few-elements  |  |
| Object In Use         | |                  | must-violation    |  |
| Capacity Exceeded     | +--------------------------------------+  |
| Not In Valid State    | | data-missing     | instance-required |  |
| Access Denied         | |                  | missing-choice    |  |
|                       | +--------------------------------------+  |
|                       | | bad-attribute    | missing-instance  |  |
|                       | +--------------------------------------+  |
+-------------------------------------------------------------------+
| isOperationIdempotent | "extension"           |                   |
|                       | substatement          |                   |
|                       | ompExt:isOperationIdempotent              |
+-------------------------------------------------------------------+
| isAtomic              | "extension"           | Necessary?? Not in|
|                       | substatement          | UML Guidelines    |
|                       | ompExt:isAtomic       | (TR-514); needs to|
|                       |                       | be added??        |
+-------------------------------------------------------------------+
| <<Reference>>         | "reference"           |                   |
|                       | substatement          |                   |
+-------------------------------------------------------------------+
| <<Example>>           | Ignore Example        |                   |
|                       | elements and all      |                   |
|                       | composed parts        |                   |
+-------------------------------------------------------------------+
| lifecycleState        | "status"              | <<UML>> -> "YANG" |
|                       | substatement          | <<Deprecated>>    |
|                       |                       | "deprecated",     |
|                       |                       | <<Experimental>>  |
|                       |                       | description,      |
|                       |                       | <<Faulty>>        |
|                       |                       | description,      |
|                       |                       |<<LikelyToChange>> |
|                       |                       | description,      |
|                       |                       | <<Mature>>        |
|                       |                       | "current",        |
|                       |                       | <<Obsolete>>      |
|                       |                       | "obsolete",       |
|                       |                       | <<Preliminary>>   |
|                       |                       | description       |
+-------------------------------------------------------------------+
| support               | "if-feature"          | Support and       |
|                       | substatement          | condition belong  |
+-----------------------+                       | together. If the  |
| condition             |                       | "support" is cond-|
|                       |                       | itional, then the |
|                       |                       | "condition"       |
|                       |                       | explains the cond-|
|                       |                       | itions under which|
|                       |                       | the class has to  |
|                       |                       | be supported.     |
+-------------------------------------------------------------------+
]]></artwork>
<postamble></postamble>
</figure>

<figure anchor="operation-mapping-example" title="Operation Mapping Example (Available in PDF or HTML versions)">
<preamble></preamble>
<artwork src="operation-mapping-example.jpg" type="image/jpg">
</artwork>
<postamble></postamble>
</figure>

      </section>

      <section title="Mapping of Operation Parameters">
<figure anchor="operation-parameter-mapping" title="Mapping of Operation Parameters">
<preamble></preamble>
<artwork align="left"><![CDATA[
+-------------------------------------------------------------------+
|                      Operation Parameters                         |
+-------------------------------------------------------------------+
| documentation         | "description"         | Multiple "applied |
| "Applied comments"    | substatement          | comments" defined |
| (carried in XMI as    |                       | in UML, need to be|
|  "ownedComment")      |                       | collapsed into a  |
|                       |                       | single            |
|                       |                       | "description"     |
|                       |                       | substatement.     |
+-------------------------------------------------------------------+
| direction             | "input" or "output"   |                   |
|                       | substatement          |                   |
+-------------------------------------------------------------------+
| type                  | see mapping of        |                   |
+-----------------------| attribute types       |-------------------+
| isOrdered             | (grouping, leaf,      |                   |
+-----------------------|  leaf-list, list,     |-------------------+
| multiplicity          |  typedef, uses)       |                   |
+-----------------------|                       |-------------------+
| defaultValue          |                       |                   |
+-----------------------|                       |-------------------+
| valueRange            |                       |                   |
+-------------------------------------------------------------------+
| passedByReference     | if passedByReference =| Relevant only to  |
|                       | true -> type leafref {| attributes that   |
|                       | path "/<object>/      | have an object    |
|                       | <objectidentifier>"}  | class defined as  |
|                       |                       | their type.       |
|                       | if passedByReference =|                   |
|                       | false -> either "list"|                   |
|                       | statement (key        |                   |
|                       | property, multiple    |                   |
|                       | instances) or         |                   |
|                       | "container" statement(|                   |
|                       | single instance)      |                   |
+-------------------------------------------------------------------+
| <<Reference>>         | "reference"           |                   |
|                       | substatement          |                   |
+-------------------------------------------------------------------+
| <<Example>>           | Ignore Example        |                   |
|                       | elements and all      |                   |
|                       | composed parts        |                   |
+-------------------------------------------------------------------+
| lifecycleState        | "status"              | <<UML>> -> "YANG" |
|                       | substatement          | <<Deprecated>>    |
|                       |                       | "deprecated",     |
|                       |                       | <<Experimental>>  |
|                       |                       | description,      |
|                       |                       | <<Faulty>>        |
|                       |                       | description,      |
|                       |                       |<<LikelyToChange>> |
|                       |                       | description,      |
|                       |                       | <<Mature>>        |
|                       |                       | "current",        |
|                       |                       | <<Obsolete>>      |
|                       |                       | "obsolete",       |
|                       |                       | <<Preliminary>>   |
|                       |                       | description       |
+-------------------------------------------------------------------+
| support               | "if-feature"          | Support and       |
|                       | substatement not      | condition belong  |
+-----------------------+ defined for input and | together. If the  |
| condition             | output substatements  | "support" is cond-|
|                       | in YANG??             | itional, then the |
|                       |                       | "condition"       |
|                       |                       | explains the cond-|
|                       |                       | itions under which|
|                       |                       | the class has to  |
|                       |                       | be supported.     |
+-------------------------------------------------------------------+
| XOR                   | "choice"              |                   |
|                       | substatement          |                   |
+-------------------------------------------------------------------+
| error notification??  | "must"                |                   |
|                       | substatement          |                   |
+-------------------------------------------------------------------+
| complex parameter     | "uses"                |                   |
|                       | substatement          |                   |
+-------------------------------------------------------------------+
]]></artwork>
<postamble></postamble>
</figure>

<figure anchor="parameter-mapping-example" title="Parameter Mapping Example (Available in PDF or HTML versions)">
<preamble></preamble>
<artwork src="parameter-mapping-example.jpg" type="image/jpg">
</artwork>
<postamble></postamble>
</figure>

      </section>

      <section title="Mapping of Notifications">
<figure anchor="notification-mapping" title="Mapping of Notifications">
<preamble></preamble>
<artwork align="left"><![CDATA[
+-------------------------------------------------------------------+
|      Signal "grouping" statement -> "notification" statement      |
+-------------------------------------------------------------------+
| documentation         | "description"         | Multiple "applied |
| "Applied comments"    | substatement          | comments" defined |
| (carried in XMI as    |                       | in UML, need to be|
|  "ownedComment")      |                       | collapsed into a  |
|                       |                       | single            |
|                       |                       | "description"     |
|                       |                       | substatement.     |
+-------------------------------------------------------------------+
| <<Reference>>         | "reference"           |                   |
|                       | substatement          |                   |
+-------------------------------------------------------------------+
| <<Example>>           | Ignore Example        |                   |
|                       | elements and all      |                   |
|                       | composed parts        |                   |
+-------------------------------------------------------------------+
| lifecycleState        | "status"              | <<UML>> -> "YANG" |
|                       | substatement          | <<Deprecated>>    |
|                       |                       | "deprecated",     |
|                       |                       | <<Experimental>>  |
|                       |                       | description,      |
|                       |                       | <<Faulty>>        |
|                       |                       | description,      |
|                       |                       |<<LikelyToChange>> |
|                       |                       | description,      |
|                       |                       | <<Mature>>        |
|                       |                       | "current",        |
|                       |                       | <<Obsolete>>      |
|                       |                       | "obsolete",       |
|                       |                       | <<Preliminary>>   |
|                       |                       | description       |
+-------------------------------------------------------------------+
| support               | "if-feature"          | Support and       |
|                       | substatement          | condition belong  |
+-----------------------+                       | together. If the  |
| condition             |                       | "support" is cond-|
|                       |                       | itional, then the |
|                       |                       | "condition"       |
|                       |                       | explains the cond-|
|                       |                       | itions under which|
|                       |                       | the class has to  |
|                       |                       | be supported.     |
+-------------------------------------------------------------------+
| Proxy Class           | "choice"              |                   |
| XOR                   | substatement          |                   |
+-------------------------------------------------------------------+
| error notification??  | "must"                |                   |
|                       | substatement          |                   |
+-------------------------------------------------------------------+
| attributes            | see mapping of        |                   |
|                       | attribute types       |                   |
|                       | (grouping, leaf,      |                   |
|                       |  leaf-list, container,|                   |
|                       |  list, typedef, uses) |                   |
+-------------------------------------------------------------------+
| complex attribute     | "uses"                |                   |
|                       | substatement          |                   |
+-------------------------------------------------------------------+
]]></artwork>
<postamble></postamble>
</figure>

<figure anchor="notification-mapping-example" title="Notification Mapping Example (Available in PDF or HTML versions)">
<preamble></preamble>
<artwork src="notification-mapping-example.jpg" type="image/jpg">
</artwork>
<postamble></postamble>
</figure>

      </section>

      <section title="Mapping of Lifecycle">
<figure anchor="lifecycle-mapping" title="Mapping of Lifecycle">
<preamble></preamble>
<artwork align="left"><![CDATA[
+-------------------------------------------------------------------+
|                          UML Lifecycle                            |
+-------------------------------------------------------------------+
| lifecycle stereotypes | "status"              | <<UML>> -> "YANG" |
|                       | substatement or       | <<Deprecated>>    |
|                       | "description"         | "deprecated",     |
|                       | substatement          | <<Experimental>>  |
|                       |                       | description,      |
|                       |                       | <<Faulty>>        |
|                       |                       | description,      |
|                       |                       |<<LikelyToChange>> |
|                       |                       | description,      |
|                       |                       | <<Mature>>        |
|                       |                       | "current",        |
|                       |                       | <<Obsolete>>      |
|                       |                       | "obsolete",       |
|                       |                       | <<Preliminary>>   |
|                       |                       | description       |
+-------------------------------------------------------------------+
]]></artwork>
<postamble></postamble>
</figure>
      </section>

</section>
  
   <section anchor="mapping-patterns" title="Mapping Patterns">
   <section anchor="mapping-patterns-uml-recursion" title="UML Recursion">
   <t>As YANG defines hierarchical data store, any instances that need to store recursive containment will require translation. A mapping between object-oriented store and a hierarchical store is possible; however, there is more than one option:</t>
     <t><list style="symbols">
             <t>Reference Based Approach approach - have a flat list of objects, where the objects are linked into a hierarchy using references. An example of a two-way navigable approach is in <xref target="RFC7223">RFC7223</xref>.</t>
             <t>Assume some specific number of "recursions"; i.e., specify some default number of recursion levels, and define a configurable parameter to allow changing the number of levels.</t>
     </list></t>   
<section anchor="reference-based-approach" title="Reference Based Approach">
<figure anchor="recursion-mapping-example-1" title="Recursion Mapping Example 1 (Available in PDF or HTML versions)">
<preamble></preamble>
<artwork src="recursion-mapping-example-1.jpg" type="image/jpg">
</artwork>
<postamble></postamble>
</figure>

<figure anchor="recursion-mapping-example-2" title="Recursion Mapping Example 2 (Available in PDF or HTML versions)">
<preamble></preamble>
<artwork src="recursion-mapping-example-2.jpg" type="image/jpg">
</artwork>
<postamble></postamble>
</figure>

</section>

</section>
   <section anchor="mapping-patterns-uml-conditional-pacs" title="UML Conditional Pacs">
   <t>Use the "presence" property of the container statement?</t>
   <t>Note: An example of this usage is given in the "Data nodes for the operational state of IP on interfaces." within ietf-ip.yang <xref target="RFC7277">RFC7277</xref>.</t>
   <figure anchor="embedded-conditional-pacs-image" title="Mapping of Conditional Packages (Available in PDF or HTML versions)">
<preamble></preamble>
<artwork src="mapping-of-conditional-packages.jpg" type="image/jpg">
</artwork>
<postamble></postamble>
</figure>
   </section>
   <section anchor="mapping-patterns-xor" title="XOR Relationship">
   <t>The associations related by the "xor" constraint are mapped to the "choice" property of the container/list statement.</t>
   <figure anchor="xor-image" title="XOR Relationship Mapping Example (Available in PDF or HTML versions)">
<preamble></preamble>
<artwork src="xor.jpg" type="image/jpg">
</artwork>
<postamble></postamble>
</figure>
   </section> 
   <section anchor="mapping-patterns-choice" title="Choice Stereotype">
   <t>The choice sterotype can be associated in UML to a class or a data type.  The class or a data type which is annotated with the choice sterotype represents one of a set of classes/data types.  This pattern is mapped to the "choice" property of the container/list/grouping statement.</t>
   <figure anchor="choice-image" title="Choice Stereotype Example (Available in PDF or HTML versions)">
<preamble></preamble>
<artwork src="choice.jpg" type="image/jpg">
</artwork>
<postamble></postamble>
</figure>
   </section> 
   <section anchor="mapping-uml-support-condition" title="Mapping of UML Support and Condition">
     <t>The <xref target="ONF-TR-514">UML Modeling Guidelines</xref> define support and condition for all UML artifacts (M - Mandatory, O - Optional, C - Conditional, CM - Conditional-Mandatory, CO - Conditional-Optional). Support qualifies the support of the artifact at the management interface. Condition contains the condition for the condition-related support qualifiers.</t>  
     <t>M - Mandatory maps to the "mandatory" substatement in choice and leaf or to the "min-elements" substatement in leaf-list and list.</t>
     <t>O - Optional need not be mapped since the per default the "mandatory" and "min-elements" substaments define optional.</t>
     <t>All conditional UML support qualifiers are mapped to the "if-feature" substatement.</t>

<figure anchor="support-and-condition-mapping-example" title="Support and Condition Mapping Example (Available in PDF or HTML versions)">
<preamble></preamble>
<artwork src="support-and-condition-mapping-example.jpg" type="image/jpg">
</artwork>
<postamble></postamble>
</figure>
   </section>
</section>
   <section anchor="mapping-basics" title="Mapping Basics">
   <section anchor="mapping-basics-uml" title="UML-YANG or XMI-YANG">
   <figure anchor="uml-to-yang" title="Example UML to YANG Mapping (Available in PDF or HTML versions)">
<preamble></preamble>
<artwork src="uml-to-yang.jpg" type="image/jpg">
</artwork>
<postamble></postamble>
</figure>

   <figure anchor="xmi-to-yang" title="Example XMI (Papyrus) to YANG Mapping (Available in PDF or HTML versions)">
<preamble></preamble>
<artwork src="xmi-to-yang.jpg" type="image/jpg">
</artwork>
<postamble></postamble>
</figure>
   </section>
     
   </section>
   
    <section anchor="Acknowledgements" title="Acknowledgements">
    </section>

    <section anchor="IANA" title="IANA Considerations">
      <t>This memo includes no request to IANA.</t>
    </section>

    <section anchor="Security" title="Security Considerations">
      <t>This document defines defines guidelines for translation of data modeled with UML to YANG.  As such, it doesn't contribute any new
   security issues beyond those discussed in Sec. 16 of <xref target="RFC6020">RFC6020</xref>.</t>
    </section>
  </middle>

  <back>

    <references title="Informative References">

     &RFC6020;
     &RFC7223;
	 &RFC7277;
     &RFC7950;
     &I-D.lam-teas-usage-info-model-net-topology;
     
     <reference anchor="OMG-UML-2.4"
                 target="http://www.omg.org/spec/UML/2.4/">
        <front>
          <title>Unified Modeling Language (UML)</title>
          <author>
            <organization>OMG</organization>
          </author>
          <date year="2011" />
        </front>
      </reference>

     <reference anchor="ONF-TR-514"
                 target="https://www.opennetworking.org/images/stories/downloads/sdn-resources/technical-reports/UML_Modeling_Guidelines_V1.0.pdf">
        <front>
          <title>ONF TR-514 v1.0 UML Modeling Guidelines</title>
          <author>
            <organization>OMG</organization>
          </author>
          <date year="2015" />
        </front>
      </reference>

    </references>
   
  </back>
</rfc>
