<?xml version="1.0" encoding="US-ASCII"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [

<!ENTITY RFC2119 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml">
<!ENTITY RFC6020 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.6020.xml">
<!ENTITY I-D.draft-ietf-netmod-rfc6020bis SYSTEM "http://xml2rfc.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-netmod-rfc6020bis.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-00.xml">
<!ENTITY I-D.dharini-netmod-g-698-2-yang SYSTEM "http://xml2rfc.ietf.org/public/rfc/bibxml3/reference.I-D.draft-dharini-netmod-g-698-2-yang-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-00" 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>Alcatel Lucent</organization>

      <address>
        <postal>
          <street></street>

          <city></city>

          <region></region>

          <code></code>

          <country>USA</country>
        </postal>

        <phone>+1 732 331 3476</phone>

        <email>kam.lam@alcatel-lucent.com</email>

      </address>
    </author>
	
	<author fullname="Eve Varma" initials="E.V." 
            surname="Varma">
      <organization>Alcatel Lucent</organization>

      <address>
        <postal>
          <street></street>

          <city></city>

          <region></region>

          <code></code>

          <country>USA</country>
        </postal>

        <phone></phone>

        <email>eve.varma@alcatel-lucent.com</email>

      </address>
    </author>
   
    <date month="July" year="2015" />

    <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="I-D.ietf-netmod-rfc6020bis">YANG Update</xref>) including mapping of object classes, attributes, data types, associations, interfaces, operations and operation parameters, notifications, and lifecycle.</t>
    </section>
   
      <section title="Keywords">
        <t>The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
        "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
        document are to be interpreted as described in <xref
        target="RFC2119">RFC 2119</xref>.</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 --> "list" statement (key property) or         |
|                        "container" statement                      |
+-------------------------------------------------------------------+
| UML Artifact          | YANG Artifact         | Comment           |
+-------------------------------------------------------------------+
| documentation         | "description"         |                   |
|                       | substatement          |                   |
+-------------------------------------------------------------------+
| superclass(es)        | ??                    |                   |
+-------------------------------------------------------------------+
| abstract              | abstract: "container" |                   |
|                       | not abstract: "list"  |                   |
+-------------------------------------------------------------------+
| objectCreationNotific-| ??                    |                   |
| ation                 |                       |                   |
+-------------------------------------------------------------------+
| objectDeletionNotific-| ??                    |                   |
| ation                 |                       |                   |
+-------------------------------------------------------------------+
| support               | "if-feature"          |                   |
|                       | substatement          |                   |
+-------------------------------------------------------------------+
| condition             | "if-feature"          |                   |
|                       | substatement          |                   |
+-------------------------------------------------------------------+
| operation             | "action"              |                   |
|                       | substatement          |                   |
+-------------------------------------------------------------------+
| XOR                   | "choice"              |                   |
|                       | substatement          |                   |
+-------------------------------------------------------------------+
| ??                    | "config"              |                   |
|                       | substatement          |                   |
+-------------------------------------------------------------------+
| error notfication?    | "must"                |                   |
|                       | substatement          |                   |
+-------------------------------------------------------------------+
| object identifier     | list::"key"           |                   |
|                       | substatement          |                   |
+-------------------------------------------------------------------+
| ??                    | list::"min-elements"  | min-elements      |
|                       | "max-elements"        |  default = 0      |
|                       | substatements         | max-elements      |
|                       |                       |  default=unbounded|
|                       |                       | mandatory         |
|                       |                       |  default=false    |
+-------------------------------------------------------------------+
| Conditional PACs      | container::presence"  |                   |
|                       | substatement          |                   |
+-------------------------------------------------------------------+
| hyperlink?            | "reference"           | Papyrus doesn't   |
|                       | substatement          | support hyperlinks|
+-------------------------------------------------------------------+
| lifecycle stereotypes | "status"              | "current"         |
|                       | substatement          | "deprecated"      |
|                       |                       | "obsolete"        |
|                       |                       |  default="current"|
+-------------------------------------------------------------------+
| ??                    | list::"unique"        |                   |
|                       | substatement          |                   |
+-------------------------------------------------------------------+
| complex attribute     | "uses" substatement   |                   |
+-------------------------------------------------------------------+
| {<constraint>}        | "when" substatement   |                   |
+-------------------------------------------------------------------+
]]></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"         |                   |
|                       | substatement          |                   |
+-------------------------------------------------------------------+
| type                  | "type" substatement   |                   |
|                       | (built-in or derived) |                   |
+-------------------------------------------------------------------+
| readOnly              | "config" substatement |                   |
|                       | (false)               |                   |
+-------------------------------------------------------------------+
| isOrdered             | "ordered-by"          |                   |
|                       | substatement          |                   |
|                       |("system" or "user")   |                   |
+-------------------------------------------------------------------+
| multiplicity          | "min-elements" and    | min-elements      |
|                       | "max-elements"        |  default = 0      |
|                       | substatements         | max-elements      |
|                       | [0..x]=>mandatory     |  default=unbounded|
|                       |   substatement=false  | mandatory         |
|                       | [1..x]=>mandatory     |  default=false    |
|                       |   substatement=true   |                   |
|                       |                       |                   |
+-------------------------------------------------------------------+
| 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           | "config"              |                   |
|                       | substatement (false)  |                   |
+-------------------------------------------------------------------+
| valueRange            | "range" or "length"   |                   |
|                       | substatement of "type"|                   |
|                       | substatement          |                   |
+-------------------------------------------------------------------+
| passedById            | ??                    |                   |
+-------------------------------------------------------------------+
| support               | "if-feature"          |                   |
|                       | substatement          |                   |
+-------------------------------------------------------------------+
| condition             | "if-feature"          |                   |
|                       | substatement          |                   |
+-------------------------------------------------------------------+
| error notfication?    | "must"                |                   |
|                       | substatement          |                   |
+-------------------------------------------------------------------+
| hyperlink?            | "reference"           | Papyrus doesn't   |
|                       | substatement          | support hyperlinks|
+-------------------------------------------------------------------+
| lifecycle stereotypes | "status"              | "current"         |
|                       | substatement          | "deprecated"      |
|                       |                       | "obsolete"        |
|                       |                       |  default="current"|
+-------------------------------------------------------------------+
| unit?                 | "units" substatement  |                   |
+-------------------------------------------------------------------+
| {<constraint>}        | "when" substatement   |                   |
+-------------------------------------------------------------------+
]]></artwork>
<postamble></postamble>
</figure>
      </section>
      
      <section title="Mapping of Types">
