MetaData
json+metadata
{ “name” : [ metadata , content … ] }
This describes a generic approach to adding metadata to structures represented in JSON.
The benefit of the default approach is that the first position of an array always contains metadata.
JSON has two structures:
- a map (json:object) indexed by name.
- a list (json:array) indexed by whole (from 0) or natural numbers (from 1),
depending on the programming language or library used.
So there’s a choice to make about whether to distinguish metadata from data by
- a named value in a map,
eg {“@”: metadata, “$”: content } - or by position in a list.
eg. first position [ metadata , content … ]
Lets name them:
- json+metadata[“name”]. eg. json+meta
- json+metadata[position], where position is first, last, or whole number.
and set a default
- json+metadata by default means json+metadata[first],
ie. that the metadata is in the first position of each array.
The metadata itself may be a map, or a list if the order of the metadata is significant,
or if there is metadata about the metadata.