langchain_community.graphs.neptune_graph.NeptuneAnalyticsGraph¶

class langchain_community.graphs.neptune_graph.NeptuneAnalyticsGraph(graph_identifier: str, client: Optional[Any] = None, credentials_profile_name: Optional[str] = None, region_name: Optional[str] = None)[source]¶

Neptune Analytics wrapper for graph operations.

Parameters
  • client (Any) – optional boto3 Neptune client

  • credentials_profile_name (Optional[str]) – optional AWS profile name

  • region_name (Optional[str]) – optional AWS region, e.g., us-west-2

  • graph_identifier (str) – the graph identifier for a Neptune Analytics graph

Example


graph = NeptuneAnalyticsGraph(

graph_identifier=’<my-graph-id>’

)

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 Analytics graph wrapper instance.

Attributes

get_schema

Return the schema of the Neptune database

Methods

__init__(graph_identifier[, client, ...])

Create a new Neptune Analytics graph wrapper instance.

query(query[, params])

Query Neptune database.

__init__(graph_identifier: str, client: Optional[Any] = None, credentials_profile_name: Optional[str] = None, region_name: Optional[str] = None) None[source]¶

Create a new Neptune Analytics graph wrapper instance.

Parameters
  • graph_identifier (str) –

  • client (Optional[Any]) –

  • credentials_profile_name (Optional[str]) –

  • region_name (Optional[str]) –

Return type

None

query(query: str, params: dict = {}) Dict[str, Any][source]¶

Query Neptune database.

Parameters
  • query (str) –

  • params (dict) –

Return type

Dict[str, Any]

Examples using NeptuneAnalyticsGraph¶