<figure anchor="type-mapping" title="Mapping of Types">
<preamble></preamble>
<artwork align="left"><![CDATA[
+-------------------------------------------------------------------+
| UML Artifact          | YANG Artifact         | Comment           |
+-------------------------------------------------------------------+
| Primitive Type        | ??                    | new built-in type?|
+-------------------------------------------------------------------+
| Enumeration           | "enum" statement      |                   |
+-------------------------------------------------------------------+
| Basic Data Type       | "typeDef" statement   |                   |
+-------------------------------------------------------------------+
| Complex Data Type     | "grouping" statement  |                   |
+-------------------------------------------------------------------+
]]></artwork>
<postamble></postamble>
</figure>
<t>Note:  YANG allows also in-line enumerations which are not possible in UML</t>
      <section title="Mapping of Primitive Types">
<figure anchor="primitive-type-mapping" title="Mapping of Primitive Types">
<preamble></preamble>
<artwork align="left"><![CDATA[
+-------------------------------------------------------------------+
|               Primitive Type -> new built-in type?                |
+-------------------------------------------------------------------+
| UML Artifact          | YANG Artifact         | Comment           |
+-------------------------------------------------------------------+
| documentation         | ??                    |                   |
+-------------------------------------------------------------------+
]]></artwork>
<postamble></postamble>
</figure>
      </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                |
