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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
//! `GraphLoader` provides some default implementations for loading a pre-built graph.
//! This base class is used to load in-built graphs such as the LOTR, reddit and StackOverflow.
use cratePyGraph;
use *;
use PathBuf;
use Runtime;
/// 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
///
///
/// Returns:
/// Graph: A Graph containing the LOTR dataset
/// Same as `lotr_graph()` but with additional properties race and gender for some of the nodes
///
/// Returns:
/// Graph:
/// Load (a subset of) Reddit hyperlinks dataset into a graph.
/// The dataset is available at http://snap.stanford.edu/data/soc-redditHyperlinks-title.tsv
/// The hyperlink network represents the directed connections between two subreddits (a subreddit
/// is a community_detection on Reddit). We also provide subreddit embeddings. The network is extracted
/// from publicly available Reddit data of 2.5 years from Jan 2014 to April 2017.
/// *NOTE: It may take a while to download the dataset*
///
/// Dataset statistics:
/// * Number of nodes (subreddits) 35,776
/// * Number of edges (hyperlink between subreddits) 137,821
/// * Timespan Jan 2014 - April 2017
///
/// Source:
/// * S. Kumar, W.L. Hamilton, J. Leskovec, D. Jurafsky. Community Interaction and Conflict
/// on the Web. World Wide Web Conference, 2018.
///
/// Properties:
///
/// * SOURCE_SUBREDDIT: the subreddit where the link originates
/// * TARGET_SUBREDDIT: the subreddit where the link ends
/// * POST_ID: the post in the source subreddit that starts the link
/// * TIMESTAMP: time of the post
/// * POST_LABEL: label indicating if the source post is explicitly negative towards the target
/// post. The value is -1 if the source is negative towards the target, and 1 if it is neutral or
/// positive. The label is created using crowd-sourcing and training a text based classifier, and
/// is better than simple sentiment analysis of the posts. Please see the reference paper for details.
/// * POST_PROPERTIES: a vector representing the text properties of the source post, listed as a
/// list of comma separated numbers. This can be found on the source website
///
/// Arguments:
/// timeout_seconds (int): The number of seconds to wait for the dataset to download. Defaults to 600.
///
/// Returns:
/// Graph: A Graph containing the Reddit hyperlinks dataset
/// Returns the Reddit hyperlink graph example.
///
/// Arguments:
/// file_path (str):
///
/// Returns:
/// Graph:
/// Returns the stablecoin graph example.
///
/// Arguments:
/// path (str):
/// subset (bool):
///
/// Returns:
/// Graph:
/// Returns the neo4j movie graph example.
///
/// Arguments:
/// uri (str):
/// username (str):
/// password (str):
/// database (str):
///
/// Returns:
/// Graph:
/// `karate_club_graph` constructs a karate club graph.
///
/// This function uses the Zachary's karate club dataset to create
/// a graph object. Nodes represent members of the club, and edges
/// represent relationships between them. Node properties indicate
/// the club to which each member belongs.
///
/// Background:
/// These are data collected from the members of a university karate club by Wayne
/// Zachary. The ZACHE matrix represents the presence or absence of ties among the members of the
/// club; the ZACHC matrix indicates the relative strength of the associations (number of
/// situations in and outside the club in which interactions occurred).
/// Zachary (1977) used these data and an information flow model of network conflict resolution
/// to explain the split-up of this group following disputes among the members.
///
/// Reference:
/// Zachary W. (1977). An information flow model for conflict and fission in small groups. Journal of Anthropological Research, 33, 452-473.
///
/// Returns:
/// Graph: