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 (pandas.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, optional) – The column name in the DataFrame for the subject. Defaults to ‘s’.
predicate_column (str, optional) – The column name in the DataFrame for the predicate. Defaults to ‘p’.
object_column (str, optional) – The column name in the DataFrame for the object. Defaults to ‘o’.
graph_column (str, optional) – The column name in the DataFrame for the graph if sending across quads. Defaults to ‘g’.
- Returns:
True if records were written
- Return type:
bool
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 ... )