awswrangler.neptune.to_rdf_graph

awswrangler.neptune.to_rdf_graph(client: NeptuneClient, df: DataFrame, batch_size: int = 50, subject_column: str = 's', predicate_column: str = 'p', object_column: str = 'o', graph_column: str = 'g') bool

Write records stored in a DataFrame into Amazon Neptune.

The DataFrame must consist of triples with column names for the subject, predicate, and object specified. If you want to add data into a named graph then you will also need the graph column.

Parameters:
  • client (NeptuneClient) – Instance of the neptune client to use.

  • df (DataFrame) – Pandas DataFrame.

  • batch_size (int) – The number of rows in the DataFrame (i.e. triples) to write into Amazon Neptune in one query. Defaults to 50.

  • subject_column (str) – The column name in the DataFrame for the subject. Defaults to ‘s’.

  • predicate_column (str) – The column name in the DataFrame for the predicate. Defaults to ‘p’.

  • object_column (str) – The column name in the DataFrame for the object. Defaults to ‘o’.

  • graph_column (str) – The column name in the DataFrame for the graph if sending across quads. Defaults to ‘g’.

Return type:

bool

Returns:

True if records were written

Examples

Writing to Amazon Neptune

>>> import awswrangler as wr
>>> client = wr.neptune.connect(neptune_endpoint, neptune_port, iam_enabled=False)
>>> wr.neptune.gremlin.to_rdf_graph(
...     df=df
... )