DoclingDocument Data Model#
DoclingDocument is the unified output format of Docling's document parsing pipeline. It is the canonical, schema-versioned JSON representation of a parsed document — carrying all texts, tables, images, structure, and layout provenance — used across Python, Java, and the HTTP API surface.
Python canonical source: docling_core/types/doc/document.py (Pydantic models)
Java source: docling-core/src/main/java/ai/docling/core/DoclingDocument.java (Jackson-annotated, Lombok-backed)
Top-Level Structure#
The root class carries these fields :
| Field | Type | Description |
|---|---|---|
schema_name | String | Always "DoclingDocument" |
version | String | Schema version (e.g. "1.10.0") |
name | String | Working name of the document |
origin | DocumentOrigin | Source file metadata: mimetype, binary_hash, filename, uri |
body | GroupItem | Root tree node for main body content |
furniture | GroupItem | Root node for headers/footers/furniture items (deprecated in Python) |
groups | List<GroupItem> | Structural containers (list, section, slide, etc.) |
texts | List<BaseTextItem> | All text-typed nodes |
pictures | List<PictureItem> | Image/figure nodes |
tables | List<TableItem> | Table nodes |
key_value_items | List<KeyValueItem> | Key-value region nodes |
form_items | List<FormItem> | Form nodes |
field_regions | List<FieldRegionItem> | Form field regions |
field_items | List<FieldItem> | Individual form field items |
pages | Map<String, PageItem> | Page-number → page layout/image mapping |
The body and furniture nodes are GroupItems serving as tree roots; all other items are stored in flat lists and referenced by JSON Pointer ($ref, e.g. #/texts/0) via RefItem.
Item Types#
Text (BaseTextItem / texts list)#
A sealed interface with concrete implementations :
| Subtype | Notes |
|---|---|
TitleItem | Document title |
SectionHeaderItem | Has a level field |
ListItem | Has enumerated and marker |
CodeItem | Has code_language and optional image |
FormulaItem | Math expressions |
FieldHeadingItem / FieldValueItem | Form field types |
TextItem | Paragraph, caption, footnote, page header/footer, checkbox, etc. — all serialized to this type |
All text items share: selfRef, parent, children, contentLayer, label, prov (provenance list), orig (original text), text (normalized), formatting, hyperlink, source, comments.
Tables (TableItem / tables list)#
TableItem holds a data: TableData field. TableData contains:
tableCells: flatList<TableCell>with per-celltext, span indices,columnHeader/rowHeader/rowSectionflags,bbox, and an optionalreffor rich cellsgrid: the reconstructed 2-Dnum_rows × num_colsmatrixorientation: optionalOrientationenum (ROT_0/ROT_90/ etc.)
Pictures (PictureItem / pictures list)#
PictureItem has prov, image (ImageRef with mimetype, dpi, size, uri), captions, references, footnotes, and a rich PictureMeta holding classification (predicted class names + confidence), description, molecule (SMILES), tabular_chart, and code.
Key-Value / Forms (KeyValueItem, FormItem)#
KeyValueItem and FormItem both carry a graph: GraphData field. GraphData stores cells (GraphCell with label ∈ {KEY, VALUE, CHECKBOX}, text, prov) and links (GraphLink with directional label between cell IDs).
Provenance & Layout#
Every item carries a prov: List<ProvenanceItem>. ProvenanceItem records:
pageNo: 1-indexed page numberbbox:BoundingBoxwithl,t,r,bcoordinates and optionalcoordOrigin("TOPLEFT"or"BOTTOMLEFT")charspan: 2-element list[start, end](0-indexed, end-exclusive)
PageItem in the pages map provides the page's physical size (width, height) and optional rendered image reference.
Content Classification#
Each node carries two classification fields :
contentLayer(ContentLayerenum):BODY,FURNITURE,BACKGROUND,INVISIBLE,NOTES— used to filter items during export; default isBODY.label(DocItemLabelenum): structural type —TITLE,SECTION_HEADER,TABLE,PICTURE,PARAGRAPH,LIST_ITEM,CODE,FORMULA,CAPTION,FOOTNOTE,PAGE_HEADER,PAGE_FOOTER,CHECKBOX_SELECTED,CHECKBOX_UNSELECTED, etc.
Metadata (BaseMeta / FloatingMeta / PictureMeta)#
All nodes accept an optional meta field. BaseMeta provides: summary, language (BCP 47), entities (NER mentions with charspan), keywords, topics. FloatingMeta adds description; PictureMeta further adds classification, molecule, tabular_chart, code. Keywords and topics are deduplicated and order-preserving .
Java Library Details#
The Java model lives in docling-project/docling-java under docling-core/. It mirrors the Python wire format exactly using Jackson @JsonProperty for snake_case mapping and @JsonSubTypes for polymorphic text item deserialization. All builders are Lombok-generated and @Jacksonized. Null collection fields deserialize as empty lists via @JsonSetter(nulls = Nulls.AS_EMPTY) .
Test coverage in DoclingDocumentTests.java provides concrete JSON round-trip examples for all major sub-types.
Key Source Files#
| File | Purpose |
|---|---|
docling_core/types/doc/document.py | Python canonical model (Pydantic) |
docling_core/types/doc/base.py | BoundingBox, CoordOrigin, Size |
docling_core/types/doc/labels.py | DocItemLabel, PictureClassificationLabel enums |
DoclingDocument.java | Java mirror model (all inner classes) |
DoclingDocumentTests.java | Java round-trip examples |