Updated on 2024-12-03 GMT+08:00

Community Evolution (temporal_graph)

Function

The community evolution algorithm generates a temporal graph that shows structure changes of a community over time.

Figure 1 Principle

URL

POST /ges/v1.0/{project_id}/graphs/{graph_name}/dynamicgraphs/action?action_id=execute-analysis

Table 1 URI parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID. For details about how to obtain the project ID, see Obtaining a Project ID.

graph_name

Yes

String

Graph name

Request Parameters

Table 2 Request body parameters

Parameter

Mandatory

Type

Description

algorithmName

Yes

String

Algorithm name

dynamicRange

Yes

Object

Temporal parameters

parameters

Yes

String

Algorithm parameters

Table 3 dynamicRange parameters

Parameter

Mandatory

Type

Description

start

Yes

Date or integer

Start time of the temporal analysis. The start time must be earlier than the end time.

end

Yes

Date or integer

End time of the temporal analysis

time_props

Yes

Object

Time properties for the temporal analysis

Table 4 time_props parameters

Parameter

Mandatory

Type

Description

stime

Yes

String

Property name of the start time

etime

Yes

String

Property name of the end time

Table 5 parameters parameter description

Parameter

Mandatory

Type

Description

source

Yes

String

Vertices in the community network. You can specify a maximum of 100,000 vertices.

temporal_vertex

No

Boolean

Whether to perform community evolution on a node. The default value is false.

Response Parameters

Table 6 Parameters in a response

Parameter

Mandatory

Type

Description

errorMessage

No

String

System prompt. If the execution succeeds, this parameter may be left blank. If the execution fails, this parameter is used to display the error message.

errorCode

No

String

System prompt. If the execution succeeds, this parameter may be left blank. If the execution fails, this parameter is used to display the error code.

data

No

Json

Result details. For details, see Table 7.

Table 7 data parameter description

Parameter

Mandatory

Type

Description

vertices

No

List

Vertex set contained in the result.

edges

No

List

Edge set contained in the result.

Example Request

Observe the community evolution of some nodes. The algorithm name is temporal_graph, the start time of dynamic analysis is ${startTime}, and the end time is ${endTime}.

POST  http://{SERVER_URL}/ges/v1.0/{project_id}/graphs/{graph_name}/dynamicgraphs/action?action_id=execute-analysis
{
  "algorithmName":"temporal_graph",
  "dynamicRange":{
    "start":"${startTime}",
    "end":"${endTime}",
    "time_props":{"stime":"${property(start_time)}","etime":"${property(start_time)}"}
  },
  "parameters":{
        "sources":[],
        "temporal_vertex":false
  }
}

Example Response

Status code: 200

Example response for a successful request

{
	"data": {
		"vertices": [{
			"id": "Place00032",
			"label": "Place",
			"properties": {}
		}, {
			"id": "Person00041",
			"label": "Person",
			"properties": {
				"gender": ["Female"],
				"phone": ["P0334529194"],
				"name": ["Wu Guifang"],
				"startTime": [1774368],
				"endTime": [16756560],
				"age": [48]
			}
		}],
		"edges": [{
			"index": "0",
			"source": "Person00041",
			"label": "hasVisit",
			"properties": {
				"startTime": [1646092800],
				"visitDate": [20220301],
				"endTime": [1646126769]
			},
			"target": "Place00032"
		}, {
			"index": "3",
			"source": "Person00041",
			"label": "hasVisit",
			"properties": {
				"startTime": [1646168289],
				"visitDate": [20220301],
				"endTime": [1646179199]
			},
			"target": "Place00032"
		}]
	}
}

Status code: 400

Example response for a failed request

{
"errorMessage":"${errorMessage}",
"errorCode":"GES.8301"
}

Status Codes

Return Value

Description

400 Bad Request

Request error.

401 Unauthorized

Authorization failed.

403 Forbidden

No operation permissions.

404 Not Found

No resources found.

500 Internal Server Error

Internal server error.

503 Service Unavailable

Service unavailable.