RaphtoryClient#

class RaphtoryClient(url, token=None)#

Bases: object

A client for handling GraphQL operations in the context of Raphtory.

Parameters:

url (str) – the URL of the Raphtory GraphQL server

Methods:

copy_graph(path, new_path)

Copy graph from a path path on the server to a new_path on the server

delete_graph(path)

Delete graph from a path path on the server

is_server_online()

Check if the server is online.

move_graph(path, new_path)

Move graph from a path path on the server to a new_path on the server

new_graph(path, graph_type)

Create a new empty Graph on the server at path

query(query[, variables])

Make a GraphQL query against the server.

receive_graph(path)

Receive graph from a path path on the server

remote_graph(path)

Get a RemoteGraph reference to a graph on the server at path

send_graph(path, graph[, overwrite])

Send a graph to the server

upload_graph(path, file_path[, overwrite])

Upload graph file from a path file_path on the client

copy_graph(path, new_path)#

Copy graph from a path path on the server to a new_path on the server

Parameters:
  • path (str) – the path of the graph to be copied

  • new_path (str) – the new path of the copied graph

Return type:

None

delete_graph(path)#

Delete graph from a path path on the server

Parameters:

path (str) – the path of the graph to be deleted

Return type:

None

is_server_online()#

Check if the server is online.

Returns:

Returns true if server is online otherwise false.

Return type:

bool

move_graph(path, new_path)#

Move graph from a path path on the server to a new_path on the server

Parameters:
  • path (str) – the path of the graph to be moved

  • new_path (str) – the new path of the moved graph

Return type:

None

new_graph(path, graph_type)#

Create a new empty Graph on the server at path

Parameters:
  • path (str) – the path of the graph to be created

  • graph_type (Literal["EVENT", "PERSISTENT"]) – the type of graph that should be created - this can be EVENT or PERSISTENT

Return type:

None

query(query, variables=None)#

Make a GraphQL query against the server.

Parameters:
  • query (str) – the query to make.

  • variables (dict[str, Any], optional) – a dict of variables present on the query and their values.

Returns:

The data field from the graphQL response.

Return type:

dict[str, Any]

receive_graph(path)#

Receive graph from a path path on the server

Note

This downloads a copy of the graph. Modifications are not persistet to the server.

Parameters:

path (str) – the path of the graph to be received

Returns:

A copy of the graph

Return type:

Union[Graph, PersistentGraph]

remote_graph(path)#

Get a RemoteGraph reference to a graph on the server at path

Parameters:

path (str) – the path of the graph to be created

Returns:

the remote graph reference

Return type:

RemoteGraph

send_graph(path, graph, overwrite=False)#

Send a graph to the server

Parameters:
  • path (str) – the path of the graph

  • graph (Graph | PersistentGraph) – the graph to send

  • overwrite (bool) – overwrite existing graph. Defaults to False.

Returns:

The data field from the graphQL response after executing the mutation.

Return type:

dict[str, Any]

upload_graph(path, file_path, overwrite=False)#

Upload graph file from a path file_path on the client

Parameters:
  • path (str) – the name of the graph

  • file_path (str) – the path of the graph on the client

  • overwrite (bool) – overwrite existing graph. Defaults to False.

Returns:

The data field from the graphQL response after executing the mutation.

Return type:

dict[str, Any]