Expand description

Load the Lord of the Rings dataset into a graph. The dataset is available at https://raw.githubusercontent.com/Raphtory/Data/main/lotr.csv and is a list of interactions between characters in the Lord of the Rings books and movies. The dataset is a CSV file with the following columns:

  • src_id: The ID of the source character
  • dst_id: The ID of the destination character
  • time: The time of the interaction (in page)

Dataset statistics

  • Number of nodes (subreddits) 139
  • Number of edges (hyperlink between subreddits) 701

Example:

use raphtory_io::graph_loader::example::lotr_graph::lotr_graph;
use raphtory::db::graph::Graph;
use raphtory::db::view_api::*;

let graph = lotr_graph(1);

println!("The graph has {:?} vertices", graph.num_vertices());
println!("The graph has {:?} edges", graph.num_edges());

Structs

Functions

  • Downloads the LOTR.csv file from Github and returns the path to the file
  • Constructs a graph from the LOTR dataset Including all edges, nodes and timestamps