Ok. More clarity with regard to YAML is emergent
today thanks to Andrew's thoughtful questioning.
YAML serializes a typed and labeled graph which
is both directed and has an origin such that all
nodes in the graph are reachable from the origin.
By typed graph, we mean that each graph is given
a transfer method (a class plus a format). By labeled,
we mean that all branch nodes label their connections
with either integers [sequence] or other nodes [mapping].
By directed with origin, we mean that each document
starts with a toplevel node and only nodes reachable
by this toplevel node can be serialized. Thus, a structure
such as the one below cannot be serialized:
0 0
N1 > N2 < N3
Where N1 and N3 are "lists" with one item, N2 stored
in their first position and thus having a label of 0.
Note that the above structure doesn't have an origin.
If you start with N1, you will not serialize N3, etc.
In practice, this reachability constraint is not a problem
as all programming languages that I know of have the same
limitation (indeed, unreachable nodes are usually called
"garbage" and are often discarded by a garbage collector).
Also, the above structure can always be represented by
using a convention of introducing a top level node, which,
at the application level is not considered part of the graph.
N1 > N2 < N3
^ ^
\ /
\a /b
\ /
ORIGIN
In Python, the role of the ORIGIN is the toplevel namespace
which is a mapping called __dict__. In the example above, it
would have variable names "a" and "b". So, assuming that N2
also has the type "list", this would be represented in Python...
a = [[]]
b = [a[0]]
I hope this is somewhat clarifying the situation; so from
an information model perspective, YAML does indeed have
a few limitations; but those are quite pratical in nature.
Best,
Clark
