> ## Documentation Index
> Fetch the complete documentation index at: https://docs.axiomancer.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Entity graph export

> A Parquet edge-list export for multi-hop reasoning over Codex entities — ownership, sanctions, civic approvals, and vessel-sanction chains. Enterprise tier.

Vector search alone fails on multi-hop reasoning — corporate ownership chains, compliance lineage, cascading civic approvals, vessel-to-company-to-sanction chains. The entity graph export gives you a compact, queryable edge list you can import into your own graph layer.

<Note>
  The entity graph export is available on the **Enterprise tier** only. It ships as `codex_entity_graph.parquet` alongside per-dataset slices and a stats sidecar with every Enterprise catalog purchase.
</Note>

## What you get

A single Parquet edge-list file (Snappy-compressed) with per-dataset slices. This is not a graph database — you import it into your own graph engine (Neo4j, Kuzu, TigerGraph, DuckDB, NetworkX, or similar).

Expected size at launch: approximately 8–12 million edges across all dataset families.

## Edge schema

Each edge in the graph has the following fields:

| Field              | Type      | Description                                                         |
| ------------------ | --------- | ------------------------------------------------------------------- |
| `from_id`          | string    | APRS URN or raw ID (e.g. H3 index, MMSI)                            |
| `from_type`        | string    | Node type of the source (see [node types](#node-types))             |
| `edge_type`        | string    | Relationship type (see [edge types](#edge-types))                   |
| `to_id`            | string    | APRS URN or raw ID                                                  |
| `to_type`          | string    | Node type of the target                                             |
| `confidence`       | float     | Pipeline confidence in the edge, 0 to 1                             |
| `source_dataset`   | string    | Which Codex dataset emitted it                                      |
| `source_record_id` | string    | Record that generated the edge (for provenance)                     |
| `valid_from`       | date      | When the relationship became true                                   |
| `valid_to`         | date      | When it stopped being true (null = currently valid)                 |
| `extracted_at`     | timestamp | When the pipeline extracted the edge                                |
| `extractor`        | string    | Name and version of the extractor                                   |
| `evidence_anchor`  | JSON      | `{doc_id, page, span}` where applicable                             |
| `attrs`            | JSON      | Edge-type-specific metadata (e.g. vote tally, ownership percentage) |

## Node types

Every node is addressable by a stable ID. Most use [APRS URNs](/codex/join-keys).

| Node type             | ID format                                | Source                                 |
| --------------------- | ---------------------------------------- | -------------------------------------- |
| `entity:person`       | `urn:aprs:entity:person:{id}`            | Civic records, OSHA, entity resolution |
| `entity:organization` | `urn:aprs:entity:company:{id}`           | Government records, permits            |
| `entity:agency`       | `urn:aprs:entity:agency:{id}`            | Issuing authorities                    |
| `entity:vessel`       | `urn:aprs:record:maritime:vessel:{imo}`  | AIS and Equasis                        |
| `entity:trust`        | `urn:aprs:entity:trust:{id}`             | Beneficial ownership resolution        |
| `record:civic`        | `urn:aprs:record:civic:us:{source}:{id}` | Civic Intelligence                     |
| `record:permit`       | `urn:aprs:record:permit:...`             | Permit Signals                         |
| `record:event`        | `urn:axiom:event:{uuid}`                 | Events Timeline                        |
| `record:osha_case`    | `urn:aprs:record:osha:case:{id}`         | OSHA Safety                            |
| `record:poi`          | `urn:aprs:record:poi:{source}:{id}`      | POI Intelligence                       |
| `record:parcel`       | `{jurisdiction_slug}:{parcel-number}`    | Permits, assessor feeds                |
| `h3_cell`             | Raw H3 res-8 string                      | Derived across datasets                |
| `port`                | `urn:axiom:port:{unlocode}`              | AIS Maritime                           |
| `jurisdiction`        | `jurisdiction_slug`                      | Civic, Permits                         |

## Edge types

### Civic

| Edge type         | Direction                           | Attributes                             |
| ----------------- | ----------------------------------- | -------------------------------------- |
| `SUPPORTS`        | entity:person → record:civic        | `mention_count`, `excerpt_span`        |
| `OPPOSES`         | entity:person → record:civic        | `mention_count`, `excerpt_span`        |
| `ABSTAINS_ON`     | entity:person → record:civic        | `mention_count`, `excerpt_span`        |
| `MENTIONS`        | record:civic → entity               | `sentiment`, `role`, `mention_count`   |
| `REPRESENTS`      | entity:person → entity:organization | `capacity` (attorney, lobbyist, staff) |
| `HAS_CONFLICT_ON` | entity:person → record:civic        | `source`                               |
| `AMENDS`          | record:civic → record:civic         | `relationship_type`                    |

### Events

| Edge type   | Direction                   | Attributes                                 |
| ----------- | --------------------------- | ------------------------------------------ |
| `FOLLOWS`   | record:event → record:event | `lag_days`                                 |
| `TRIGGERED` | record:event → record:event | Reverse of `FOLLOWS` for cascade detection |
| `AFFECTS`   | record:event → entity       | When event has an `entity_id`              |
| `OCCURS_AT` | record:event → h3\_cell     | Spatial index                              |

### Maritime

| Edge type       | Direction                           | Attributes                                  |
| --------------- | ----------------------------------- | ------------------------------------------- |
| `CALLED_AT`     | entity:vessel → port                | `eta`, `ata`, `etd`, `atd`, `berth_id`      |
| `OWNS`          | entity:organization → entity:vessel | `ownership_pct`, `effective_from`, `source` |
| `MANAGES`       | entity:organization → entity:vessel | `source`                                    |
| `FLAGS`         | entity:vessel → jurisdiction        | `flag_state_iso3`                           |
| `SANCTIONED_BY` | entity:organization → jurisdiction  | `sanctions_list`, `listed_on`               |

### Permits

| Edge type       | Direction                                     | Attributes           |
| --------------- | --------------------------------------------- | -------------------- |
| `LOCATED_IN`    | record:permit → h3\_cell                      | Direct H3 mapping    |
| `LOCATED_ON`    | record:permit → record:parcel                 | When parcel is known |
| `APPLIED_BY`    | record:permit → entity                        | Applicant            |
| `ISSUED_BY`     | record:permit → entity:agency                 | Authority            |
| `CONTINGENT_ON` | record:permit → record:permit or record:civic | Scope dependency     |

### Urban Signal Grid

| Edge type   | Direction                              | Attributes                     |
| ----------- | -------------------------------------- | ------------------------------ |
| `HAS_SCORE` | h3\_cell → score node                  | `composite_score`, `scored_at` |
| `CONTAINS`  | h3\_cell → record:poi or record:permit | Spatial join                   |
| `NEIGHBORS` | h3\_cell → h3\_cell                    | `k: 1` (direct neighbor only)  |

### OSHA

| Edge type          | Direction                                 | Attributes                      |
| ------------------ | ----------------------------------------- | ------------------------------- |
| `ENFORCED_AGAINST` | record:osha\_case → entity:organization   | `penalty_usd`, `citation_count` |
| `PARENT_OF`        | entity:organization → entity:organization | Corporate parent links          |
| `AT_FACILITY`      | record:osha\_case → record:poi            | When FRS match exists           |

## Example queries

You can query the graph directly with DuckDB and Parquet — no external graph database required.

### Vessel → owner → sanctions → sister vessels

```sql theme={null}
WITH owners AS (
  SELECT from_id AS owner_id
  FROM codex.entity_graph
  WHERE edge_type = 'OWNS' AND to_id = :vessel_urn
),
sanctioned AS (
  SELECT from_id AS owner_id
  FROM codex.entity_graph
  WHERE edge_type = 'SANCTIONED_BY'
    AND from_id IN (SELECT owner_id FROM owners)
),
other_vessels AS (
  SELECT to_id AS sister_vessel
  FROM codex.entity_graph
  WHERE edge_type = 'OWNS'
    AND from_id IN (SELECT owner_id FROM sanctioned)
    AND to_id != :vessel_urn
)
SELECT * FROM other_vessels;
```

### Recursive cascade — downstream records from a dark event (up to 3 hops)

```sql theme={null}
WITH RECURSIVE reachable(id, hop) AS (
  SELECT :seed_event_uuid, 0
  UNION ALL
  SELECT e.to_id, r.hop + 1
  FROM codex.entity_graph e
  JOIN reachable r ON e.from_id = r.id
  WHERE e.edge_type IN ('FOLLOWS', 'TRIGGERED', 'AFFECTS')
    AND r.hop < 3
)
SELECT r.id, r.hop, e.to_type
FROM reachable r
JOIN codex.entity_graph e ON e.from_id = r.id;
```

## Provenance

Every emitted edge carries `evidence_anchor`, `extractor`, and `confidence`, following the same contract as the [claim/fact layer](/codex/claim-fact-layer). You can join edges on `source_record_id` back to the record's `claims[]` array for full provenance.

## Tier availability

| Tier       |                  Graph export included                  |
| ---------- | :-----------------------------------------------------: |
| Research   |                            No                           |
| Commercial |                            No                           |
| Enterprise | Yes — full graph, per-dataset slices, and stats sidecar |
