def to_property_graph(client: NeptuneClient, df: pd.DataFrame, batch_size: int=50, use_header_cardinality: bool=True) -> bool:
    'Write records stored in a DataFrame into Amazon Neptune.\n\n    If writing to a property graph then DataFrames for vertices and edges must be written separately.\n    DataFrames for vertices must have a ~label column with the label and a ~id column for the vertex id.\n    If the ~id column does not exist, the specified id does not exists, or is empty then a new vertex will be added.\n    If no ~label column exists an exception will be thrown.\n    DataFrames for edges must have a ~id, ~label, ~to, and ~from column.  If the ~id column does not exist\n    the specified id does not exists, or is empty then a new edge will be added. If no ~label, ~to, or ~from column\n    exists an exception will be thrown.\n\n    If you would like to save data using `single` cardinality then you can postfix (single) to the column header and\n    set use_header_cardinality=True (default).  e.g. A column named `name(single)` will save the `name` property\n    as single\n    cardinality.  You can disable this by setting by setting `use_header_cardinality=False`.\n\n    Parameters\n    ----------\n    client : NeptuneClient\n        instance of the neptune client to use\n    df : pandas.DataFrame\n        Pandas DataFrame https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.html\n    batch_size: int\n        The number of rows to save at a time. Default 50\n    use_header_cardinality: bool\n        If True, then the header cardinality will be used to save the data. Default True\n\n    Returns\n    -------\n    bool\n        True if records were written\n\n    Examples\n    --------\n    Writing to Amazon Neptune\n\n    >>> import awswrangler as wr\n    >>> client = wr.neptune.connect(neptune_endpoint, neptune_port, iam_enabled=False)\n    >>> wr.neptune.gremlin.to_property_graph(\n    ...     df=df\n    ... )\n    '
    g = Graph().traversal()
    is_edge_df = False
    is_update_df = True
    if ('~id' in df.columns):
        if ('~label' in df.columns):
            is_update_df = False
            if (('~to' in df.columns) and ('~from' in df.columns)):
                is_edge_df = True
    else:
        raise exceptions.InvalidArgumentValue('Dataframe must contain at least a ~id and a ~label column to be saved to Amazon Neptune')
    for (index, row) in df.iterrows():
        if is_update_df:
            g = _build_gremlin_update(g, row, use_header_cardinality)
        elif is_edge_df:
            g = _build_gremlin_insert_edges(g, row.to_dict(), use_header_cardinality)
        else:
            g = _build_gremlin_insert_vertices(g, row.to_dict(), use_header_cardinality)
        if ((index > 0) and ((index % batch_size) == 0)):
            res = _run_gremlin_insert(client, g)
            if res:
                g = Graph().traversal()
    return _run_gremlin_insert(client, g)
Write records stored in a DataFrame into Amazon Neptune.

If writing to a property graph then DataFrames for vertices and edges must be written separately.
DataFrames for vertices must have a ~label column with the label and a ~id column for the vertex id.
If the ~id column does not exist, the specified id does not exists, or is empty then a new vertex will be added.
If no ~label column exists an exception will be thrown.
DataFrames for edges must have a ~id, ~label, ~to, and ~from column.  If the ~id column does not exist
the specified id does not exists, or is empty then a new edge will be added. If no ~label, ~to, or ~from column
exists an exception will be thrown.

If you would like to save data using `single` cardinality then you can postfix (single) to the column header and
set use_header_cardinality=True (default).  e.g. A column named `name(single)` will save the `name` property
as single
cardinality.  You can disable this by setting by setting `use_header_cardinality=False`.

Parameters
----------
client : NeptuneClient
    instance of the neptune client to use
df : pandas.DataFrame
    Pandas DataFrame https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.html
batch_size: int
    The number of rows to save at a time. Default 50
use_header_cardinality: bool
    If True, then the header cardinality will be used to save the data. Default True

Returns
-------
bool
    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_property_graph(
...     df=df
... )
def to_property_graph(client: NeptuneClient, df: pd.DataFrame, batch_size: int=50, use_header_cardinality: bool=True) -> bool:
    'Write records stored in a DataFrame into Amazon Neptune.\n\n    If writing to a property graph then DataFrames for vertices and edges must be written separately.\n    DataFrames for vertices must have a ~label column with the label and a ~id column for the vertex id.\n    If the ~id column does not exist, the specified id does not exists, or is empty then a new vertex will be added.\n    If no ~label column exists an exception will be thrown.\n    DataFrames for edges must have a ~id, ~label, ~to, and ~from column.  If the ~id column does not exist\n    the specified id does not exists, or is empty then a new edge will be added. If no ~label, ~to, or ~from column\n    exists an exception will be thrown.\n\n    If you would like to save data using `single` cardinality then you can postfix (single) to the column header and\n    set use_header_cardinality=True (default).  e.g. A column named `name(single)` will save the `name` property\n    as single\n    cardinality.  You can disable this by setting by setting `use_header_cardinality=False`.\n\n    Parameters\n    ----------\n    client : NeptuneClient\n        instance of the neptune client to use\n    df : pandas.DataFrame\n        Pandas DataFrame https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.html\n    batch_size: int\n        The number of rows to save at a time. Default 50\n    use_header_cardinality: bool\n        If True, then the header cardinality will be used to save the data. Default True\n\n    Returns\n    -------\n    bool\n        True if records were written\n\n    Examples\n    --------\n    Writing to Amazon Neptune\n\n    >>> import awswrangler as wr\n    >>> client = wr.neptune.connect(neptune_endpoint, neptune_port, iam_enabled=False)\n    >>> wr.neptune.gremlin.to_property_graph(\n    ...     df=df\n    ... )\n    '
    g = Graph().traversal()
    is_edge_df = False
    is_update_df = True
    if ('~id' in df.columns):
        if ('~label' in df.columns):
            is_update_df = False
            if (('~to' in df.columns) and ('~from' in df.columns)):
                is_edge_df = True
    else:
        raise exceptions.InvalidArgumentValue('Dataframe must contain at least a ~id and a ~label column to be saved to Amazon Neptune')
    for (index, row) in df.iterrows():
        if is_update_df:
            g = _build_gremlin_update(g, row, use_header_cardinality)
        elif is_edge_df:
            g = _build_gremlin_insert_edges(g, row.to_dict(), use_header_cardinality)
        else:
            g = _build_gremlin_insert_vertices(g, row.to_dict(), use_header_cardinality)
        if ((index > 0) and ((index % batch_size) == 0)):
            res = _run_gremlin_insert(client, g)
            if res:
                g = Graph().traversal()
    return _run_gremlin_insert(client, g)