GraphqlGraphs#

class GraphqlGraphs#

Bases: object

A class for accessing graphs hosted in a Raphtory GraphQL server and running global search for graph documents

Methods:

get(name)

Return the VectorisedGraph with name name or None if it doesn't exist

search_graph_documents(query, limit, window)

Return the top documents with the smallest cosine distance to query

search_graph_documents_with_scores(query, ...)

Same as search_graph_documents but it also returns the scores alongside the documents

get(name)#

Return the VectorisedGraph with name name or None if it doesn’t exist

Parameters:

name (str) – the name of the graph

Returns:

the graph if it exists

Return type:

Optional[VectorisedGraph]

search_graph_documents(query, limit, window)#

Return the top documents with the smallest cosine distance to query

Parameters:
  • query (str) – the text or the embedding to score against

  • limit (int) – the maximum number of documents to return

  • window (Tuple[TimeInput, TimeInput], optional) – the window where documents need to belong to in order to be considered

Returns:

A list of documents

Return type:

list[Document]

search_graph_documents_with_scores(query, limit, window)#

Same as search_graph_documents but it also returns the scores alongside the documents

Parameters:
  • query (str) – the text or the embedding to score against

  • limit (int) – the maximum number of documents to return

  • window (Tuple[TimeInput, TimeInput], optional) – the window where documents need to belong to in order to be considered

Returns:

A list of documents and their scores

Return type:

list[Tuple[Document, float]]