langchain_community.graphs.tigergraph_graph
.TigerGraph¶
- class langchain_community.graphs.tigergraph_graph.TigerGraph(conn: Any)[source]¶
TigerGraph wrapper for graph operations.
- Security note: Make sure that the database connection uses credentials
that are narrowly-scoped to only include necessary permissions. Failure to do so may result in data corruption or loss, since the calling code may attempt commands that would result in deletion, mutation of data if appropriately prompted or reading sensitive data if such data is present in the database. The best way to guard against such negative outcomes is to (as appropriate) limit the permissions granted to the credentials used with this tool.
See https://python.langchain.com/docs/security for more information.
Create a new TigerGraph graph wrapper instance.
Attributes
conn
get_structured_schema
Returns the schema of the Graph database
schema
Methods
__init__
(conn)Create a new TigerGraph graph wrapper instance.
add_graph_documents
(graph_documents[, ...])Take GraphDocument as input as uses it to construct a graph.
Generates the schema of the TigerGraph Database and returns it User can specify a sample_ratio (0 to 1) to determine the ratio of documents/edges used (in relation to the Collection size) to render each Collection Schema.
Returns the schema of the Graph database
query
(query)Query the TigerGraph database.
Refreshes the graph schema information.
register_query
(function_header, description, ...)Wrapper function to register a custom GSQL query to the TigerGraph NLQS.
set_connection
(conn)set_schema
([schema])Set the schema of the TigerGraph Database.
- abstract add_graph_documents(graph_documents: List[GraphDocument], include_source: bool = False) None ¶
Take GraphDocument as input as uses it to construct a graph.
- generate_schema() Dict[str, List[Dict[str, Any]]] [source]¶
Generates the schema of the TigerGraph Database and returns it User can specify a sample_ratio (0 to 1) to determine the ratio of documents/edges used (in relation to the Collection size) to render each Collection Schema.