更新时间:2025-06-05 GMT+08:00
分享

时序路径分析(Temporal Paths)

功能介绍

根据输入参数,执行时序路径分析算法。

注意:两点之间仅返回一条满足条件的时序路径。

URI

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

表1 路径参数

参数

是否必选

类型

说明

project_id

String

项目ID。获取方法请参见获取项目ID

graph_name

String

图名称。

请求参数

表2 Body参数说明

参数

是否必选

类型

说明

algorithmName

String

算法名称,取值为temporal_paths。

parameters

parameters Object

算法参数。详情请参考各算法参数描述。

dynamicRange

dynamicRange Object

动态分析时间参数。

表3 parameters

参数

是否必选

类型

说明

source

String

起点id。

targets

String

终点id集合。csv格式,ID之间以英文逗号分隔,例如:"Alice,Nana"。个数不大于100000。

directed

Boolean

是否考虑边的方向,取值为true 或false,默认值为false。

k

Integer

最大深度,取值范围在1-100,包括1和100,默认值为3。

strategy

String

运行的算法策略。取值为:shortest,foremost,fastest。

(注:fastest暂不支持)

默认值为shortest。

  • shortest:运行shortest temporal paths算法,返回距离最短的时序路径
  • foremost:运行foremost temporal paths算法,返回尽可能早的到达目标节点的时序路径
  • fastest:运行fastest temporal paths算法,返回耗费时间最短的时序路径
表4 dynamicRange

参数

是否必选

类型

说明

start

Date/ Integer

动态分析起始时间。

end

Date/ Integer

动态分析终止时间 。

time_props

time_props Object

动态分析的时间属性定义。

表5 time_props

参数

是否必选

类型

说明

stime

String

开始时间属性名称。

etime

String

结束时间属性名称 。

响应参数

表6 响应参数说明

参数

类型

说明

errorMessage

String

系统提示信息,执行成功时,字段可能为空。执行失败时,用于显示错误信息。

errorCode

String

系统提示信息,执行成功时,字段可能为空。执行失败时,用于显示错误码。

data

Json

时序路径分析的结果详情。

请求示例

指定起始节点id搜索周围与之相关联的点,算法名称为temporal_paths,动态分析的开始时间为1646092800,结束时间为1646170716,起点id为Person00014。
POST http://{SERVER_URL}/ges/v1.0/{project_id}/graphs/{graph_name}/dynamicgraphs/action?action_id=execute-analysis 
 {
  "algorithmName":"temporal_paths",
  "dynamicRange":{
    "start":1646092800,
    "end":1646170716,
    "time_props":
        {"stime":"startTime","etime":"endtime"}
    },
  "parameters":{
        "source":" Person00014",
        "targets":"Person00055,Person00058,Person00052,Person00061,Person00060,Place00032,Place00016,Place00026,Place00015,Place00043",
        "strategy":"shortest",
        "directed":true
  }
}

响应示例

状态码: 200

成功响应示例

Http Status Code: 200
{
	"data": {
		"outputs": {
			"data_return_size": 1,
			"direct": 1,
			"runtime": 0.00011,
			"temporal_paths": [
				[{
					"Person00014": {
						"arrive": 1646092800,
						"dist": 0,
						"predecessor": ""
					}
				}, {
					"Place00016": {
						"arrive": 1647169795,
						"dist": 1,
						"predecessor": "Person00014"
					}
				}]
			],
			"data_offset": 0,
			"data_total_size": 1
		}
	}
}

状态码: 400

失败响应示例

Http Status Code: 400
{
    "errorMessage": "Not found. Please check the input parameters.",
    "errorCode": "GES.8000"
}

状态码

返回值

说明

400 Bad Request

请求错误

401 Unauthorized

鉴权失败

403 Forbidden

没有操作权限

404 Not Found

找不到资源

500 Internal Server Error

服务内部错误

503 Service Unavailable

服务不可用

相关文档