GraphServiceVertexManagementApi

All URIs are relative to {INTERACTIVE_ENDPOINT}

Method

HTTP request

Description

addVertex

POST /v1/graph/{graph_id}/vertex

Add vertex to the graph

deleteVertex

DELETE /v1/graph/{graph_id}/vertex

Remove vertex from the graph

getVertex

GET /v1/graph/{graph_id}/vertex

Get the vertex’s properties with vertex primary key.

updateVertex

PUT /v1/graph/{graph_id}/vertex

Update vertex’s property

addVertex

String addVertex(graphId, vertexRequest)

Add vertex to the graph

Add the provided vertex to the specified graph.

Example

// Import classes:
import com.alibaba.graphscope.interactive.ApiClient;
import com.alibaba.graphscope.interactive.ApiException;
import com.alibaba.graphscope.interactive.Configuration;
import com.alibaba.graphscope.interactive.models.*;
import com.alibaba.graphscope.interactive.api.GraphServiceVertexManagementApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("{INTERACTIVE_ENDPOINT}");

    GraphServiceVertexManagementApi apiInstance = new GraphServiceVertexManagementApi(defaultClient);
    String graphId = "graphId_example"; // String | 
    VertexRequest vertexRequest = new VertexRequest(); // VertexRequest | Add vertex to graph.
    try {
      String result = apiInstance.addVertex(graphId, vertexRequest);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling GraphServiceVertexManagementApi#addVertex");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name

Type

Description

Notes

graphId

String

vertexRequest

VertexRequest

Add vertex to graph.

[optional]

Return type

String

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json

  • Accept: application/json

HTTP response details

Status code

Description

Response headers

200

Successfully created vertex

-

400

Invalid input vertex

-

404

Graph not found

-

409

Vertex already exists

-

500

Server internal error

-

deleteVertex

String deleteVertex(graphId, label, primaryKeyValue)

Remove vertex from the graph

Remove the vertex from the specified graph.

Example

// Import classes:
import com.alibaba.graphscope.interactive.ApiClient;
import com.alibaba.graphscope.interactive.ApiException;
import com.alibaba.graphscope.interactive.Configuration;
import com.alibaba.graphscope.interactive.models.*;
import com.alibaba.graphscope.interactive.api.GraphServiceVertexManagementApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("{INTERACTIVE_ENDPOINT}");

    GraphServiceVertexManagementApi apiInstance = new GraphServiceVertexManagementApi(defaultClient);
    String graphId = "graphId_example"; // String | 
    String label = "label_example"; // String | The label name of querying vertex.
    Object primaryKeyValue = null; // Object | The value of the querying vertex's primary key
    try {
      String result = apiInstance.deleteVertex(graphId, label, primaryKeyValue);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling GraphServiceVertexManagementApi#deleteVertex");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name

Type

Description

Notes

graphId

String

label

String

The label name of querying vertex.

primaryKeyValue

Object

The value of the querying vertex’s primary key

Return type

String

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined

  • Accept: application/json

HTTP response details

Status code

Description

Response headers

200

Successfully delete vertex

-

400

Invalid input vertex

-

404

Vertex not exists or Graph not exits.

-

500

Server internal error

-

getVertex

VertexData getVertex(graphId, label, primaryKeyValue)

Get the vertex’s properties with vertex primary key.

Get the properties for the specified vertex. example: ```http GET /endpoint?param1=value1&param2=value2 HTTP/1.1 Host: example.com ```

Example

// Import classes:
import com.alibaba.graphscope.interactive.ApiClient;
import com.alibaba.graphscope.interactive.ApiException;
import com.alibaba.graphscope.interactive.Configuration;
import com.alibaba.graphscope.interactive.models.*;
import com.alibaba.graphscope.interactive.api.GraphServiceVertexManagementApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("{INTERACTIVE_ENDPOINT}");

    GraphServiceVertexManagementApi apiInstance = new GraphServiceVertexManagementApi(defaultClient);
    String graphId = "graphId_example"; // String | The name of the graph
    String label = "label_example"; // String | The label name of querying vertex.
    Object primaryKeyValue = null; // Object | The primary key value of querying vertex.
    try {
      VertexData result = apiInstance.getVertex(graphId, label, primaryKeyValue);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling GraphServiceVertexManagementApi#getVertex");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name

Type

Description

Notes

graphId

String

The name of the graph

label

String

The label name of querying vertex.

primaryKeyValue

Object

The primary key value of querying vertex.

Return type

VertexData

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined

  • Accept: application/json

HTTP response details

Status code

Description

Response headers

200

Found vertex

-

400

Bad input parameter

-

404

Vertex not found or graph not found

-

500

Server internal error

-

updateVertex

String updateVertex(graphId, vertexRequest)

Update vertex’s property

Remove the vertex from the specified graph.

Example

// Import classes:
import com.alibaba.graphscope.interactive.ApiClient;
import com.alibaba.graphscope.interactive.ApiException;
import com.alibaba.graphscope.interactive.Configuration;
import com.alibaba.graphscope.interactive.models.*;
import com.alibaba.graphscope.interactive.api.GraphServiceVertexManagementApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("{INTERACTIVE_ENDPOINT}");

    GraphServiceVertexManagementApi apiInstance = new GraphServiceVertexManagementApi(defaultClient);
    String graphId = "graphId_example"; // String | 
    VertexRequest vertexRequest = new VertexRequest(); // VertexRequest | 
    try {
      String result = apiInstance.updateVertex(graphId, vertexRequest);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling GraphServiceVertexManagementApi#updateVertex");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name

Type

Description

Notes

graphId

String

vertexRequest

VertexRequest

[optional]

Return type

String

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json

  • Accept: application/json

HTTP response details

Status code

Description

Response headers

200

Successfully update vertex

-

400

Invalid input paramters

-

404

Vertex not exists

-

500

Server internal error

-