D'oh!! YAML is too complicated!
Bart! Listen to your father!
Hey! YAML is freakin' sweet!
- developer wishes to cross-reference rows-with-anchors from one table and link to them with rows-as-aliases in another table
- developer wishes to avoid creating the "nested dictionaries problem"
- use YAML aliases, with YAML merge keys
- in YAML, reusable "transclusion identifiers" are called anchors and aliases
- in YAML, reusable "transclusion identifiers" consist of alphanumeric tokens preceeded by an ampersand or asterisk
- YAML anchors and aliases allow for increased data normalization
- YAML anchors and aliases enforce
DRY (Don't repeat yourself)
- in this example, a table structure can be designed and preserved which closely coincides with a database
- in this example, data entry and file sizes can be reduced
- in this specific example,
yaml.load() will produce nested dictionaries
- under the person name-value pair, the value for person will be a sub-dictionary
- this may be undesirable, because it breaks the uniformity of the table structure
- failure to correctly specify aliases will result in missing data
- (typos will create broken cross-references)
- YAML does not support file transclusion by reference, so all aliases and anchors must exist in the same yaml file
- not all YAML parsers reliably support anchors and aliases