Server#

class raphtory.graphql.RaphtoryServer(graphs=None, graph_dir=None)#

Bases: object

A class for defining and running a Raphtory GraphQL server

Methods:

run([port])

Run the server until completion.

start([port])

Start the server and return a handle to it.

with_vectorised(graph_names, cache[, ...])

Vectorise a subset of the graphs of the server.

run(port=1736)#

Run the server until completion.

Parameters:

port (*) – the port to use (defaults to 1736).

start(port=1736)#

Start the server and return a handle to it.

Parameters:

port (*) – the port to use (defaults to 1736).

with_vectorised(graph_names, cache, embedding=None, node_document=None, edge_document=None)#

Vectorise a subset of the graphs of the server.

Note

If no embedding function is provided, the server will attempt to use the OpenAI API embedding model, which will only work if the env variable OPENAI_API_KEY is set appropriately

Parameters:
  • graph_names (*) – the names of the graphs to vectorise.

  • cache (*) – the directory to use as cache for the embeddings.

  • embedding (*) – the embedding function to translate documents to embeddings.

  • node_document (*) – the property name to use as the source for the documents on nodes.

  • edge_document (*) – the property name to use as the source for the documents on edges.

Returns:

A new server object containing the vectorised graphs.