Writes the Milestones Project data to a folder of plain-text YAML files: one file per
milestone, plus shared files for authors, references and the controlled vocabularies
(aspects, subjects, keywords). The files are meant to be the editable, version-controlled
source of the data. read_milestones_yaml() reads them back into the package's tables.
Details
The layout is:
<dir>/
milestones/<slug>.yaml one per milestone, e.g. 1786Playfair.yaml (characters other
than letters, digits, `_`, `.`, `-` are dropped from the name)
authors.yaml all authors, keyed by "Family, Given"
references.yaml all references, keyed by BibTeX key
vocabulary.yaml aspect, subject and keyword names, with their idsWithin a milestone file, authors, references, keywords, aspects and subjects are given by
name or key, not by integer id. Database ids (mid, aid, rid) are kept as id:
fields so the tables can be rebuilt exactly. New items can leave them out.
Some cleaning is applied on export:
Text fields have
\r\nconverted to\nand trailing white space removed. Values that are then empty become missing and are omitted.Author family names come from the cleaned
lnamescolumn (no HTML entities).Duplicate rows in the link tables are dropped, as are links to authors not in the author table (in the database,
aid1 is "Unknown"). A milestone withoutauthors:has unknown author(s).A duplicated
bibtexkeygets the suffix-<rid>to make the key unique, and the original value is kept in abibtexkeyfield.add_dateandmodified_date(m/d/yyin the database) are written as ISO dates. The MySQL "zero date"0000-00-00is treated as missing.Image URLs under
http://datavis.ca/milestones/uploads/images/are written as afile:path relative to that folder.
