langchain.graphs.nebula_graph.NebulaGraph¶

class langchain.graphs.nebula_graph.NebulaGraph(space: str, username: str = 'root', password: str = 'nebula', address: str = '127.0.0.1', port: int = 9669, session_pool_size: int = 30)[source]¶

NebulaGraph wrapper for graph operations.

NebulaGraph inherits methods from Neo4jGraph to bring ease to the user space.

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 NebulaGraph wrapper instance.

Attributes

get_schema

Returns the schema of the NebulaGraph database

Methods

__init__(space[, username, password, ...])

Create a new NebulaGraph wrapper instance.

execute(query[, params, retry])

Query NebulaGraph database.

query(query[, retry])

refresh_schema()

Refreshes the NebulaGraph schema information.

__init__(space: str, username: str = 'root', password: str = 'nebula', address: str = '127.0.0.1', port: int = 9669, session_pool_size: int = 30) None[source]¶

Create a new NebulaGraph wrapper instance.

execute(query: str, params: Optional[dict] = None, retry: int = 0) Any[source]¶

Query NebulaGraph database.

query(query: str, retry: int = 0) Dict[str, Any][source]¶
refresh_schema() None[source]¶

Refreshes the NebulaGraph schema information.

Examples using NebulaGraph¶