From b6f12765108bb01ace3572684fff7e935f065c5f Mon Sep 17 00:00:00 2001 From: Thom Smith Date: Sun, 24 Oct 2021 13:51:15 -0400 Subject: [PATCH 1/2] Add models/processes to overview --- spec/1.3.0/spec.md | 90 +++++++++++++++++++++++++++++++++++++++------- 1 file changed, 78 insertions(+), 12 deletions(-) diff --git a/spec/1.3.0/spec.md b/spec/1.3.0/spec.md index 1aff577c..f231ece8 100644 --- a/spec/1.3.0/spec.md +++ b/spec/1.3.0/spec.md @@ -671,8 +671,41 @@ serial form, that is, a form with sequential access constraints. [Presentation] deals with the formatting of a YAML [serialization] as a series of characters in a human-friendly manner. +## #. Information Models -# Chapter #. Processes +The following diagram summarizes the three _information models_. +Full arrows denote composition, hollow arrows denote inheritance, "`1`" and +"`*`" denote "one" and "many" relationships. +A single "`+`" denotes [serialization] details, a double "`++`" denotes +[presentation] details. + + +**Figure #. Information Models** + +![Information Models](img/model2.svg) + +Presentation stream +: +A sequence of Unicode characters conforming to the YAML syntax. + +Serialization tree +: +A tree of serialization nodes. +Aliases and anchors are used to refer to a node more than once. +Nodes may lack specific tags, and node content may not be in canonical form. + +Representation graph +: +A graph of representation nodes. +All nodes have specific tags and content in canonical form. Aliases and anchors +are not present. + +Native data structures +: +Implementation-defined values in some programming language or framework +compatible with user code. + +## #. Processes Translating between [native data structures] and a character [stream] is done in several logically distinct stages, each with a well defined input and output @@ -693,6 +726,50 @@ structures] are [constructed] only from information available in the In particular, [mapping key order], [comments] and [tag handles] should not be referenced during [construction]. +### #. Loading + +Loading is the entire process of turning a YAML document into usable native +values. +It consists of the following processes: + +Parsing +: +Turn the presentation stream into a serialization tree. +Read the input, parse it according to the grammar, and build a tree of nodes +and their content. + +Composition +: +Using a schema, turn the serialization tree into a representation graph. +Identify anchors and aliases, resolve tags according to the schema, and +determine the canonical form of node content. + +Construction +: +Turn the representation graph into implementation-defined native data types. + +### #. Dumping + +Dumping is the entire process of native values into a YAML document. +It consists of the following processes: + +Representation +: +Turn implementation-defined native values into a representation graph, +specifying node tags and content. + +Serialization +: +Using a schema, turn the representation graph into a serialization tree. +Use anchors and aliases to ensure that each node only appears once in the tree. + +Presentation +: +Turn the serialization tree into a presentation stream. + + +# Chapter #. Processes + ## #. Dump @@ -809,17 +886,6 @@ By carefully separating properties needed for [serialization] and [presentation], YAML [representations] of [application] information will be consistent and portable between various programming environments. -The following diagram summarizes the three _information models_. -Full arrows denote composition, hollow arrows denote inheritance, "`1`" and -"`*`" denote "one" and "many" relationships. -A single "`+`" denotes [serialization] details, a double "`++`" denotes -[presentation] details. - - -**Figure #. Information Models** - -![Information Models](img/model2.svg) - ## #. Representation Graph From cc49edb3250713a0899ec8d97d300cdcf8ff388a Mon Sep 17 00:00:00 2001 From: Thom Smith Date: Sun, 24 Oct 2021 19:53:50 -0400 Subject: [PATCH 2/2] Don't claim that there are three information models --- spec/1.3.0/spec.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spec/1.3.0/spec.md b/spec/1.3.0/spec.md index f231ece8..2f99173b 100644 --- a/spec/1.3.0/spec.md +++ b/spec/1.3.0/spec.md @@ -673,7 +673,8 @@ of characters in a human-friendly manner. ## #. Information Models -The following diagram summarizes the three _information models_. +The following diagram summarizes the YAML _information models_, excluding +native data types. Full arrows denote composition, hollow arrows denote inheritance, "`1`" and "`*`" denote "one" and "many" relationships. A single "`+`" denotes [serialization] details, a double "`++`" denotes