.. _sec-examples:

*********************************
Example Data Models and Instances
*********************************

Doctest__ snippets in this documentation use the following example data models and their JSON-encoded instances.

__ http://www.sphinx-doc.org/en/stable/ext/doctest.html

.. _sec-ex1:

Example 1
=========

This example is used in the documentation of the :mod:`.datamodel`
module.

.. rubric:: YANG Library

File: ``examples/ex1/yang-library-ex1.json``

.. literalinclude:: examples/ex1/yang-library-ex1.json
   :language: json

.. rubric:: YANG Module *example-1*

File: ``examples/ex1/example-1.yang``

.. literalinclude:: examples/ex1/example-1.yang
   :language: none

.. rubric:: Instance document

File: ``examples/ex1/example-data.json``

.. literalinclude:: examples/ex1/example-data.json
   :language: json

.. _sec-ex2:

Example 2
=========

This example is used in the documentation of the :mod:`.instance`
module.

.. rubric:: YANG Library

File: ``examples/ex2/yang-library-ex2.json``

.. literalinclude:: examples/ex2/yang-library-ex2.json
   :language: json

.. rubric:: YANG Module *example-2*

File: ``examples/ex2/example-2.yang``

.. literalinclude:: examples/ex2/example-2.yang 
   :language: none

.. rubric:: Instance document

File: ``examples/ex2/example-data.json``

.. literalinclude:: examples/ex2/example-data.json
   :language: json

.. _sec-ex3:

Example 3
=========

This example is used in the documentation of the :mod:`.context`
module.

.. rubric:: YANG Library

File: ``examples/ex3/yang-library-ex3.json``

.. literalinclude:: examples/ex3/yang-library-ex3.json
   :language: json

.. rubric:: YANG Module *example-3-a*

File: ``examples/ex3/example-3-a@2016-06-18.yang``

.. literalinclude:: examples/ex3/example-3-a@2016-06-18.yang 
   :language: none

.. rubric:: YANG Submodule *example-3-suba*

File: ``examples/ex3/example-3-suba@2016-07-21.yang``

.. literalinclude:: examples/ex3/example-3-suba@2016-07-21.yang
   :language: none

.. rubric:: YANG Module *example-3-b*

File: ``examples/ex3/example-3-b@2016-08-22.yang``

.. literalinclude:: examples/ex3/example-3-b@2016-08-22.yang
   :language: none

.. _sec-ex4:

Example 4
=========

This example is used in the documentation of
the :mod:`.schema`, :mod:`.xpathast` and :mod:`.xpathparser` modules.

.. rubric:: YANG Library

File: ``examples/ex4/yang-library-ex4.json``

.. literalinclude:: examples/ex4/yang-library-ex4.json
   :language: json

.. rubric:: YANG Module *example-4-a*

File: ``examples/ex4/example-4-a.yang``

.. literalinclude::  examples/ex4/example-4-a.yang
   :language: none

.. rubric:: YANG Module *example-4-b*

File: ``examples/ex4/example-4-b.yang``

.. literalinclude::  examples/ex4/example-4-b.yang 
   :language: none

.. rubric:: Instance document

File: ``examples/ex4/example-data.json``

.. literalinclude:: examples/ex4/example-data.json
   :language: json

.. _sec-ex5:

Example 5
=========

This example is used in the documentation of the :mod:`.datatype` and
:mod:`statement` modules.

.. rubric:: YANG Library

File: ``examples/ex5/yang-library-ex5.json``

.. literalinclude:: examples/ex5/yang-library-ex5.json
   :language: json

.. rubric:: YANG Module *example-5-a*

File: ``examples/ex5/example-5-a.yang``

.. literalinclude::  examples/ex5/example-5-a.yang 
   :language: none

.. rubric:: YANG Module *example-5-b*

File: ``examples/ex5/example-5-b.yang``

.. literalinclude::  examples/ex5/example-5-b.yang
   :language: none