+-------------------------------------------------------------------+
| UML Artifact          | YANG Artifact         | Comment           |
+-------------------------------------------------------------------+
| documentation         | "description"         |                   |
|                       | substatement          |                   |
+-------------------------------------------------------------------+
| literal name          | "value"               |                   |
|                       | substatement          |                   |
+-------------------------------------------------------------------+
| hyperlink?            | "reference"           | Papyrus doesn't   |
|                       | substatement          | support hyperlinks|
+-------------------------------------------------------------------+
| lifecycle stereotypes | "status"              | "current",        |
|                       | substatement          | "deprecated",     |
|                       |                       | "obsolete"        |
|                       |                       | default=current   |
+-------------------------------------------------------------------+
| ??                    | "if-feature" statement|                   |
+-------------------------------------------------------------------+
]]></artwork>
<postamble></postamble>
</figure>
      </section>

      <section title="Mapping of Basic Data Types">
<figure anchor="basic-type-mapping" title="Mapping of Basic Data Types">
<preamble></preamble>
<artwork align="left"><![CDATA[
+-------------------------------------------------------------------+
|               Basic Data Type -> "typeDef" statement              |
+-------------------------------------------------------------------+
| UML Artifact          | YANG Artifact         | Comment           |
+-------------------------------------------------------------------+
| documentation         | "description"         |                   |
|                       | substatement          |                   |
+-------------------------------------------------------------------+
| type                  | "type" substatement   |                   |
|                       | (built-in type)       |                   |
+-------------------------------------------------------------------+
| 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. |
+-------------------------------------------------------------------+
| hyperlink?            | "reference"           | Papyrus doesn't   |
|                       | substatement          | support hyperlinks|
+-------------------------------------------------------------------+
| lifecycle stereotypes | "status"              | "current",        |
|                       | substatement          | "deprecated",     |
|                       |                       | "obsolete"        |
|                       |                       | default=current   |
+-------------------------------------------------------------------+
| unit?                 | "units" statement     |                   |
+-------------------------------------------------------------------+
]]></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"         |                   |
|                       | substatement          |                   |
+-------------------------------------------------------------------+
| not used              | "action" substatement |                   |
+-------------------------------------------------------------------+
| XOR                   | "choice"              |                   |
|                       | substatement          |                   |
+-------------------------------------------------------------------+
| hyperlink?            | "reference"           | Papyrus doesn't   |
|                       | substatement          | support hyperlinks|
+-------------------------------------------------------------------+
| lifecycle stereotypes | "status"              | "current",        |
|                       | substatement          | "deprecated",     |
|                       |                       | "obsolete"        |
|                       |                       | default=current   |
+-------------------------------------------------------------------+
| complex attribute     | "uses" statement      |                   |
+-------------------------------------------------------------------+
]]></artwork>
<postamble></postamble>
</figure>
      </section>
    </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           | "extension" or        |                   |
|                       | "augment" statement   |                   |
+-------------------------------------------------------------------+
| Composition           | "container" statement |                   |
+-------------------------------------------------------------------+
| Aggregation           | "container" statement |                   |
+-------------------------------------------------------------------+
]]></artwork>
<postamble></postamble>
</figure>
<figure anchor="embedded-association-mapping-example-image" title="Association Mapping Examples (Available in PDF or HTML versions)">
<preamble></preamble>
<artwork src="association-mapping-examples.jpg" height="642" width="583" type="image/jpg">
</artwork>
<postamble></postamble>
</figure>
      </section>

      <section title="Mapping of Interfaces">
