Esta página aún no está disponible en su idioma local. Estamos trabajando arduamente para agregar más versiones de idiomas. Gracias por tu apoyo.

On this page

Show all

Deleting Edges in Batches

Updated on 2022-09-14 GMT+08:00
You can use a specific API provided by GES to delete edges in batches. The sample code is as follows:
public static void deleteBatchEdges(GraphClient graphClient) throws ApiException 
{
     // Construct the information of a single edge.
    DeleteEdgeReq edge = new DeleteEdgeReq();
    edge.setSource("46");
    edge.setTarget("39");

    DeleteEdgeReq edgeWithIndex = new DeleteEdgeReq();
    edgeWithIndex.setSource("46");
    edgeWithIndex.setTarget("38");
    edgeWithIndex.setIndex("8");

    // Form the list of edges to be deleted.
    List<DeleteEdgeReq> edges = new ArrayList<>();
    edges.add(edge);
    edges.add(edgeWithIndex);

    // Construct a request for deleting edges in batches.
    DeleteBatchEdgeReq deleteBatchEdgeReq = new DeleteBatchEdgeReq();
    deleteBatchEdgeReq.setEdges(edges);

    // CExecute the request for deleting edges in batches.
    Map<String, Object> result = graphClient.deleteBatchEdge(deleteBatchEdgeReq);    
}
Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback