GraphServer

A class for defining and running a Raphtory GraphQL server

Methods

MethodDescription
runRun the server until completion.
startStart the server and return a handle to it.
turn_off_indexTurn off index for all graphs
vectorise_all_graphsVectorise all graphs in the server working directory.
vectorise_graphVectorise the graph name in the server working directory.

Method Details

run

Signature: run(port=1736, timeout_ms=180000)

Run the server until completion.

Parameters

NameTypeDefaultDescription
portint, optional1736The port to use. Defaults to 1736.
timeout_msint, optional180000Timeout for waiting for the server to start. Defaults to 180000.

Returns

TypeDescription
None

start

Signature: start(port=1736, timeout_ms=5000)

Start the server and return a handle to it.

Parameters

NameTypeDefaultDescription
portint, optional1736the port to use. Defaults to 1736.
timeout_msint, optional5000wait 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

TypeDescription
RunningGraphServerThe 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

NameTypeDefaultDescription
embeddingsOpenAIEmbeddings-the embeddings to use
nodesbool | str, optionalTrueif nodes have to be embedded or not or the custom template to use if a str is provided. Defaults to True.
edgesbool | str, optionalTrueif 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

NameTypeDefaultDescription
namelist[str]-the name of the graph to vectorise.
embeddingsOpenAIEmbeddings-the embeddings to use
nodesbool | str, optionalTrueif nodes have to be embedded or not or the custom template to use if a str is provided. Defaults to True.
edgesbool | str, optionalTrueif edges have to be embedded or not or the custom template to use if a str is provided. Defaults to True.