awswrangler.neptune.execute_sparql¶
- awswrangler.neptune.execute_sparql(client: NeptuneClient, query: str) Any ¶
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
Results as Pandas DataFrame
- Return type
Union[pandas.DataFrame, Iterator[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 .