Lore Graph
Projects are mostly relationships, causality, facts, and changes over time. A graph model fits this better than a folder of notes.
Nodes
A node represents a meaningful resource in the project.
Common node types:
- Character
- Faction
- Location
- Item
- Secret
- Event
- Scene
- PlotThread
- Continuity
- Publication
Edges
An edge represents a relationship between two resources.
Examples:
Character -> belongs_to -> Faction
Faction -> controls -> Location
Character -> knows -> Secret
Event -> reveals -> Secret
Event -> advances -> PlotThread
Scene -> occurs_at -> Location
Character -> opposes -> Character
Faction -> funds -> Faction
Why This Matters
Graph relationships make questions easier to answer.
Examples:
Who knows this secret?
Which factions control locations near this city?
Which characters are connected to this plot thread?
What events were caused by this faction?
Which scenes can reveal this secret?
Implementation Note
The service does not have to use a graph database on day one. A relational database can model nodes and edges with tables.
A simple start:
entities
id
project_id
entity_type
name
body
metadata
relationships
id
project_id
source_resource_id
relation_type
target_resource_id
visibility
metadata
The current code starts with entity-to-entity relationships. The target model should leave room for resource-to-resource relationships so events, facts, scenes, and publications can participate in the graph when needed.