Commands graph/annotate_degrees¶
Make new graph with degrees.
POST /v1/commands/¶
GET /v1/commands/:id¶
Request¶
Route
POST /v1/commands/
Body
name: | graph/annotate_degrees |
---|---|
arguments: | graph : Graph
output_property_name : unicode
degree_option : unicode (default=None)
input_edge_labels : list (default=None)
|
Headers
Authorization: test_api_key_1
Content-type: application/json
Description
Creates a new graph which is the same as the input graph, with the addition that every vertex of the graph has its degree stored in a user-specified property.
Degree Calculation
A fundamental quantity in graph analysis is the degree of a vertex: The degree of a vertex is the number of edges adjacent to it.
For a directed edge relation, a vertex has both an out-degree (the number of edges leaving the vertex) and an in-degree (the number of edges entering the vertex).
The Trusted Analytics Platform routine annotate_degrees
can be executed at distributed scale.
In the presence of edge weights, vertices can have weighted degrees: The weighted degree of a vertex is the sum of weights of edges adjacent to it. Analogously, the weighted in-degree of a vertex is the sum of the weights of the edges entering it, and the weighted out-degree is the sum of the weights of the edges leaving the vertex.
The toolkit provides annotate_weighted_degrees for the distributed calculation of weighted vertex degrees.
Response¶
Status
200 OK
Body
Returns information about the command. See the Response Body for Get Command here below. It is the same.
GET /v1/commands/:id¶
Request¶
Route
GET /v1/commands/18
Body
(None)
Headers
Authorization: test_api_key_1
Content-type: application/json
Response¶
Status
200 OK
Body
dict
Dictionary containing the vertex type as the key and the corresponding vertex’s frame with a column storing the annotated degree for the vertex in a user specified property. Call dictionary_name[‘label’] to get the handle to frame whose vertex type is label.