How to return a Vertex in the tinkerpop/gremlin format instead of the DSE graph format?

前端 未结 2 527
挽巷
挽巷 2021-01-27 00:34

I am trying to return a Vertex (in tinkerpop format) that it was just created with Gremlin:

DseCluster dseCluster = DseCluster.builder()
        .addContactPoint         


        
2条回答
  •  耶瑟儿~
    2021-01-27 01:12

    According to the lengthy discussion I had with Datastax Team through jira and emails:

    It is indeed possible to have Fluent API and get back pure Gremlin/tinkerpop objects. This is possible as illustrated here (java-dse graph 1.x documentation) using next(), toList() directly on GraphTraversalSource and not using executeGraph() which will return the DSE Objects.

    So the above code changes to:

    Vertex user = graph.addV("User")
                     .property("username", "testuser").next();
    

    where graph is a GraphTraversalSource object and Vertex is a org.apache.tinkerpop.gremlin.structure.Vertex object.

提交回复
热议问题