Commands for working with the structured data layer of a KDDB document. Data objects represent extracted information organized hierarchically, with attributes holding values and exceptions tracking issues.
Subcommands
| Command | Description |
|---|
data objects | List all data objects |
data attributes <id> | Show attributes for a data object |
data exceptions | List data exceptions |
data create | Create a new data object |
data set-attribute | Set an attribute on a data object |
Data Objects
List all data objects with their path, parent, and attribute counts.
kdx document data objects <file.kddb> [flags]
| Flag | Description | Default |
|---|
--parent-id N | Filter by parent data object ID | |
--pretty | Pretty-print JSON output | false |
kdx document data objects invoice.kddb --pretty
{"id":1,"path":"INVOICE","attributeCount":3,"childCount":2}
{"id":2,"path":"INVOICE/LINE_ITEM","parentId":1,"attributeCount":4,"childCount":0}
{"id":3,"path":"INVOICE/LINE_ITEM","parentId":1,"attributeCount":4,"childCount":0}
Data Attributes
Show all attributes for a specific data object.
kdx document data attributes <object-id> <file.kddb> [flags]
kdx document data attributes 1 invoice.kddb --pretty
{"id":1,"tag":"vendor_name","value":"Acme Corp","confidence":0.95,"type":"STRING"}
{"id":2,"tag":"invoice_date","value":"2024-01-15","confidence":0.92,"type":"DATE"}
{"id":3,"tag":"total_amount","value":"1234.56","confidence":0.98,"type":"CURRENCY"}
Data Exceptions
List data exceptions (validation errors, extraction issues).
kdx document data exceptions <file.kddb> [flags]
| Flag | Description | Default |
|---|
--open | Show only open exceptions | false |
--object-id N | Filter by data object ID | |
--pretty | Pretty-print JSON output | false |
kdx document data exceptions invoice.kddb --open
{"id":1,"message":"Missing required field","exceptionType":"VALIDATION","severity":"ERROR","open":true,"dataObjectId":2,"path":"INVOICE/LINE_ITEM"}
Data Create
Create a new data object in the document.
kdx document data create <file.kddb> --path <taxonomy-path> [flags]
| Flag | Description | Default |
|---|
--path | Taxonomy path (required) | |
--taxonomy-ref | Taxonomy reference | |
--parent-id N | Parent data object ID | |
kdx document data create invoice.kddb --path "INVOICE/LINE_ITEM" --parent-id 1
{
"id": 4,
"path": "INVOICE/LINE_ITEM"
}
Data Set-Attribute
Create or set a data attribute on a data object.
kdx document data set-attribute <file.kddb> --object-id <id> --tag <name> [flags]
| Flag | Description | Default |
|---|
--object-id N | Data object ID (required) | |
--tag | Attribute tag/name (required) | |
--value | Attribute value | |
--type | Attribute type (STRING, CURRENCY, DATE, NUMBER, etc.) | STRING |
--confidence | Confidence score (0.0-1.0) | 1.0 |
--tag-uuid | Tag UUID for linking to a tagged node | |
kdx document data set-attribute invoice.kddb \
--object-id 4 --tag "description" --value "Widget A" --type STRING
{
"id": 10,
"dataObjectId": 4,
"tag": "description",
"value": "Widget A",
"type": "STRING"
}
Linking to Tagged Nodes
Use --tag-uuid to connect an attribute to its source node for provenance:
# First, tag the source node
kdx document tag invoice.kddb --node-id 245 --name "line_item/amount"
# Output: {"nodeId":245,"tag":"line_item/amount","tagId":1,"tagUuid":"a1b2c3d4-..."}
# Then link the attribute to the tag
kdx document data set-attribute invoice.kddb \
--object-id 4 --tag "amount" --value "1234.56" --type CURRENCY \
--tag-uuid "a1b2c3d4-..."
The create and set-attribute commands modify the document. They open the file in write mode (non-detached) automatically.
Use --tag-uuid to maintain provenance between extracted values and their source nodes in the document.