# Ontology Model: Objects, Links, Terms & Rules

Canonical URL: https://naditu.com/docs/ontology-model
Section: 01 · Objects · Links · Terms

Raw enterprise tables rarely declare foreign keys across modules and never declare links across separate vendors. Naditu records business objects, verified join paths, aggregation boundaries and local status-code meanings in one versioned layer.

- **Core primitives:** Objects, Links, Terms, Rules
- **Cross-system joins:** Declared keys + evidence-backed learned links
- **Aggregation safety:** Pre-join 1:N chasm-trap isolation

## One business entity across fragmented tables (#canonical-objects)

In a typical manufacturing or distribution stack, a single customer exists simultaneously as a CRM account record, an ERP receivables card (CUST), a quality-complaint party and a shipping consignee. Asking an LLM to reconcile those tables at prompt time produces brittle SQL and mismatched totals.

Naditu defines canonical objects—such as Customer, Order, Item, Work order, Shipment and Invoice—whose properties point back to their authoritative operational source while preserving field-level visibility rules.

| Canonical object | Authoritative sources | Key properties | Field-level rule |
| --- | --- | --- | --- |
| Customer | CRM account · ERP CUST · QMS | Name, Account code, Payment terms, Credit limit | Credit limit -> Finance only |
| Order | ERP ORD_HDR · ORD_LIN · CRM | Order number, Due date, Status (STAT), Quoted price | Quoted price -> Sales, Finance |
| Item | ERP ITM · WMS · PLM docs | Item code, Drawing revision, Stock on hand, Unit cost | Unit cost -> Purchasing, Finance |
| Work order | ERP / MES WO_HDR · Maintenance | Work order number, Planned qty, Machine, Scrap rate | Visible to Planning & Plant ops |
| Invoice | ERP AR_INV · e-Invoice ledger | Invoice number, Due date, Amount, Paid status | Paid status -> Finance only |

## Evidence-backed cross-system join paths (#learned-links)

Database schemas state only a fraction of the joins a real business question needs. An ERP may declare ORD_LIN.ORD_ID = ORD_HDR.ID, yet leave ORD_HDR.CUSTREF = CUST.REF, WO_HDR.LINREF = ORD_LIN.REF and CRM account.erp_code = CUST.CODE completely undeclared.

Naditu combines declared foreign keys with learned links discovered from column naming conventions, record-for-record value overlap and existing production reports—each confirmed by the process owner before entering the live ontology.

| Join edge | Predicate | Kind | Verification evidence |
| --- | --- | --- | --- |
| CRM Accounts -> ERP Customers | account.erp_code = CUST.CODE | Learned | Record-for-record account code match across CRM and ERP |
| ERP Customers -> ERP Orders | ORD_HDR.CUSTREF = CUST.REF | Learned | Foreign reference column verified against 100% of active CUST keys |
| ERP Orders -> Order lines | ORD_LIN.ORD_ID = ORD_HDR.ID | Declared | Primary-to-foreign key constraint read directly on connection |
| Order lines -> Work orders | WO_HDR.LINREF = ORD_LIN.REF | Learned | Extracted from plant planning report and confirmed by Planning lead |

## Preventing 1:N fan-out and chasm traps (#chasm-traps)

When a single sales order line spawns three shop-floor work orders (for example, split batches or rework) and two partial shipments, a naive flat SQL JOIN multiplies ORD_LIN quoted value and unit cost three to six times.

Because every link in the Naditu ontology carries explicit cardinality metadata (1:1, 1:N, N:M) and grain ownership, the query planner isolates line-level financial sums in pre-aggregated subqueries before joining downstream work orders or shipments.

- **Every metric binds to its native table grain (`Grain declaration`):** Order value and unit_cost belong to ORD_LIN grain, whereas scrap_pct and produced_qty belong to WO_HDR grain. No ad-hoc prompt can sum across mixed grains.
- **Period-numbered ERP schemas resolved automatically (`Fiscal & period routing`):** For ERPs that partition tables by company and fiscal period (such as LG_001_01_STLINE), the ontology routes cross-year comparisons without hardcoded table names.

## Local status-code dictionaries confirmed by your team (#status-dictionaries)

Integer status columns are the single most common source of silent AI hallucinations on ERP data. Left to guess what ORD_HDR.STAT = 4 means, a language model routinely assumes 4 means "closed" or "cancelled", undercounting unbilled shipments.

Naditu builds each term entry from four sources: existing internal documentation, schema-guided proposals, human confirmation by process owners and phrasing observed in everyday questions. Nothing enters the live dictionary on a model proposal alone.

### ontology/terms/ord_hdr_stat.json · confirmed dictionary entry

```json
{
  "object": "Order",
  "source_column": "ERP.ORD_HDR.STAT",
  "state": "confirmed",
  "version": "v13",
  "confirmed_by_role": "sales.lead",
  "values": {
    "1": {
      "label": "open",
      "billable_exposure": true
    },
    "2": {
      "label": "in production",
      "billable_exposure": true
    },
    "4": {
      "label": "shipped, not yet invoiced",
      "billable_exposure": true,
      "note": "Goods left the warehouse; AR invoice still pending"
    }
  },
  "synonyms_observed": "where is my order, shipped unbilled, awaiting invoice"
}
```
