Deze pagina is nog niet beschikbaar in uw eigen taal. We werken er hard aan om meer taalversies toe te voegen. Bedankt voor uw steun.

On this page

Show all

Help Center/ Graph Engine Service/ devg/ Using the Service Plane SDK/ Querying Vertices That Meet Filtering Conditions

Querying Vertices That Meet Filtering Conditions

Updated on 2022-09-14 GMT+08:00

You can use a specific API provided by GES to query the vertex set that meet the filtering conditions. The sample code is as follows:

 public static void vertexQuery(GraphClient graphClient) throws ApiException
{
//Request of querying vertices that meet the filtering conditions
VertexFilterQueryReq req = new VertexFilterQueryReq();
 List<String> labels = new ArrayList<>();
 labels.add("movie");
//Filter vertices by label.
req.setLabels(labels);
//Set the offset and limit.
req.setOffset(0);
 req.setLimit(5);
//Send the request to obtain the asynchronous API result.
AsyncAPIResp asyncAPIResp = graphClient.vertexQuery(req);
//This API is an asynchronous API. Obtain the jobId.
String jobId = asyncAPIResp.getJobId();
//Vertex query job request
VertexQueryJobReq req1 = new VertexQueryJobReq();
//Set the jobId.
req1.setJobId(jobId);
//Obtain the job query result.
JobResp<QueryData<VertexQueryResult>> resp = graphClient.queryJobStatus(req1);
 System.out.println(resp);
}
Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback