Help Center> Graph Engine Service> API Reference> Service Plane APIs> Memory Edition> Deleting Vertices and Edges by Files (2.2.15)
Updated on 2023-08-04 GMT+08:00

Deleting Vertices and Edges by Files (2.2.15)

Function

This API is used to delete vertices and edges by reading the files.

URI

POST /ges/v1.0/{project_id}/graphs/{graph_name}/action?action_id=delete-by-file
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

Example Request

Delete vertices and edges by reading files. The vertex file directory is datasets/movie/movie.csv, and the vertex data set format is CSV. The edge file directory is datasets/movie/ranking_edge.csv, and the edge data set format is CSV.

POST http://Endpoint/ges/v1.0/{project_id}/graphs/{graph_name}/action?action_id=delete-by-file
{
  "vertexsetPath": "datasets/movie/movie.csv",
  "vertexsetFormat": "csv",
  "edgesetPath": "datasets/movie/ranking_edge.csv",
  "edgesetFormat": "csv",
  "targetProperties": [
    {
      "label": "rate",
      "properties": [
        "Rating"
      ]
    }
  ],
  "delimiter": ",",
  "trimQuote": "\"",
  "obsParameters": {
  "accessKey": "XXXXXXX",
  "secretKey": "XXXXXXX"
  }
}

Request Parameters

Table 2 Request body parameters

Parameter

Mandatory

Type

Description

vertexsetPath

Either vertexsetPath or edgesetPath is mandatory.

String

Vertex file directory or name

vertexsetFormat

No

String

Format of the vertex data set. Currently, only the CSV format is supported.

The CSV format is used by default.

edgesetPath

Either vertexsetPath or edgesetPath is mandatory.

String

Edge file directory or name

edgesetFormat

No

String

Format of the edge data set. Currently, only the CSV format is supported.

The CSV format is used by default.

targetProperties

No

Object

Indicates property information used to distinguish duplicate edges in the edge file, in JSONArray format. For details, see Table 3.

delimiter

No

Character

Field separator in a CSV file. The default value is comma (,). The default element separator in a field of the list/set type is semicolon (;).

trimQuote

No

Character

Field quote character in a CSV file. The default value is double quotation marks ("). They are used to enclose a field if the field contains separators or line breaks.

obsParameters

Yes

String

OBS authentication parameters. For details, see Table 3.

Table 3 targetProperties parameter description

Parameter

Mandatory

Type

Description

label

Yes

String

Name of a label

properties

Yes

Object

Edge ID properties, in JSONArray format. Currently, only one property is supported.

The format of the CSV file for updating properties is as follows:

  • Vertex file: Vertex ID
  • Edge file (excluding the label): source vertex ID and destination vertex ID
  • Edge file (including the label): source vertex ID, destination vertex ID, label, and edge ID

Response Parameters

Table 4 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 an asynchronous job

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 Response

Status code: 200

Example response for a successful request

Http Status Code: 200
{
  "jobId": "b4f2e9a0-0439-4edd-a3ad-199bb523b613"
}

Status code: 400

Example response for a failed request

Http Status Code: 400
{
  "errorMessage": "parameter format error",
  "errorCode": "GES.8013"
}

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.