Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Situation Awareness
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
Software Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
Help Center/ Graph Engine Service/ API Reference/ Service Plane APIs/ Memory Edition/ Updating Specified Properties of Vertices and Edges by Importing a File (2.2.13)

Updating Specified Properties of Vertices and Edges by Importing a File (2.2.13)

Updated on 2024-05-23 GMT+08:00

Function

This API is used to update specified properties of vertices and edges by importing a file.

NOTE:

To prevent failures in restoring the updated graph data during system restarting, do not delete the data stored on OBS when the graph is in use.

URI

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

Import a file to update specified properties of vertices and edges. 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=import-properties
{
  "vertexsetPath": "datasets/movie/movie.csv",
  "vertexsetFormat": "csv",
  "vertexProperties": [
    {
      "label": "movie",
      "properties": [
        "genres"
      ]
    }
  ],  
  "edgesetPath": "datasets/movie/ranking_edge.csv",
  "edgesetFormat": "csv",
  "edgeProperties": [
    {
      "label": "rate",
      "properties": [
        "Datetime"
      ]
    }
  ],
  "targetProperties": [
    {
      "label": "rate",
      "properties": [
        "Rating"
      ]
    }
  ],
  "delimiter": ",",
  "trimQuote": "\"",
  "obsParameters": {
	"accessKey": "XXXXXXX",
	"secretKey": "XXXXXXX"
  },
  "vertexFileContainLabel":  true
}

Request Parameters

NOTE:

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

  • Vertex file (including label): vertex ID,label,property_1...property_n
  • Vertex file (excluding label): vertex ID,property_1...property_n
  • Edge file: source vertex ID, target vertex ID, label, edge ID, property_1...property_n
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.

vertexProperties

Mandatory if vertexsetPath exists

Object

Label of a vertex and list of properties to be updated in a vertex file, in JSONArray format For details, see Table 3.

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.

edgeProperties

Mandatory if edgesetPath exists

Object

Label of an edge and list of properties to be updated in an edge file, in JSONArray format For details, see Table 4.

targetProperties

Mandatory if edgesetPath exists

Object

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

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 6.

vertexFileContainLabel

No

Boolean

Whether the vertex file contains label information. This parameter is optional. The default value is true.

Table 3 vertexProperties parameter description

Parameter

Mandatory

Type

Description

label

Yes

String

Name of a label

properties

Yes

Object

Properties to be updated, in JSONArray format. The sequence of the properties must be the same as that in the vertex file.

Table 4 edgeProperties parameter description

Parameter

Mandatory

Type

Description

label

Yes

String

Name of a label

properties

Yes

Object

Properties to be updated, in JSONArray format. The sequence of the properties must be the same as that in the edge file.

Table 5 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.

Table 6 obsParameters parameter description

Parameter

Mandatory

Type

Description

accessKey

Yes

string

AK value

secretKey

Yes

string

SK value

Response Parameters

Table 7 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

NOTE:

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

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.

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback