Repository navigation
Replies: 1 comment
|
Closing this as superseded. Since it was posted, the maintainers retired the Discussion continues on #4143. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
This is a docling-core schema proposal (that repo has discussions disabled, so posting here). Follow-up to #301 and companion to docling PR #4055, which extracts the AcroForm widget layer and is the concrete producer that wants to write these attributes.
1. Motivation
DoclingDocument's form model (
FormItem+GraphData, thefield_*labels) represents visible page content: everyGraphCelldocuments itstext/origas "text as seen on document." Interactive PDF forms carry load-bearing information that has no page presence — the AcroForm field dictionary — and the model currently has no typed slot for it. This blocks two things:FormFieldInfowhile serializing only what the schema can hold./TUtooltip in PDF/UA-1 §7.18.1, or the structure-tree label association in PDF 2.0 / PDF/UA-2. A model that cannot distinguish "visible label" from "accessible name" cannot represent the most common form-accessibility defect (visible label present,/TUmissing), the fix (generate/TUfrom the bound visible label), or the quality check (does/TUmatch the label semantically?).The same visible-vs-programmatic split runs through all accessibility tooling: HTML's
<label>vsaria-label, a picture's caption vs its alt text. DoclingDocument has crossed the "content with no pixels" bridge before, withActualText.2. Current state (verified against docling-core 2.91)
FormItem:FloatingItem+graph: GraphData. No field-level typed attributes.FieldRegionItem: bareDocItem(label + prov only).GraphCellLabel:unspecified | key | value | checkbox— no field-type taxonomy, and no state on the cell (state exists only as the DocItemLabelscheckbox_selected/checkbox_unselected).GraphLinkLabel:to_value | to_key | to_parent | to_child.NodeItem.meta/MiscAnnotation(content: dict): untyped escape hatch only.<form>structures) and the XBRL backend; docling#4055 adds the PDF widget layer.3. Proposal
Keep two layers cleanly separated:
Layer 1 — page content (unchanged): visible labels, printed values, and checkbox glyphs stay
GraphCells with provenance, linked to field items.Layer 2 — field dictionary (new, typed): attributes on the field item (
FieldRegionItem, or a newFormFieldItem), or a dedicatedFormFieldMetaobject:field_name/T(fully qualified)accessible_name/TUmapping_name/TMfield_type/FT+ flagstext | checkbox | radio | combobox | listbox | pushbutton | signaturevalue/default_value/V,/DVstate/ASvs on-stateexport_value/Opt, appearance statesrequired,readonly/Ffbitsradio_group/Twidget_ref/TU, tags, tab ordertab_order/Tabs, annot orderRelationship rule: the visible-label ↔ field binding remains a
GraphLink(to_key/to_value);accessible_nameis never inferred into the graph. A consumer wanting "the best label" gets a documented resolution order:accessible_name→ linked visible label →field_hint.4. Not PDF-specific
The HTML backend maps onto the same attributes cleanly (
name=→field_name,aria-label/title→accessible_name,<input type=>→field_type,required→required,checked→state), which keeps the model format-neutral.5. Serialization
accessible_nameastitle=in HTML export).6. Backward compatibility
All additions optional-with-defaults; existing HTML/XBRL producers unaffected; no changes to
GraphDatavalidation.7. Open questions
FormFieldItemas a new item type vs attributes onFieldRegionItem?widget_refprovenance belong — aProvenanceItemextension or a field attribute?tab_ordernow, or only with serializer work?We're happy to implement whichever shape the maintainers prefer — docling#4055's
FormFieldInfoalready carries every value in the table, so the write-side lands as a small follow-up once the schema exists.🤖 Generated with Claude Code
All reactions