Vertex#

class raphtory.Vertex#

Bases: object

A vertex (or node) in the graph.

Methods:

after(start)

Create a view of the vertex including all events after start (exclusive).

at(time)

Create a view of the vertex including all events at time.

before(end)

Create a view of the vertex including all events before end (exclusive).

default_layer()

Create a view including all the edges in the default layer

degree()

Get the degree of this vertex (i.e., the number of edges that are incident to it).

expanding(step)

Creates a WindowSet with the given step size using an expanding window.

history()

Returns the history of a vertex, including vertex additions and changes made to vertex.

in_degree()

Get the in-degree of this vertex (i.e., the number of edges that are incident to it from other vertices).

layer(name)

Create a view including all the edges in the layers name

layers(names)

Create a view including all the edges in the layers names

out_degree()

Get the out-degree of this vertex (i.e., the number of edges that are incident to it from this vertex).

rolling(window[, step])

Creates a WindowSet with the given window size and optional step using a rolling window.

window([start, end])

Create a view of the vertex including all events between start (inclusive) and end (exclusive)

Attributes:

earliest_date_time

Returns the earliest datetime that the vertex exists.

earliest_time

Returns the earliest time that the vertex exists.

edges

Get the edges that are pointing to or from this vertex.

end

Gets the latest time that this vertex is valid.

end_date_time

Gets the latest datetime that this vertex is valid

id

Returns the id of the vertex.

in_edges

Get the edges that are pointing to this vertex.

in_neighbours

Get the neighbours of this vertex that are pointing to it.

latest_date_time

Returns the latest datetime that the vertex exists.

latest_time

Returns the latest time that the vertex exists.

name

Returns the name of the vertex.

neighbours

Get the neighbours of this vertex.

out_edges

Get the edges that are pointing from this vertex.

out_neighbours

Get the neighbours of this vertex that are pointing from it.

properties

The properties of the vertex

start

Gets the start time for rolling and expanding windows for this vertex

start_date_time

Gets the earliest datetime that this vertex is valid

window_size

Get the window size (difference between start and end) for this vertex

after(start)#

Create a view of the vertex including all events after start (exclusive).

Parameters:

start – The start time of the window.

Returns:

A vertex object.

at(time)#

Create a view of the vertex including all events at time.

Parameters:

time – The time of the window.

Returns:

A vertex object.

before(end)#

Create a view of the vertex including all events before end (exclusive).

Parameters:

end – The end time of the window.

Returns:

A vertex object.

default_layer()#

Create a view including all the edges in the default layer

Returns:

a view including all the edges in the default layer

degree()#

Get the degree of this vertex (i.e., the number of edges that are incident to it).

Returns

The degree of this vertex.

earliest_date_time#

Returns the earliest datetime that the vertex exists.

Returns:

The earliest datetime that the vertex exists as an integer.

earliest_time#

Returns the earliest time that the vertex exists.

Returns:

The earliest time that the vertex exists as an integer.

edges#

Get the edges that are pointing to or from this vertex.

Returns:

A list of Edge objects.

end#

Gets the latest time that this vertex is valid.

Returns:

The latest time that this vertex is valid or None if the vertex is valid for all times.

end_date_time#

Gets the latest datetime that this vertex is valid

Returns:

The latest datetime that this vertex is valid or None if the vertex is valid for all times.

expanding(step)#

Creates a WindowSet with the given step size using an expanding window.

An expanding window is a window that grows by step size at each iteration.

Parameters:

step (int) – The step size of the window.

Returns:

A WindowSet object.

history()#

Returns the history of a vertex, including vertex additions and changes made to vertex.

Returns:

A list of timestamps of the event history of vertex.

id#

Returns the id of the vertex. This is a unique identifier for the vertex.

Returns:

The id of the vertex as an integer.

in_degree()#

Get the in-degree of this vertex (i.e., the number of edges that are incident to it from other vertices).

Returns:

The in-degree of this vertex.

in_edges#

Get the edges that are pointing to this vertex.

Returns:

A list of Edge objects.

in_neighbours#

Get the neighbours of this vertex that are pointing to it.

Returns:

A list of Vertex objects.

latest_date_time#

Returns the latest datetime that the vertex exists.

Parameters:

None

Returns:

The latest datetime that the vertex exists as an integer.

latest_time#

Returns the latest time that the vertex exists.

Returns:

The latest time that the vertex exists as an integer.

layer(name)#

Create a view including all the edges in the layers name

Parameters:

name (str) – the name of the layer to include

Returns:

a view including all the edges in the layer name

layers(names)#

Create a view including all the edges in the layers names

Parameters:

name (str) – the name of the layers to include

Returns:

a view including all the edges in the layers names

name#

Returns the name of the vertex.

Returns:

The name of the vertex as a string.

neighbours#

Get the neighbours of this vertex.

Returns:

A list of Vertex objects.

out_degree()#

Get the out-degree of this vertex (i.e., the number of edges that are incident to it from this vertex).

Returns:

The out-degree of this vertex.

out_edges#

Get the edges that are pointing from this vertex.

Returns:

A list of Edge objects.

out_neighbours#

Get the neighbours of this vertex that are pointing from it.

Returns:

A list of Vertex objects.

properties#

The properties of the vertex

Returns:

A list of properties.

rolling(window, step=None)#

Creates a WindowSet with the given window size and optional step using a rolling window.

A rolling window is a window that moves forward by step size at each iteration.

Parameters:
  • window – The size of the window.

  • step – The step size of the window. Defaults to the window size.

Returns:

A WindowSet object.

