SUPPLEMENTARY DATA 1
A Linked Dataset of Traditional Chinese Medicine Formula Aliases, Compositions, and Edition Provenance
Dongfei Lin | Research snapshot, 2 December 2026

Contents and coverage
formula_links.sqlite contains the complete derived record-level dataset analyzed in the article. It is a relational database in SQLite 3 format. All strings can be read as UTF-8. The three documentary strata are the construction dictionary, the held-out dictionary and six independently published reference records. The database is usable without the original workbooks. Those workbooks are necessary to inspect complete composition passages or to rerun initial extraction. Full-text source workbooks, cache files and patient data are excluded. This package provides local research access. It does not grant redistribution rights to source works.

Identity and scope
D row numbers refer to sheet Sheet1 of 方剂大辞典_84578.xlsx. SHA-256 52c561536708ce376c4f7c10f530a884382f1503649ee76a1b96826b291be81f.
H row numbers refer to sheet Sheet1 of 中国方剂精华辞典_10127.xlsx. SHA-256 669893ea53cbb0adda9813831094523bc27647a2ef9cf05f16b5272373c756e7.
Both worksheets start with a header in row 1. Row numbers are snapshot-specific identifiers. Separate files with different checksums may have different rows. External identifiers F00060 through F00065 refer to the HKBU Chinese Medicine Formulae Images Database. Use https://sys01.lib.hkbu.edu.hk/cmed/cmfid/detail.php?id=F00060 and replace the final ID for other cases. The external term transcriptions used for the comparison are included in external and in build.py.

Data dictionary
witness: one D record per id. headword is its normalized name. source_literal is the unmodified source cell. first_title is the first text inside book-title brackets. juan_literal is the first recognized local volume expression. edition_marker lists detected production or editorial terms. composition_present indicates a nonempty source composition field; see the original workbook for doses and order.
member: id is a D row and term is a normalized ingredient-entity string. A row records lexical presence only. No claim of standardized botanical identity is made.
alias: id is a D row, alternative the extracted name, citation the supporting normalized bibliographic string and rule the pattern family. cited_label is a bounded label with a parenthesized title. quoted_title is a formula-title quotation. The direction is witness headword to alternative. Neither symmetry nor transitivity is implied.
edition_qualifier: id is a D row. qualifier is the parenthetical version-like expression, with normalization per Methods. Source punctuation remains available in witness.source_literal.
heldout: id is an H row. headword, first_title, juan_literal and terms_json are query fields; raw_heading preserves the original heading. terms_json is a JSON array of unique lexical strings.
alias_test: id is an H row and alternative is the independently extracted first quoted label. headword_seen marks a D primary headword. pair_seen requires the directed D headword-to-alias pair. same_book additionally requires a D witness with the same nonempty literal primary work.
retrieval: id is an H row. n_candidates counts distinct D headword-or-alias matches. n_primary counts primary-name matches. eligible counts candidates with a comparable work title and ingredient set when the query also contains both. book_available is presence of the literal target title among eligible candidates. n_books counts distinct eligible primary titles. best_j is maximum Jaccard similarity, tied_rows counts equally best candidates, baseline is uniform-record expected book agreement, and ranked is expected title agreement within the best-scoring tie. top_id is the numerically first D witness in that tie, used only as an inspection example. exact_text flags a full normalized source composition string identical to at least one eligible candidate's composition. NULL scores denote an unevaluable query.
modal: id is an H row. modal_agreement is target-title agreement under modal candidate-book selection, with fractional ties across books.
locator_test: id is an H row. within_book_count is the number of same-title candidates with usable ingredient and juan data, best_j the maximum similarity, tied the number attaining that score, juan_agreement the expected agreement over ties, and juan_available the presence of the target volume in this source-conditioned set.
sensitivity: id is an H row. alias_citation_hit tests whether the H book is the first title in a matching D alias citation. work_family_available and work_family_ranked repeat the coverage and agreement calculations after the three exploratory title groupings described in the manuscript. The grouping is not an edition authority file.
external: id is the HKBU identifier, headword and first_title are transcribed reference labels, and terms_json gives the comparison terms. n_candidates is any name/alias hit, matching_book counts matching primary titles with nonempty term sets, book_best_j is the best within-book Jaccard and best_id is the first D row attaining it.
An empty string denotes a field that is missing or unparsed unless the field is a count or indicator. Booleans are represented as 0 and 1. Tables and counts are also listed in manifest.json.

Example queries
Inspect the provenance of a worked alias:
SELECT w.id, w.headword, w.source_literal, a.alternative, a.citation
FROM witness w JOIN alias a USING(id) WHERE w.id=58660;

Reproduce the unconditional ranking result:
SELECT COUNT(*) AS queries, AVG(baseline), AVG(ranked), AVG(book_available)
FROM retrieval WHERE eligible>0;

Inspect an edition declaration with an independently corroborated fascicle:
SELECT w.id, w.source_literal, h.id, h.raw_heading, l.best_j, l.juan_agreement
FROM witness w JOIN retrieval r ON r.top_id=w.id
JOIN heldout h ON h.id=r.id JOIN locator_test l ON l.id=h.id
WHERE w.id=56771 AND h.id=6969;

Reconstruction and verification
Extract all package files into one directory to read the supplied database. To rebuild from source, copy the .py files into a new empty directory and run the commands below there. build.py replaces formula_links.sqlite in its working directory. cache_rows.py verifies the input SHA-256 values before extraction. The transient compressed JSON lines are local intermediates. Database bytes may vary across SQLite versions while the logical tables and values remain the same.

python cache_rows.py "PATH TO THE SOURCE WORKBOOK DIRECTORY"
python build.py
python locators.py
python sensitivity.py
python comparators.py
python stats.py
python figures.py

Python packages required are openpyxl, NumPy and pandas. Matplotlib is required for figures. SQLite, gzip and other standard-library modules ship with Python. comparators.py and stats.py print the numerical analyses, including cluster bootstrap output. Figures are rebuilt into the working directory. No model weights, API credentials or external service calls are needed. The six manually transcribed external queries are included in build.py. Documentation of the local collections' underlying transcription lineage is incomplete.

Checks on the supplied release
Run PRAGMA integrity_check and PRAGMA foreign_key_check with any SQLite client. The former returns "ok"; the latter has no result rows. The SHA-256 checksum of the supplied database is in manifest.json. For citation in this manuscript use Supplementary Data 1 with the article author, title and snapshot date. No DOI or public archive accession has been assigned.

