Cookie の設定を選択する

当社は、当社のサイトおよびサービスを提供するために必要な必須 Cookie および類似のツールを使用しています。当社は、パフォーマンス Cookie を使用して匿名の統計情報を収集することで、お客様が当社のサイトをどのように利用しているかを把握し、改善に役立てています。必須 Cookie は無効化できませんが、[カスタマイズ] または [拒否] をクリックしてパフォーマンス Cookie を拒否することはできます。

お客様が同意した場合、AWS および承認された第三者は、Cookie を使用して便利なサイト機能を提供したり、お客様の選択を記憶したり、関連する広告を含む関連コンテンツを表示したりします。すべての必須ではない Cookie を受け入れるか拒否するには、[受け入れる] または [拒否] をクリックしてください。より詳細な選択を行うには、[カスタマイズ] をクリックしてください。

Degree mutate centrality algorithm

フォーカスモード
Degree mutate centrality algorithm - Neptune Analytics
このページはお客様の言語に翻訳されていません。 翻訳のリクエスト

The .degree.mutate centrality algorithm counts the number of incident edges of every node in the graph. This measure of how connected the node is can in turn indicate the node's importance and level of influence in the network. The .degree.mutate algorithm then stores each node's calculated degree value as a property of the node.

The algorithm returns a single success flag (true or false), which indicates whether the writes succeeded or failed.

.degree.mutate   syntax

CALL neptune.algo.degree.mutate( { writeProperty: A name for the new node property where the degree values will be written, edgeLabels: [a list of edge labels for filtering (optional)], vertexLabel: "a node label for filtering (optional)", traversalDirection: traversal direction (optional), concurrency: number of threads to use (optional) } ) YIELD success RETURN success

.degree.mutate   inputs

a configuration object that contains:
  • writeProperty (required)   –   type: string;   default: none.

    A name for the new node property that will contain the computed degree values.

  • edgeLabels   (optional)   –   type: a list of edge label strings;   example: ["route", ...];   default: no edge filtering.

    To filter on one more edge labels, provide a list of the ones to filter on. If no edgeLabels field is provided then all edge labels are processed during traversal.

  • vertexLabel (optional)   –   type: string;   default: none.

    A node label for node filtering. If vertexLabel is provided, vertices matching the label are the only vertices that are processed, including vertices in the input list.

  • traversalDirection (optional)   –   type: string;   default: "outbound".

    The direction of edge to follow. Must be one of: "inbound", "outbound", or "both".

  • concurrency   (optional)   –   type: 0 or 1;   default: 0.

    Controls the number of concurrent threads used to run the algorithm.

    If set to 0, uses all available threads to complete execution of the individual algorithm invocation. If set to 1, uses a single thread. This can be useful when requiring the invocation of many algorithms concurrently.

Output of the .degree.mutate algorithm

The computed degree values are written to a new vertex property using the property name specified by the writeProperty input parameter.

A single Boolean success value (true or false) is returned, which indicates whether or not the writes succeeded.

.degree.mutate query examples

The example below is a standalone example, where the source vertex list is explicitly provided in the query.

This query writes the degree values of all nodes in the graph to a new vertex property called DEGREE:

CALL neptune.algo.degree.mutate({writeProperty: "DEGREE", edgeLabels: ["route]})

After using the mutate algorithm, the newly written properties can then be accessed in subsequent queries. For example, after the mutate algorithm call above, you could use the following query to retrieve the .degree property of specific nodes:

MATCH (n) WHERE id(n) IN ["101", "102", "103"] RETURN n.DEGREE'

Sample output from .degree.mutate

Here is an example of the output returned by .degree.mutate when run against the sample air-routes dataset [nodes], and sample air-routes dataset [edges], when using the following query:

aws neptune-graph execute-query \ --graph-identifier ${graphIdentifier} \ --query-string "CALL neptune.algo.degree.mutate({writeProperty: 'degree'}) YIELD success RETURN success" \ --language open_cypher \ /tmp/out.txt cat /tmp/out.txt { "results": [ { "success": true } ] }

このページの内容

プライバシーサイト規約Cookie の設定
© 2025, Amazon Web Services, Inc. or its affiliates.All rights reserved.