GraphServer
A class for defining and running a Raphtory GraphQL server
Methods
| Method | Description |
|---|---|
run | Run the server until completion. |
start | Start the server and return a handle to it. |
turn_off_index | Turn off index for all graphs |
vectorise_all_graphs | Vectorise all graphs in the server working directory. |
vectorise_graph | Vectorise the graph name in the server working directory. |
Method Details
run
Signature: run(port=1736, timeout_ms=180000)
Run the server until completion.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
port | int, optional | 1736 | The port to use. Defaults to 1736. |
timeout_ms | int, optional | 180000 | Timeout for waiting for the server to start. Defaults to 180000. |
Returns
| Type | Description |
|---|---|
| None |
start
Signature: start(port=1736, timeout_ms=5000)
Start the server and return a handle to it.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
port | int, optional | 1736 | the port to use. Defaults to 1736. |
timeout_ms | int, optional | 5000 | wait for server to be online. Defaults to 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
Signature: vectorise_all_graphs(embeddings, nodes=True, edges=True)
Vectorise all graphs in the server working directory.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
embeddings | OpenAIEmbeddings | - | the embeddings to use |
nodes | bool | str, optional | True | if nodes have to be embedded or not or the custom template to use if a str is provided. Defaults to True. |
edges | bool | str, optional | True | if edges have to be embedded or not or the custom template to use if a str is provided. Defaults to True. |
vectorise_graph
Signature: vectorise_graph(name, embeddings, nodes=True, edges=True)
Vectorise the graph name in the server working directory.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
name | list[str] | - | the name of the graph to vectorise. |
embeddings | OpenAIEmbeddings | - | the embeddings to use |
nodes | bool | str, optional | True | if nodes have to be embedded or not or the custom template to use if a str is provided. Defaults to True. |
edges | bool | str, optional | True | if edges have to be embedded or not or the custom template to use if a str is provided. Defaults to True. |