start#

Gets the start time for rolling and expanding windows for this vertex

Returns:

The earliest time that this vertex is valid or None if the vertex is valid for all times.

start_date_time#

Gets the earliest datetime that this vertex is valid

Returns:

The earliest datetime that this vertex is valid or None if the vertex is valid for all times.

window(start=None, end=None)#

Create a view of the vertex including all events between start (inclusive) and end (exclusive)

Parameters:
  • start – The start time of the window. Defaults to the start time of the vertex.

  • end – The end time of the window. Defaults to the end time of the vertex.

Returns: r A vertex object.

window_size#

Get the window size (difference between start and end) for this vertex

class raphtory.Vertices#

Bases: object

A list of vertices that can be iterated over.

Methods:

after(start)

Create a view of the vertices including all events after start (exclusive).

at(time)

Create a view of the vertices including all events at time.

before(end)

Create a view of the vertices including all events before end (exclusive).

collect()

Collects all vertices into a list

default_layer()

Create a view including all the edges in the default layer

degree()

Returns the number of edges of the vertices

expanding(step)

Creates a WindowSet with the given step size using an expanding window.

in_degree()

Returns the number of in edges of the vertices

layer(name)

Create a view including all the edges in the layers names

out_degree()

Returns the number of out edges of the vertices

rolling(window[, step])

Creates a WindowSet with the given window size and optional step using a rolling window.

window([start, end])

Create a view of the vertices including all events between start (inclusive) and end (exclusive)

Attributes:

earliest_time

Returns an iterator over the vertices earliest time

edges

Returns the edges of the vertices

end

Gets the latest time that this vertices is valid.

end_date_time

Gets the latest datetime that this vertices is valid

id

Returns an iterator over the vertices ids

in_edges

Returns the in edges of the vertices

in_neighbours

Get the in neighbours of the vertices

latest_time

Returns an iterator over the vertices latest time

name

Returns an iterator over the vertices name

neighbours

Get the neighbours of the vertices

out_edges

Returns the out edges of the vertices

out_neighbours

Get the out neighbours of the vertices

properties

The properties of the vertex

start

Gets the start time for rolling and expanding windows for this vertices

start_date_time

Gets the earliest datetime that this vertices is valid

window_size

Get the window size (difference between start and end) for this vertices

after(start)#

Create a view of the vertices including all events after start (exclusive).

Parameters:

start – The start time of the window.

Returns:

A vertices object.

at(time)#

Create a view of the vertices including all events at time.

Parameters:

time – The time of the window.

Returns:

A vertices object.

before(end)#

Create a view of the vertices including all events before end (exclusive).

Parameters:

end – The end time of the window.

Returns:

A vertices object.

collect()#

Collects all vertices into a list

default_layer()#

Create a view including all the edges in the default layer

Returns:

a view including all the edges in the default layer

degree()#

Returns the number of edges of the vertices

Returns:

An iterator of the number of edges of the vertices

earliest_time#

Returns an iterator over the vertices earliest time

edges#

Returns the edges of the vertices

Returns:

An iterator of edges of the vertices

end#

Gets the latest time that this vertices is valid.

Returns:

The latest time that this vertices is valid or None if the vertices is valid for all times.

end_date_time#

Gets the latest datetime that this vertices is valid

Returns:

The latest datetime that this vertices is valid or None if the vertices is valid for all times.

expanding(step)#

Creates a WindowSet with the given step size using an expanding window.

An expanding window is a window that grows by step size at each iteration.

Parameters:

step (int) – The step size of the window.

Returns:

A WindowSet object.

id#

Returns an iterator over the vertices ids

in_degree()#

Returns the number of in edges of the vertices

Returns:

An iterator of the number of in edges of the vertices

in_edges#

Returns the in edges of the vertices

Returns:

An iterator of in edges of the vertices

in_neighbours#

Get the in neighbours of the vertices

Returns:

An iterator of the in neighbours of the vertices

latest_time#

Returns an iterator over the vertices latest time

layer(name)#

Create a view including all the edges in the layers names

Parameters:

name (str) – the name of the layers to include

Returns:

a view including all the edges in the layers names

name#

Returns an iterator over the vertices name

neighbours#

Get the neighbours of the vertices

Returns:

An iterator of the neighbours of the vertices

out_degree()#

Returns the number of out edges of the vertices

Returns:

An iterator of the number of out edges of the vertices

out_edges#

Returns the out edges of the vertices

Returns:

An iterator of out edges of the vertices

out_neighbours#

Get the out neighbours of the vertices

Returns:

An iterator of the out neighbours of the vertices

properties#

The properties of the vertex

Returns:

A List of properties

rolling(window, step=None)#

Creates a WindowSet with the given window size and optional step using a rolling window.

A rolling window is a window that moves forward by step size at each iteration.

Parameters:
  • window – The size of the window.

  • step – The step size of the window. Defaults to the window size.

Returns:

A WindowSet object.

start#

Gets the start time for rolling and expanding windows for this vertices

Returns:

The earliest time that this vertices is valid or None if the vertices is valid for all times.

start_date_time#

Gets the earliest datetime that this vertices is valid

Returns:

The earliest datetime that this vertices is valid or None if the vertices is valid for all times.

window(start=None, end=None)#

Create a view of the vertices including all events between start (inclusive) and end (exclusive)

Parameters:
  • start – The start time of the window. Defaults to the start time of the vertices.

  • end – The end time of the window. Defaults to the end time of the vertices.

Returns: r A vertices object.

window_size#

Get the window size (difference between start and end) for this vertices