Expand description
Graph representation of narratives.
This module provides tools for representing narratives as directed graphs where events are nodes and relationships (temporal, spatial, thematic) are edges.
§Example
use spatial_narrative::graph::{NarrativeGraph, EdgeType};
use spatial_narrative::core::{Event, Location, Timestamp};
// Create events
let e1 = Event::new(Location::new(40.7, -74.0), Timestamp::now(), "Event 1");
let e2 = Event::new(Location::new(40.7, -74.0), Timestamp::now(), "Event 2");
// Build graph
let mut graph = NarrativeGraph::new();
let n1 = graph.add_event(e1);
let n2 = graph.add_event(e2);
graph.connect(n1, n2, EdgeType::Temporal);
assert_eq!(graph.node_count(), 2);
assert_eq!(graph.edge_count(), 1);Structs§
- DotOptions
- Options for DOT export formatting.
- Edge
Weight - Weight/metadata for an edge in the graph.
- Narrative
Graph - A directed graph representing events and their relationships.
- NodeId
- Unique identifier for a node in the narrative graph.
- Path
Info - Information about a path through the graph.
- Subgraph
Result - Result of subgraph extraction.
Enums§
- Edge
Type - Type of relationship between events.