# ValueChain.wiki: data model and machine endpoints

> The data model behind the money-flow graph (who earns revenue from whom, who pays costs to whom) and the machine-readable URLs for every company and analysis. Each fact is an edge from a company to a named counterparty (linked to its node when one exists), backed by source observations that each carry a date and a stance.

## Document URLs

Replace `<slug>` with a company or analysis slug; every slug is listed in https://valuechain.wiki/llms.txt?lang=en
Company, question-shaped and analysis markdown is Korean by default; add ?lang=en for English.

- `https://valuechain.wiki/<slug>.md`: Company node as LLM-reasoning markdown. Supports ?lang=en.
- `https://valuechain.wiki/<slug>.json`: Structured JSON. Lossless bilingual (both ko and en fields).
- `https://valuechain.wiki/<slug>/customers.md`: Question-shaped doc: who pays this company (customers and investors). Supports ?lang=en.
- `https://valuechain.wiki/<slug>/suppliers.md`: Question-shaped doc: who this company pays (suppliers and investees). Supports ?lang=en.
- `https://valuechain.wiki/<slug>/ripple.md`: Question-shaped doc: value-chain ripple (leading demand chain, benefiting supply chain). Supports ?lang=en.
- `https://valuechain.wiki/analysis/<slug>.md`: Analysis article as LLM-reasoning markdown. Supports ?lang=en.
- `https://valuechain.wiki/schema.md`: This data model as English markdown (tables, field meanings, document URL rules).
- `https://valuechain.wiki/llms.txt`: Agent discovery index (all companies + .md links).

## Tables

All tables are public read-only via PostgREST. A versioned, authenticated API is planned.

### vc_companies: Company nodes

| Field | Type | Meaning |
|---|---|---|
| slug | text | URL identifier (unique) |
| name / name_en | text | Company name (KO/EN) |
| ticker | text | Ticker (e.g. NVDA, 000660.KS) |
| kicker / lead (+_en) | text | Free-text category and summary (KO/EN) |
| categories | text[] | 1-3 business category keys (controlled vocabulary vc_vocab_categories, themes in vc_vocab_themes). Null on nodes not yet assigned |
| category_primary | text | The one category key used for weighting (always within categories) |
| segments / segments_en | jsonb | Total revenue, concentration, segments |
| name_ko / country | text | Korean name (for foreign firms) and country code |
| returns_yearly / return_asof | jsonb/date | Yearly returns {year:%} and as-of date (heatmap) |
| price / price_currency / price_asof | num/text/date | Current price, currency, as-of (shown beside ratings) |
| analysis_ko / analysis_en / analysis_asof | text/date | Value-chain verification note (KO/EN) and as-of |
| updated_at | date | Last updated (home sort key) |

### vc_edges: Money-flow edges

| Field | Type | Meaning |
|---|---|---|
| company_id | uuid | Source node |
| direction | text | 'revenue' (counterparty pays this company) \| 'cost' (this company pays the counterparty) \| 'investor' (counterparty invests in this company) \| 'investment' (this company invests in the counterparty) |
| counterparty_name | text | Counterparty name |
| counterparty_id | uuid | Counterparty node (links the graph when present) |
| confidence | text | 'high' \| 'mid' \| 'low' |
| metric | jsonb | Normalized metric {type,value,unit,period,basis,qualifier} |
| note (+_en) | text | Note (KO/EN) |

### vc_edge_sources: Observations (edge × source)

| Field | Type | Meaning |
|---|---|---|
| edge_id / source_id | uuid | Edge and source references |
| stance | text | 'confirms' \| 'mentions' \| 'contradicts' |
| as_of | date | Observation date |
| metric | jsonb | Per-observation normalized metric |
| excerpt (+_en) | text | Source excerpt (KO/EN) |

### vc_sources: Sources

| Field | Type | Meaning |
|---|---|---|
| url | text | Source URL (unique) |
| title (+_en) | text | Title (KO/EN) |
| publisher (+_en) | text | Publisher (KO/EN) |
| kind | text | 'filing' \| 'news' \| 'ir' \| 'research' |
| published_at / lang | date/text | Published date and language (ko/en) |

### vc_analyst_ratings: Broker analyst ratings

| Field | Type | Meaning |
|---|---|---|
| company_id | uuid | Rated node |
| broker (+_en) / analyst | text | Broker (KO/EN) and analyst |
| rating / rating_norm | text | Raw rating and normalized ('buy'\|'hold'\|'sell') |
| target_price / currency | num/text | Target price and currency |
| report_title (+_en) / report_url | text | Report title (KO/EN) and URL |
| summary_ko / summary_en | text | Summary (KO/EN) |
| published_at / accessed_at | date | Report date and access date |

### vc_articles: Analysis articles

| Field | Type | Meaning |
|---|---|---|
| slug | text | URL identifier (unique) |
| title / summary (+_en) | text | Title and summary (KO/EN) |
| body_ko / body_en | text | Body markdown (bilingual) |
| tags (+_en) / related_slugs | text[] | Tags and related node slugs |
| faq | jsonb | Q&A [{q,a,q_en,a_en}], rendered as FAQPage JSON-LD |
| positions | jsonb | Position groups (returns live-joined from nodes) |
| changelog | jsonb | Change log [{date,note,note_en}], newest first |
| pinned / sort_order | bool/int | Pin to top (house view) and reading order |
| published_at / updated_at | date | Published and updated dates |

### vc_roadmap: Update and expansion log

| Field | Type | Meaning |
|---|---|---|
| entry_date | date | Entry date |
| kind | text | 'update' (done) \| 'planned' |
| status | text | 'done' \| 'in_progress' \| 'planned' |
| title (+_en) / detail (+_en) | text | Title and detail (KO/EN) |
| sort_order | int | Sort order (unique) |

### vc_crawl_log: AI crawl and citation log

| Field | Type | Meaning |
|---|---|---|
| ts / path | timestamp/text | Crawl time and requested path |
| site | text | Site key. This site is 'valuechain'; other sites log to the same table, so filter on it |
| category | text | Record kind: 'ai' (AI crawler) \| 'search' (search or link preview) \| 'attack' (blocked secret probe) \| 'referral' (person arriving from an AI answer) \| 'referral_nav' (their browsing over the next 30 min) \| 'panel_nav' (chain panel opened) \| 'cta_portle' (Portle prompt clicked) \| 'cta_lang_en' (read-in-English prompt clicked) |
| bot | text | Bot name matched in the User-Agent for ai, search and attack (scanner if attack has none), answer engine name for referral and referral_nav, panel-revenue\|panel-cost for panel_nav, cta-portle\|cta-portle-top for cta_portle, cta-lang-en for cta_lang_en. Train, index and cite stages are not stored; they are derived from this value |
| user_agent | text | Raw User-Agent |
| country / lang | text | Request country code and first Accept-Language value |
| referer | text | Referer (source node path for panel_nav and cta_portle, absent for cta_lang_en) |
| query | text | Request query string (absent for panel_nav, cta_portle and cta_lang_en) |
