# Task 08 — Ontology: Relational Schema, Data Dictionary, Instruments Repository ## Goal Formal, versioned data model driving cleansing and all exports. Iterates with Tasks 07/09/10. ## Input - ERD (project artifact `Mary_G__LabResults__ERD.txt`), `schema/ontology_escalations.md`. ## Actions 1. Generate `schema/ddl_postgresql.sql` from the ERD: full hierarchy `ptau_data_notes → batches → coupons → samples`, four measurement branches, `atmospheres` lookup, `measurement_types` + `column_definitions`. 2. Generate `schema/data_dictionary.csv`: per measurement type — column name, unit, dtype, ordinal, description (source: the mappings of Task 07). 3. Create `schema/instruments_repository.csv`: instrument id, type, measurement type produced, measured quantities, units, valid min/max ranges, resolution. Populate incrementally from tokens + column signatures; ranges feed Task 09 anomaly rules. 4. Maintain `schema/ontology_notes.md`: every schema change with rationale (append-only). 5. Version the DDL (`-- schema_version: N` header); bump on each iteration. ## Intermediate Result (done when) - DDL, data dictionary, and Instruments Repository are mutually consistent and cover all mapped fingerprints. - No open items in `ontology_escalations.md`.