<figure anchor="interface-mapping" title="Mapping of Interfaces">
<preamble></preamble>
<artwork align="left"><![CDATA[
+-------------------------------------------------------------------+
|                     UML Interface -> Container?                   |
+-------------------------------------------------------------------+
| documentation         | "description"         |                   |
|                       | substatement          |                   |
+-------------------------------------------------------------------+
| abstract              | ??                    |                   |
+-------------------------------------------------------------------+
| support               | "if-feature"          |                   |
|                       | substatement          |                   |
+-------------------------------------------------------------------+
| condition             | "if-feature"          |                   |
|                       | substatement          |                   |
+-------------------------------------------------------------------+
]]></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            |
+-------------------------------------------------------------------+
| documentation         | "description"         |                   |
|                       | substatement          |                   |
+-------------------------------------------------------------------+
| pre-condition         | ??                    |                   |
+-------------------------------------------------------------------+
| post-condition        | ??                    |                   |
+-------------------------------------------------------------------+
| input parameter       | "input" substatement  |                   |
+-------------------------------------------------------------------+
| output parameter      | "output" substatement |                   |
+-------------------------------------------------------------------+
| operation exceptions  | ??                    |                   |
+-------------------------------------------------------------------+
| isOperationIdempotent | ??                    |                   |
+-------------------------------------------------------------------+
| isAtomic              | ??                    |                   |
+-------------------------------------------------------------------+
| support               | "if-feature"          |                   |
|                       | substatement          |                   |
+-------------------------------------------------------------------+
| condition             | "if-feature"          |                   |
|                       | substatement          |                   |
+-------------------------------------------------------------------+
| hyperlink?            | "reference"           | Papyrus doesn't   |
|                       | substatement          | support hyperlinks|
+-------------------------------------------------------------------+
| lifecycle stereotypes | "status"              | "current",        |
|                       | substatement          | "deprecated",     |
|                       |                       | "obsolete"        |
|                       |                       | default=current   |
+-------------------------------------------------------------------+
]]></artwork>
<postamble></postamble>
</figure>
<t>Note:  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 not.</t>
      </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"         |                   |
|                       | substatement          |                   |
+-------------------------------------------------------------------+
| direction             | "input" or "output"   |                   |
|                       | substatement          |                   |
+-------------------------------------------------------------------+
| type                  | see mapping of        |                   |
|                       | attribute types       |                   |
|                       | (grouping, leaf,      |                   |
|                       |  leaf-list, list,     |                   |
|                       |  typedef, uses)       |                   |
+-------------------------------------------------------------------+
| isOrdered             |                       |                   |
+-------------------------------------------------------------------+
| multiplicity          |                       |                   |
+-------------------------------------------------------------------+
| defaultValue          | ??                    |                   |
+-------------------------------------------------------------------+
| valueRange            | ??                    |                   |
+-------------------------------------------------------------------+
| passedByID            | ??                    |                   |
+-------------------------------------------------------------------+
| support               | "if-feature"          |                   |
|                       | substatement          |                   |
+-------------------------------------------------------------------+
| condition             | "if-feature"          |                   |
|                       | substatement          |                   |
+-------------------------------------------------------------------+
| XOR                   | "choice"              |                   |
|                       | substatement          |                   |
+-------------------------------------------------------------------+
| error notification?   | "must"                |                   |
|                       | substatement          |                   |
+-------------------------------------------------------------------+
| complex parameter     | "uses"                |                   |
|                       | substatement          |                   |
+-------------------------------------------------------------------+
]]></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 -> "notification" statement                |
+-------------------------------------------------------------------+
| documentation         | "description"         |                   |
|                       | substatement          |                   |
+-------------------------------------------------------------------+
| support               | "if-feature"          |                   |
|                       | substatement          |                   |
+-------------------------------------------------------------------+
| condition             | "if-feature"          |                   |
|                       | substatement          |                   |
+-------------------------------------------------------------------+
| XOR                   | "choice"              |                   |
|                       | substatement          |                   |
+-------------------------------------------------------------------+
| error notification?   | "must"                |                   |
|                       | substatement          |                   |
+-------------------------------------------------------------------+
| hyperlink?            | "reference"           | Papyrus doesn't   |
|                       | substatement          | support hyperlinks|
+-------------------------------------------------------------------+
| lifecycle stereotypes | "status"              | "current",        |
|                       | substatement          | "deprecated",     |
|                       |                       | "obsolete"        |
|                       |                       | default=current   |
+-------------------------------------------------------------------+
| complex attribute     | "uses"                |                   |
|                       | substatement          |                   |
+-------------------------------------------------------------------+
]]></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"              | "current",        |
|                       | substatement          | "deprecated",     |
|                       |                       | "obsolete"        |
|                       |                       | default=current   |
+-------------------------------------------------------------------+
]]></artwork>
<postamble></postamble>
</figure>
      </section>

      <section title="Other Mappings">
