RaphtoryClient
#
Bases: object
A client for handling GraphQL operations in the context of Raphtory.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
url
|
str
|
the URL of the Raphtory GraphQL server |
required |
token
|
|
required |
__new__(url, token=None)
#
Create and return a new object. See help(type) for accurate signature.
copy_graph(path, new_path)
#
create_index(path, index_spec, in_ram=True)
#
Create Index for graph on the server at 'path'
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path
|
Any
|
the path of the graph to be created |
required |
RemoteIndexSpec
|
RemoteIndexSpec
|
spec specifying the properties that need to be indexed |
required |
in_ram
|
bool
|
create index in ram |
True
|
Returns:
Type | Description |
---|---|
None
|
|
delete_graph(path)
#
Delete graph from a path path on the server
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path
|
str
|
the path of the graph to be deleted |
required |
Returns:
Type | Description |
---|---|
None
|
|
is_server_online()
#
Check if the server is online.
Returns:
Type | Description |
---|---|
bool
|
Returns true if server is online otherwise false. |
move_graph(path, new_path)
#
new_graph(path, graph_type)
#
Create a new empty Graph on the server at path
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path
|
str
|
the path of the graph to be created |
required |
graph_type
|
Literal['EVENT', 'PERSISTENT']
|
the type of graph that should be created - this can be EVENT or PERSISTENT |
required |
Returns:
Type | Description |
---|---|
None
|
|
query(query, variables=None)
#
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:
Name | Type | Description | Default |
---|---|---|---|
path
|
str
|
the path of the graph to be received |
required |
Returns:
Type | Description |
---|---|
Union[Graph, PersistentGraph]
|
A copy of the graph |
remote_graph(path)
#
Get a RemoteGraph reference to a graph on the server at path
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path
|
str
|
the path of the graph to be created |
required |
Returns:
Type | Description |
---|---|
RemoteGraph
|
the remote graph reference |
send_graph(path, graph, overwrite=False)
#
Send a graph to the server
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path
|
str
|
the path of the graph |
required |
graph
|
Graph | PersistentGraph
|
the graph to send |
required |
overwrite
|
bool
|
overwrite existing graph. Defaults to False. |
False
|
Returns:
Type | Description |
---|---|
dict[str, Any]
|
The data field from the graphQL response after executing the mutation. |
upload_graph(path, file_path, overwrite=False)
#
Upload graph file from a path file_path on the client
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path
|
str
|
the name of the graph |
required |
file_path
|
str
|
the path of the graph on the client |
required |
overwrite
|
bool
|
overwrite existing graph. Defaults to False. |
False
|
Returns:
Type | Description |
---|---|
dict[str, Any]
|
The data field from the graphQL response after executing the mutation. |