GraphServer
#
Bases: object
A class for defining and running a Raphtory GraphQL server
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
work_dir
|
str | PathLike
|
the working directory for the server |
required |
cache_capacity
|
int
|
the maximum number of graphs to keep in memory at once |
required |
cache_tti_seconds
|
int
|
the inactive time in seconds after which a graph is evicted from the cache |
required |
log_level
|
str
|
the log level for the server |
required |
tracing
|
bool
|
whether tracing should be enabled |
required |
otlp_agent_host
|
str
|
OTLP agent host for tracing |
required |
otlp_agent_port
|
str
|
OTLP agent port for tracing |
required |
otlp_tracing_service_name
|
str
|
The OTLP tracing service name |
required |
config_path
|
str | PathLike
|
Path to the config file |
required |
auth_public_key
|
|
required | |
auth_enabled_for_reads
|
|
required | |
create_index
|
|
required |
__new__(work_dir, cache_capacity=None, cache_tti_seconds=None, log_level=None, tracing=None, tracing_level=None, otlp_agent_host=None, otlp_agent_port=None, otlp_tracing_service_name=None, auth_public_key=None, auth_enabled_for_reads=None, config_path=None, create_index=None)
#
Create and return a new object. See help(type) for accurate signature.
run(port=1736, timeout_ms=180000)
#
start(port=1736, timeout_ms=5000)
#
Start the server and return a handle to it.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
port
|
int
|
the port to use. Defaults to 1736. |
1736
|
timeout_ms
|
int
|
wait for server to be online. Defaults to 5000. |
5000
|
The server is stopped if not online within timeout_ms but manages to come online as soon as timeout_ms finishes!
Returns:
| Type | Description |
|---|---|
RunningGraphServer
|
The running server |
turn_off_index()
#
Turn off index for all graphs
vectorise_all_graphs(embeddings, nodes=True, edges=True)
#
Vectorise all graphs in the server working directory.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
embeddings
|
OpenAIEmbeddings
|
the embeddings to use |
required |
nodes
|
bool | str
|
if nodes have to be embedded or not or the custom template to use if a str is provided. Defaults to True. |
True
|
edges
|
bool | str
|
if edges have to be embedded or not or the custom template to use if a str is provided. Defaults to True. |
True
|
vectorise_graph(name, embeddings, nodes=True, edges=True)
#
Vectorise the graph name in the server working directory.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
list[str]
|
the name of the graph to vectorise. |
required |
embeddings
|
OpenAIEmbeddings
|
the embeddings to use |
required |
nodes
|
bool | str
|
if nodes have to be embedded or not or the custom template to use if a str is provided. Defaults to True. |
True
|
edges
|
bool | str
|
if edges have to be embedded or not or the custom template to use if a str is provided. Defaults to True. |
True
|