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
Return 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.
Return the schema of the Graph database
query
(query)Query the TigerGraph database.
Refresh 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.
- Parameters:
conn (Any) β
- __init__(conn: Any) None [source]#
Create a new TigerGraph graph wrapper instance.
- Parameters:
conn (Any) β
- Return type:
None
- abstract add_graph_documents(graph_documents: List[GraphDocument], include_source: bool = False) None #
Take GraphDocument as input as uses it to construct a graph.
- Parameters:
graph_documents (List[GraphDocument]) β
include_source (bool) β
- Return type:
None
- 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.
- Return type:
Dict[str, List[Dict[str, Any]]]
- query(query: str) Dict[str, Any] [source]#
Query the TigerGraph database.
- Parameters:
query (str) β
- Return type:
Dict[str, Any]
- register_query(function_header: str, description: str, docstring: str, param_types: dict = {}) List[str] [source]#
Wrapper function to register a custom GSQL query to the TigerGraph NLQS.
- Parameters:
function_header (str) β
description (str) β
docstring (str) β
param_types (dict) β
- Return type:
List[str]
Examples using TigerGraph