Skip to main content
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

CommandDescription
data objectsList all data objects
data attributes <id>Show attributes for a data object
data exceptionsList data exceptions
data createCreate a new data object
data set-attributeSet 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]
FlagDescriptionDefault
--parent-id NFilter by parent data object ID
--prettyPretty-print JSON outputfalse
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]
FlagDescriptionDefault
--openShow only open exceptionsfalse
--object-id NFilter by data object ID
--prettyPretty-print JSON outputfalse
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]
FlagDescriptionDefault
--pathTaxonomy path (required)
--taxonomy-refTaxonomy reference
--parent-id NParent 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]
FlagDescriptionDefault
--object-id NData object ID (required)
--tagAttribute tag/name (required)
--valueAttribute value
--typeAttribute type (STRING, CURRENCY, DATE, NUMBER, etc.)STRING
--confidenceConfidence score (0.0-1.0)1.0
--tag-uuidTag 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.