def execute_sparql(client: NeptuneClient, query: str) -> pd.DataFrame:
    'Return results of a SPARQL query as pandas dataframe.\n\n    Parameters\n    ----------\n    client : NeptuneClient\n        instance of the neptune client to use\n    query : str\n        The SPARQL traversal to execute\n\n    Returns\n    -------\n    Union[pandas.DataFrame, Iterator[pandas.DataFrame]]\n        Results as Pandas DataFrame\n\n    Examples\n    --------\n    Run a SPARQL query\n\n    >>> import awswrangler as wr\n    >>> client = wr.neptune.connect(neptune_endpoint, neptune_port, iam_enabled=False)\n    >>> df = wr.neptune.execute_sparql(client, "PREFIX foaf:  <http://xmlns.com/foaf/0.1/>\n    SELECT ?name\n    WHERE {\n            ?person foaf:name ?name .\n    '
    data = client.read_sparql(query)
    df = None
    if (('results' in data) and ('bindings' in data['results'])):
        df = pd.DataFrame(data['results']['bindings'])
        df.applymap((lambda x: x['value']))
    else:
        df = pd.DataFrame(data)
    return df
Return results of a SPARQL query as pandas dataframe.

Parameters
----------
client : NeptuneClient
    instance of the neptune client to use
query : str
    The SPARQL traversal to execute

Returns
-------
Union[pandas.DataFrame, Iterator[pandas.DataFrame]]
    Results as Pandas DataFrame

Examples
--------
Run a SPARQL query

>>> import awswrangler as wr
>>> client = wr.neptune.connect(neptune_endpoint, neptune_port, iam_enabled=False)
>>> df = wr.neptune.execute_sparql(client, "PREFIX foaf:  <http://xmlns.com/foaf/0.1/>
SELECT ?name
WHERE {
        ?person foaf:name ?name .
def execute_sparql(client: NeptuneClient, query: str) -> pd.DataFrame:
    'Return results of a SPARQL query as pandas dataframe.\n\n    Parameters\n    ----------\n    client : NeptuneClient\n        instance of the neptune client to use\n    query : str\n        The SPARQL traversal to execute\n\n    Returns\n    -------\n    Union[pandas.DataFrame, Iterator[pandas.DataFrame]]\n        Results as Pandas DataFrame\n\n    Examples\n    --------\n    Run a SPARQL query\n\n    >>> import awswrangler as wr\n    >>> client = wr.neptune.connect(neptune_endpoint, neptune_port, iam_enabled=False)\n    >>> df = wr.neptune.execute_sparql(client, "PREFIX foaf:  <http://xmlns.com/foaf/0.1/>\n    SELECT ?name\n    WHERE {\n            ?person foaf:name ?name .\n    '
    data = client.read_sparql(query)
    df = None
    if (('results' in data) and ('bindings' in data['results'])):
        df = pd.DataFrame(data['results']['bindings'])
        df.applymap((lambda x: x['value']))
    else:
        df = pd.DataFrame(data)
    return df