Executing Gremlin Queries
You can use a specific API provided by GES to perform Gremlin queries. The sample code is as follows:
During graph client initialization, an object with the same name as the graph has been generated in the system. You can use the graph name to query the object.
public static void executeGremlinQuery(GraphClient graphClient,String graphName) throws ApiException { //Gremlin command. An object with the same name as the graph is generated in the system during graph client initialization. You can directly use it as follows: String gremlinCommand = graphName + ".V(\"145\")"; GremlinQueryReq req = new GremlinQueryReq(); req.setCommand(gremlinCommand); Map<String, Object> stringObjectMap = graphClient.gremlinQuery(req); System.out.print(MapUtils.map2json(stringObjectMap)); }
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot