Form Format
Form Format
Section titled “Form Format”Definition
Section titled “Definition”Closed enumeration of the file format a form instance arrives in: docx, xlsx, pdf, html, md. CORE per §6.2 — closed by what platform supports. Drives extraction-route selection in the form pipeline (the cataloguer reads the format → applies the right extraction approach per source §4.5).
Reference corrected (id-417 B3 ruling, S535): this CV’s original substrate — a planned form_templates.form_format column — never landed, and form_templates was itself renamed form_instances at {145.6} W1c. The live substrate is form_instances.mime_type (nullable text carrying MIME strings, e.g. application/pdf), which encodes the same axis at a different grain. Any future enforcement of this closed set needs an explicit MIME→format mapping; no CHECK exists today.
Synonyms / Acronyms
Section titled “Synonyms / Acronyms”None.
Baseline values
Section titled “Baseline values”| key | label | provenance |
|---|---|---|
| docx | DOCX | core |
| xlsx | XLSX | core |
| core | ||
| html | HTML | core |
| md | Markdown | core |
Relationships
Section titled “Relationships”form_instances.mime_type— the live column carrying this axis (nullable text, MIME strings; corrected reference per the id-417 B3 ruling — the previously-citedform_templates.form_formatcolumn never existed and the table is nowform_instances).- No
form_formatstable or CHECK exists; enforcement, if ever needed, is a future migration plus a MIME→format mapping. - Adjacent to CV 26
form_type— same form_type may exist in multiple formats (XLSX SSQ + PDF SSQ + DOCX SSQ all map to form_type=SSQ per source §4.5). - Layer 5: drives format-specific extraction routes (Docling for DOCX/XLSX/PDF, Turndown / mammoth for HTML, etc.).
Consumers
Section titled “Consumers”- Form-extraction pipeline (cataloguer step) — chooses extraction route per format.
- Form template upload UI surface (validates supported formats).
- Existing extraction code paths the future cataloguer leverages:
lib/source-documents/(mammoth + Turndown for HTML),scripts/kb_pipeline/extract.py(PDF via pdfplumber), Docling adapter (XLSX/DOCX/PDF — WP-DOCLING-XLSX bake-off).
- Status: needed — vocabulary not yet enumerated as a table.
- Closed CORE per §6.2 — no client extension; expansion requires platform-support work plus a schema migration.
- mammoth (HTML) and Docling / markitdown (XLSX, DOCX, PDF) are the referenced extraction routes per source §6 implications and the WP-DOCLING-XLSX bake-off.