AWS neptune documentation change
Summary
Added comprehensive code examples for invoking explain queries using AWS CLI, SDK, awscurl, and curl, replacing a minimal curl example.
Security assessment
This change adds detailed implementation examples for Neptune's explain feature but doesn't address security vulnerabilities or add security documentation. The examples include standard API usage patterns without security-specific content.
Diff
diff --git a/neptune/latest/userguide/access-graph-opencypher-explain-example-2.md b/neptune/latest/userguide/access-graph-opencypher-explain-example-2.md index 515598838..3ed19e564 100644 --- a//neptune/latest/userguide/access-graph-opencypher-explain-example-2.md +++ b//neptune/latest/userguide/access-graph-opencypher-explain-example-2.md @@ -7 +7 @@ -This query looks for relationships between two anonymous nodes with type `route`, and returns at most 10. Again, the `explain` mode is `details` and the output format is the default ASCII format. Here is the `explain` output: +This query looks for relationships between two anonymous nodes with type `route`, and returns at most 10. Again, the `explain` mode is `details` and the output format is the default ASCII format. @@ -12,0 +13,60 @@ Here, `DFEPipelineScan` scans for edges that start from anonymous node `?anon_no +To invoke `explain` for this query: + +AWS CLI + + + + aws neptunedata execute-open-cypher-explain-query \ + --endpoint-url https://your-neptune-endpoint:port \ + --open-cypher-query "MATCH ()-[p:route]->() RETURN p LIMIT 10" \ + --explain-mode details + +For more information, see [execute-open-cypher-explain-query](https://docs.aws.amazon.com/cli/latest/reference/neptunedata/execute-open-cypher-explain-query.html) in the AWS CLI Command Reference. + +SDK + + + + import boto3 + from botocore.config import Config + + client = boto3.client( + 'neptunedata', + endpoint_url='https://your-neptune-endpoint:port', + config=Config(read_timeout=None, retries={'total_max_attempts': 1}) + ) + + response = client.execute_open_cypher_explain_query( + openCypherQuery='MATCH ()-[p:route]->() RETURN p LIMIT 10', + explainMode='details' + ) + + print(response['results'].read().decode('utf-8')) + +For AWS SDK examples in other languages, see [AWS SDK](./access-graph-opencypher-sdk.html). + +awscurl + + + + awscurl https://your-neptune-endpoint:port/openCypher \ + --region us-east-1 \ + --service neptune-db \ + -X POST \ + -d "query=MATCH ()-[p:route]->() RETURN p LIMIT 10" \ + -d "explain=details" + +###### Note + +This example assumes that your AWS credentials are configured in your environment. Replace `us-east-1` with the Region of your Neptune cluster. + +curl + + + + curl https://your-neptune-endpoint:port/openCypher \ + -d "query=MATCH ()-[p:route]->() RETURN p LIMIT 10" \ + -d "explain=details" + +The `explain` output: + @@ -14 +73,0 @@ Here, `DFEPipelineScan` scans for edges that start from anonymous node `?anon_no - curl -d "query=MATCH ()-[p:route]->() RETURN p LIMIT 10" -k https://localhost:8182/openCypher -d "explain=details" ~