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

Deleting Filtered Vertices (2.2.7)

Function

This API is used to delete the vertex sets that meet the filter criteria.

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

URI

POST /ges/v1.0/{project_id}/graphs/{graph_name}/vertices/action?action_id=delete

Request Parameters

Table 2 Request body parameters

Parameter

Mandatory

Type

Description

labels

Either labels or vertexFilters is mandatory.

String

Filter criteria of the vertex type

vertexFilters

Either labels or vertexFilters is mandatory.

Object

Filter criteria, in JSONArray format. Vertices are filtered by property.

For details, see vertexFilters parameters.

begin

No

Integer

Start of a filter range. The value ranges from 0 to uint32_MAX. The default value is 0.

end

No

Integer

End of a filter range. The value ranges from 0 to uint32_MAX. The default value is uint32_MAX.

Note: If begin and end are not set, the vertices in the entire graph are filtered by default. You can set both parameters based on site requirements (for example, 10 million).

limit

No

Integer

Maximum number of vertices that can be deleted. By default, all vertices that meet the conditions are deleted.

Table 3 vertexFilters parameters

Parameter

Mandatory

Type

Description

propertyName

Either propertyName or degree is mandatory.

String

Property name

predicate

Yes

String

Predicate. Available values are =, <, >, <=, >=, range, has, hasNot, full_text_match, full_text_prefix, full_text_wildcard, full_text_regexp, full_text_fuzzy, and full_text_combination.

values

No

String

Value of the property or the degree of a vertex. If predicate is full_text_combination, the value cannot be a string.

type

No

String

Logical operator of the filter criteria. Possible values are and and or. The default value is and.

degree (2.4.0)

Either propertyName or degree is mandatory.

String

Degree of a vertex. The options are in, out, and both. The predicate can be =, <, >, <=, >=, or !=.

Response Parameters

Table 4 Response body parameters

Parameter

Type

Description

errorMessage

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

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.

jobId

String

ID of the vertex query job. This parameter is left blank when the request fails.

NOTE:

You can view the job execution status and obtain the return result by querying the job ID. For details, see Querying Job Status on the Service Plane (1.0.0).

Example Request

Delete the vertex sets that meet the filter criteria (only the asynchronous mode is supported). The vertex type filter criteria are movies and user, and the property name is Age.
POST https://{SERVER_URL}/ges/v1.0/{project_id}/graphs/{graph_name}/vertices/action?action_id=delete
  {
	"labels": [
		"movies",
		"user"
	],
	"vertexFilters": [
		{
			"propertyName": "Age",
			"predicate": "=",
			"values": [
				"18-24"
			]
		}
	]
  }

Example Response

Status code: 200

Example response for a successful request

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

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.8203"
}

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.