# NeptuneRdfGraph

> **Class** in `langchain_aws`

📖 [View in docs](https://reference.langchain.com/python/langchain-aws/graphs/neptune_rdf_graph/NeptuneRdfGraph)

Neptune wrapper for RDF graph operations.

## Signature

```python
NeptuneRdfGraph(
    self,
    host: str,
    port: int = 8182,
    use_https: bool = True,
    use_iam_auth: bool = False,
    client: Any = None,
    credentials_profile_name: Optional[str] = None,
    region_name: Optional[str] = None,
    service: str = 'neptunedata',
    sign: bool = True,
)
```

## Description

**Example:**

```python
graph = NeptuneRdfGraph(
    host='<SPARQL host'>,
    port=<SPARQL port>
)
schema = graph.get_schema()

OR
graph = NeptuneRdfGraph(
    host='<SPARQL host'>,
    port=<SPARQL port>
)
schema_elem = graph.get_schema_elements()
#... change schema_elements ...
graph.load_schema(schema_elem)
```

*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://docs.langchain.com/oss/python/security-policy for more information.

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `host` | `str` | Yes | endpoint for the database instance |
| `port` | `int` | No | port number for the database instance, default is 8182 (default: `8182`) |
| `use_iam_auth` | `bool` | No | boolean indicating IAM auth is enabled in Neptune cluster (default: `False`) |
| `use_https` | `bool` | No | whether to use secure connection, default is True (default: `True`) |
| `client` | `Any` | No | optional boto3 Neptune client (default: `None`) |
| `credentials_profile_name` | `Optional[str]` | No | optional AWS profile name (default: `None`) |
| `region_name` | `Optional[str]` | No | optional AWS region, e.g., us-west-2 (default: `None`) |
| `service` | `str` | No | optional service name, default is neptunedata (default: `'neptunedata'`) |
| `sign` | `bool` | No | optional, whether to sign the request payload, default is True (default: `True`) |

## Constructors

```python
__init__(
    self,
    host: str,
    port: int = 8182,
    use_https: bool = True,
    use_iam_auth: bool = False,
    client: Any = None,
    credentials_profile_name: Optional[str] = None,
    region_name: Optional[str] = None,
    service: str = 'neptunedata',
    sign: bool = True,
) -> None
```

| Name | Type |
|------|------|
| `host` | `str` |
| `port` | `int` |
| `use_https` | `bool` |
| `use_iam_auth` | `bool` |
| `client` | `Any` |
| `credentials_profile_name` | `Optional[str]` |
| `region_name` | `Optional[str]` |
| `service` | `str` |
| `sign` | `bool` |


## Properties

- `use_iam_auth`
- `region_name`
- `query_endpoint`
- `client`
- `session`
- `schema`
- `schema_elements`
- `get_schema`
- `get_schema_elements`

## Methods

- [`get_summary()`](https://reference.langchain.com/python/langchain-aws/graphs/neptune_rdf_graph/NeptuneRdfGraph/get_summary)
- [`query()`](https://reference.langchain.com/python/langchain-aws/graphs/neptune_rdf_graph/NeptuneRdfGraph/query)
- [`load_schema()`](https://reference.langchain.com/python/langchain-aws/graphs/neptune_rdf_graph/NeptuneRdfGraph/load_schema)

---

[View source on GitHub](https://github.com/langchain-ai/langchain-aws/blob/10d18256d46953e5fc8dca313a2c41eee29c2a80/libs/aws/langchain_aws/graphs/neptune_rdf_graph.py#L31)