Updated on 2023-08-04 GMT+08:00

Exporting Filtered Edges (2.2.7)

Function

This API is used to export the edge set that meets the filter criteria.

URI

POST /ges/v1.0/{project_id}/graphs/{graph_name}/edges/action?action_id=export

Request Parameters

Table 1 Request body parameters

Parameter

Mandatory

Type

Description

exportPath

Yes

String

Export path

fileName

No

String

Name of the exported file

obsParameters

Yes

String

OBS authentication parameters. For details, see Table 3.

labels

Either labels or edgeFilters is mandatory.

String

Filter criteria of the relationship type

edgeFilters

Either labels or edgeFilters is mandatory.

String

Filter criteria, in JSONArray format. Vertices are filtered by property. For details, see Table 4.

Response Parameters

Table 2 Response body parameters

Parameter

Type

Description

errorMessage

String

System prompt.

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

errorCode

String

System prompt code.

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

jobId

String

ID of the edge query job

NOTE:

You can view the job execution status and obtain the return result by querying the job ID. For details, see Job Management APIs.

jobType

String

Type of an asynchronous job

Example Request

Export edges that meet filter criteria (only the asynchronous mode is supported). The relationship type filter criterion is rate, the property names are Score and Datetime, and the export path is demo_movie/.
POST https://{SERVER_URL}/ges/v1.0/{project_id}/graphs/{graph_name}/edges/action?action_id=export
  {
	"labels": [
		"rate"
	],
	"edgeFilters": [
		{
			"propertyName": "Score",
			"predicate": ">=",
			"values": [
				"2"
			]
		},
		{
			"propertyName": "Datetime",
			"predicate": "range",
			"values": [
				"1998-12-27 01:00:00",
				"2000-12-31 00:12:38"
			],
			"type": "or"
		}
	],
	"exportPath": "demo_movie/",
	"fileName": "export_rate.csv",
	"obsParameters": {
		"accessKey": "XXXXXXX",
		"secretKey": "XXXXXXX"
	}
  }

Example Response

Status code: 200

Example response for a successful request

Http Status Code: 200
{
  "jobId": "03e774f5-29ea-4187-9508-5435f3892ead016886200",
  "jobType": 0
}

Status code: 400

Example response for a failed request
Http Status Code: 400
{
  "errorMessage": "Bad Request, parameter labels and vertexFilters cannot all be null",
  "errorCode": "GES.8103"
}

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.

Error Codes

See Error Codes.