File size: 1,188 Bytes
1966985
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# Data Model: Graph View

## Entities

### GraphNode
Represents a single note in the graph.

| Field | Type | Description |
|-------|------|-------------|
| `id` | `str` | Unique identifier (Note Path). |
| `label` | `str` | Display title of the note. |
| `val` | `int` | Weight/Size of the node (default: 1 + link_degree). |
| `group` | `str` | Grouping category (e.g., top-level folder). |

### GraphLink
Represents a directed connection between two notes.

| Field | Type | Description |
|-------|------|-------------|
| `source` | `str` | ID of the source note. |
| `target` | `str` | ID of the target note. |

### GraphData
The top-level payload returned by the API.

| Field | Type | Description |
|-------|------|-------------|
| `nodes` | `List[GraphNode]` | All notes in the vault. |
| `links` | `List[GraphLink]` | All resolved connections. |

## Database Mapping

-   **Nodes**: Sourced from `note_metadata` table.
    -   `id` <- `note_path`
    -   `label` <- `title`
    -   `group` <- `note_path` (parsed parent directory)
-   **Links**: Sourced from `note_links` table.
    -   `source` <- `source_path`
    -   `target` <- `target_path`
    -   Filter: `is_resolved = 1`