AWS neptune-analytics documentation change
Summary
Updated parameter name from 'vertexLabel' to 'vertexLabels', reordered sections, replaced query examples with sample output structure, and updated example queries to use degreeDistribution procedure with statistics output.
Security assessment
Changes involve parameter name correction (vertexLabel → vertexLabels), documentation structure reorganization, and updated examples. No security vulnerabilities, patches, or security features are mentioned. Modifications appear to be routine documentation improvements for accuracy and clarity.
Diff
diff --git a/neptune-analytics/latest/userguide/degreeDistribution.md b/neptune-analytics/latest/userguide/degreeDistribution.md index ffb12f929..6594c2935 100644 --- a//neptune-analytics/latest/userguide/degreeDistribution.md +++ b//neptune-analytics/latest/userguide/degreeDistribution.md @@ -5 +5 @@ -SyntaxInputsQuery examplesSample output +SyntaxInputsSample outputQuery examples @@ -21 +21 @@ The `%degreeDistribution` magic command in the notebook provides an interactive - vertexLabel: "a list of vertex labels for filtering (optional)", + vertexLabels: "a list of vertex labels for filtering (optional)", @@ -38 +38 @@ To filter on one more edge labels, provide a list of the ones to filter on. If n - * **vertexLabel** _(optional)_ – _type:_ `a list of vertex label strings`; _default: no vertex filtering_. + * **vertexLabels** _(optional)_ – _type:_ `a list of vertex label strings`; _default: no vertex filtering_. @@ -59,6 +59 @@ If set to `0`, uses all available threads to complete execution of the individua -## Query examples for `.degreeDistribution` - -This is a standalone example, where the source node list is explicitly specified in the query: - - - CALL neptune.algo.degree(["101"], {edgeLabel: "route"}) +## Sample `.degreeDistribution` output @@ -66 +61 @@ This is a standalone example, where the source node list is explicitly specified -This is a more complicated standalone query submitted using the AWS CLI: +Here is an example of the output returned by .degreeDistribution when run against the [ sample air-routes dataset [nodes]](https://github.com/krlawrence/graph/blob/main/sample-data/air-routes-latest-nodes.csv), and [ sample air-routes dataset [edges]](https://github.com/krlawrence/graph/blob/main/sample-data/air-routes-latest-edges.csv), when using the following query: @@ -69,0 +65,2 @@ This is a more complicated standalone query submitted using the AWS CLI: + \ + --region ${region} @@ -71,11 +68 @@ This is a more complicated standalone query submitted using the AWS CLI: - --query-string 'CALL neptune.algo.degree( - ["101", "102", "103"], - { - edgeLabels: ["route"], - vertexLabel: "airport", - traversalDirection: "inbound", - concurrency: 2 - } - ) - YIELD node, degree - RETURN node, degree' \ + --query-string "CALL neptune.algo.degreeDistribution({binWidth: 50, vertexLabels: ['airport', 'country'], edgeLabels: ['route'], traversalDirection: 'inbound'}) YIELD output RETURN output" \ @@ -85,13 +72 @@ This is a more complicated standalone query submitted using the AWS CLI: -This is a query integration example with frontier injection, where `.degree` follows a `MATCH` clause and finds the degree value for all vertices returned by `MATCH(n:airport)`: - - - MATCH(n:airport) - CALL neptune.algo.degree(n, {edgeLabels: ["route"]}) - YIELD degree - RETURN n, degree' - -This is an example of multiple `.degree` invocations chained together, where the output of one invocation serves as the input of another: - - - CALL neptune.algo.degree( - ["108"], + cat /tmp/out.txt @@ -99,2 +74,14 @@ This is an example of multiple `.degree` invocations chained together, where the - edgeLabels: ["route"], - vertexLabel: "airport" + "results": [{ + "output": { + "statistics": { + "maxDeg": 307, + "mean": 13.511229946524065, + "minDeg": 0, + "p50": 3, + "p75": 9, + "p90": 36, + "p95": 67, + "p99": 173, + "p999": 284 + }, + "distribution": [[0, 268], [50, 3204], [100, 162], [150, 54], [200, 29], [250, 16], [300, 5], [350, 2]] @@ -102,7 +89 @@ This is an example of multiple `.degree` invocations chained together, where the - ) - YIELD node - CALL neptune.algo.degree( - node, - { - edgeLabels: ["route"], - vertexLabel: "airport" + }] @@ -110,5 +90,0 @@ This is an example of multiple `.degree` invocations chained together, where the - ) - YIELD node AS node2 WITH id(node2) AS id - RETURN id - -###### Warning @@ -116 +91,0 @@ This is an example of multiple `.degree` invocations chained together, where the -It is not good practice to use `MATCH(n)` without restriction in query integrations. Keep in mind that every node returned by the `MATCH(n)` clause invokes the algorithm once, which can result a very long-running query if a large number of nodes is returned. Use `LIMIT` or put conditions on the `MATCH` clause to restrict its output appropriately. @@ -118 +93 @@ It is not good practice to use `MATCH(n)` without restriction in query integrati -## Sample `.degreeDistribution` output +## Query examples for `.degreeDistribution` @@ -120 +95 @@ It is not good practice to use `MATCH(n)` without restriction in query integrati -Here is an example of the output returned by .degree when run against the [ sample air-routes dataset [nodes]](https://github.com/krlawrence/graph/blob/main/sample-data/air-routes-latest-nodes.csv), and [ sample air-routes dataset [edges]](https://github.com/krlawrence/graph/blob/main/sample-data/air-routes-latest-edges.csv), when using the following query: +This is a standalone example, where the in-degree distribution is computed for the graph with specified vertex labels and edge label, and the mean degree is returned. @@ -123,9 +98,8 @@ Here is an example of the output returned by .degree when run against the [ samp - aws neptune-graph execute-query \ - --graph-identifier ${graphIdentifier} \ - --query-string 'MATCH (n) - CALL neptune.algo.degree(n) - YIELD node, degree - RETURN node, degree - LIMIT 2' \ - --language open_cypher \ - /tmp/out.txt + CALL neptune.algo.degreeDistribution({ + vertexLabels: ['airport', 'country'], + edgeLabels: ['route'], + traversalDirection: 'inbound', + }) + YIELD output + WITH output.statistics.mean as meanDegree + RETURN meanDegree @@ -133,53 +106,0 @@ Here is an example of the output returned by .degree when run against the [ samp - cat /tmp/out.txt - { - "results": [ - { - "node": { - "~id": "10", - "~entityType": "node", - "~labels": ["airport"], - "~properties": { - "lat": 38.94449997, - "elev": 313, - "longest": 11500, - "city": "Washington D.C.", - "type": "airport", - "region": "US-VA", - "desc": "Washington Dulles International Airport", - "code": "IAD", - "prscore": 0.002264724113047123, - "lon": -77.45580292, - "wccid": 2357352929951779, - "country": "US", - "icao": "KIAD", - "runways": 4 - } - }, - "degree": 312 - }, - { - "node": { - "~id": "12", - "~entityType": "node", - "~labels": ["airport"], - "~properties": { - "lat": 40.63980103, - "elev": 12, - "longest": 14511, - "city": "New York", - "type": "airport", - "region": "US-NY", - "desc": "New York John F. Kennedy International Airport", - "code": "JFK", - "prscore": 0.002885053399950266, - "lon": -73.77890015, - "wccid": 2357352929951779, - "country": "US", - "icao": "KJFK", - "runways": 4 - } - }, - "degree": 403 - } - ] - }