NeptuneGraph#
- class langchain_community.graphs.neptune_graph.NeptuneGraph(host: str, port: int = 8182, use_https: bool = True, client: Any = None, credentials_profile_name: str | None = None, region_name: str | None = None, sign: bool = True)[source]#
Neptune wrapper for graph operations.
- Parameters:
host (str) β endpoint for the database instance
port (int) β port number for the database instance, default is 8182
use_https (bool) β whether to use secure connection, default is True
client (Any) β optional boto3 Neptune client
credentials_profile_name (str | None) β optional AWS profile name
region_name (str | None) β optional AWS region, e.g., us-west-2
sign (bool) β optional, whether to sign the request payload, default is True
Example
- graph = NeptuneGraph(
host=β<my-cluster>β, port=8182
)
- 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 Neptune graph wrapper instance.
Attributes
get_schema
Return the schema of the Neptune database
Methods
__init__
(host[,Β port,Β use_https,Β client,Β ...])Create a new Neptune graph wrapper instance.
query
(query[,Β params])Query Neptune database.
- __init__(host: str, port: int = 8182, use_https: bool = True, client: Any = None, credentials_profile_name: str | None = None, region_name: str | None = None, sign: bool = True) None [source]#
Create a new Neptune graph wrapper instance.
- Parameters:
host (str) β
port (int) β
use_https (bool) β
client (Any) β
credentials_profile_name (str | None) β
region_name (str | None) β
sign (bool) β
- Return type:
None
Examples using NeptuneGraph