raphtory
Raphtory graph analytics library
- class raphtory.Graph
Bases:
GraphView
A temporal graph.
- __new__(**kwargs)
- add_edge(timestamp, src, dst, properties=Ellipsis, layer=Ellipsis)
Adds a new edge with the given source and destination vertices and properties to the graph.
- add_edge_properties(src, dst, properties, layer=Ellipsis)
Adds properties to an existing edge.
- add_vertex(timestamp, id, properties=Ellipsis)
Adds a new vertex with the given id and properties to the graph.
- add_vertex_properties(id, properties)
Adds properties to an existing vertex.
- at(end)
Create a view including all events until end (inclusive)
- Parameters
end (int) – the end time of the window
- Returns
a view including all events until end (inclusive)
- default_layer()
Create a view including all the edges in the default layer
- Returns
a view including all the edges in the default layer
- earliest_time()
Timestamp of earliest activity in the graph
- Returns
the timestamp of the earliest activity in the graph
- edge(src, dst, layer=Ellipsis)
Gets the edge with the specified source and destination vertices
- edges()
Gets all edges in the graph
- Returns
the edges in the graph
- end()
Returns the default end time for perspectives over the view
- Returns
the default end time for perspectives over the view
- expanding(step)
Creates a WindowSet with the given step size and optional start and end times, using an expanding window.
An expanding window is a window that grows by step size at each iteration.
- get_unique_layers()
- has_edge(src, dst, layer=Ellipsis)
Returns true if the graph contains the specified edge
- has_vertex(id)
Returns true if the graph contains the specified vertex
- latest_time()
Timestamp of latest activity in the graph
- Returns
the timestamp of the latest activity in the graph
- layer(name)
Create a view including all the edges in the layer name
- Parameters
name (str) – the name of the layer
- Returns
a view including all the edges in the layer name
- static load_from_file(path)
Loads a graph from the given path.
- num_edges()
Number of edges in the graph
- Returns
the number of edges in the graph
- num_vertices()
Number of vertices in the graph
- Returns
the number of vertices in the graph
- rolling(window, step=Ellipsis)
Creates a WindowSet with the given window size and optional step, start and end times, using a rolling window.
A rolling window is a window that moves forward by step size at each iteration.
- save_to_file(path)
Saves the graph to the given path.
- Parameters
path (str) – The path to the graph.
Returns: None
- start()
Returns the default start time for perspectives over the view
- Returns
the default start time for perspectives over the view
- vertex(id)
Gets the vertex with the specified id
- window(start=Ellipsis, end=Ellipsis)
Create a view including all events between t_start (inclusive) and t_end (exclusive)
- vertices
Gets the vertices in the graph
- Returns
the vertices in the graph