<figure anchor="other-mapping" title="Other Mappings">
<preamble></preamble>
<artwork align="left"><![CDATA[
+-------------------------------------------------------------------+
|                          UML Lifecycle                            |
+-------------------------------------------------------------------+
| Conditional Package   | "container" statement |                   |
|                       | with                  |                   |
|                       | "presence"            |                   |
|                       | substatement          |                   |
+-------------------------------------------------------------------+
| Primitive Type        | Built-In Type         |                   |
+-------------------------------------------------------------------+
| Package               | Submodule             |                   |
+-------------------------------------------------------------------+
]]></artwork>
<postamble></postamble>
</figure>
      </section>

   </section>
   
   <section anchor="mapping-issues" title="Mapping Issues">
   <t>When translating from UML information models to YANG data models some mapping rules are straightforward, and some are not.  This section provides considerations and recommendations for the more complex translations.</t>
   <section anchor="mapping-recursion-issues" title="Mapping of Recursion">   
     <t><list style="symbols">
             <t>Statically define a number of recursion levels</t>
             <t>Reference Based Approach</t>
     </list></t>
	 <t>In the static approach, some number of recursion levels is pre-configured.  In the Reference-based approach, a flat list is maintained using hierarchical identities.  The reference-based approach is generally preferred because there is no arbitrary limitation set in the solution.</t>
   </section>
   </section>
   
   <section anchor="mapping-patterns" title="Mapping Patterns">
   <section anchor="mapping-patterns-uml-recursion" title="UML Recursion">
   <t>TBD</t>
   </section>
   <section anchor="mapping-patterns-uml-conditional-pacs" title="UML Conditional Pacs">
   <t>May use the "presence" property of the container statement?</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>Use the "choice" property of the container statement.</t>
   </section>   
   </section>
   <section anchor="mapping-basics" title="Mapping Basics">
   <section anchor="mapping-basics-uml" title="UML-YANG or XMI-YANG">
   <figure anchor="embedded-xml-to-yang-image" 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="embedded-xmi-example-image" title="Example XMI (Papyrus) to YANG Mapping (Available in PDF or HTML versions)">
<preamble></preamble>
<artwork src="example-xmi.jpg" type="image/jpg">
</artwork>
<postamble></postamble>
</figure>
   </section>
   <section anchor="mapping-basics-xmi" title="XMI Differences">
      <figure anchor="embedded-xmi-differences-image" title="Example XMI (Papyrus) / XMI (RSA) Differences (Available in PDF or HTML versions)">
<preamble></preamble>
<artwork src="xmi-differences.jpg" type="image/jpg">
</artwork>
<postamble></postamble>
</figure>
   <figure anchor="embedded-xmi-details-image" title="Example XMI (Papyrus) / XMI (RSA) Differences (detailed) (Available in PDF or HTML versions)">
<preamble></preamble>
<artwork src="papyrus-rsa-xmi-differences.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="Normative References">

      &RFC2119;
     
   </references>

    <references title="Informative References">

     &RFC6020;
     &I-D.draft-ietf-netmod-rfc6020bis;
	 &I-D.dharini-netmod-g-698-2-yang;
     &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>
	
    <section anchor="example-appendix" title="Example">
<t>The YANG data schema (in tree format) shown below was extracted from <xref target="I-D.dharini-netmod-g-698-2-yang">dharini-netmod-g-698-2-yang</xref> and represents the same data as UML model appearing in <xref target="embedded-interfaces-uml-model-image"></xref> after the tree format. Note: The color code used in the tree format corresponds to the color code used in the UML class diagram.</t>
<figure anchor="embedded-interfaces-tree-image" title="Interfaces Tree (Available in PDF or HTML versions)">
<preamble></preamble>
<artwork src="interfaces-tree.jpg" type="image/jpg">
</artwork>
<postamble></postamble>
</figure>
<figure anchor="embedded-interfaces-notifications-image" title="Notifications Tree (Available in PDF or HTML versions)">
<preamble></preamble>
<artwork src="interfaces-notifications.jpg" type="image/jpg">
</artwork>
<postamble></postamble>
</figure>
<figure anchor="embedded-interfaces-uml-model-image" title="Interfaces UML Model (Available in PDF or HTML versions)">
<preamble></preamble>
<artwork src="interfaces-uml-model.jpg" height="1000" width="800" type="image/jpg">
</artwork>
<postamble></postamble>
</figure>
</section>

  </back>
</rfc>
