1

Environment: Janusgraph 0.3.3 cql-es, tinkergraph 3.3.3, gremlin driver 3.3.3 with remote websocket connection and following advice from stephen mallette: How to perform pagination in Gremlin

Following works in gremlin console:

t = g.V().hasLabel('V_USER').has('v_UserName',textContains('Frank'));[] 
t.next(1)

However in Java the graph traversal next operation does not return vertices

GraphTraversal<Vertex,Vertex> t = 
     g.V().hasLabel("V_USER").has("v_UserName","textContains('Frank')");
List<Vertex> vl = t.next(10) // returns null

The GraphTraversal variable t in debug appears as follows:

[GraphStep(vertex,[]), HasStep([~label.eq(V_USER), 
     v_UserName.eq(textContains('Frank')))])]

So I assume I need to do something other than append the .next() function but I cannot figure out what. Any assistance much appreciated.

ptc
  • 734
  • 5
  • 11
  • Seems to work for me in [this example](https://github.com/pluradj/janusgraph-remote-java-example/blob/so-pagination-next/src/main/java/pluradj/janusgraph/example/RemoteJavaExample.java#L56-L58). A bit surprised `t.next(10)` would return `null` instead of an empty list. Do you have a stack trace? – Jason Plurad Nov 26 '18 at 21:01
  • Thanks Jason appreciate the response and link to the example. My code was returning an empty list, the problem was with the text contains predicate which in Java needs to be Text.textContains. – ptc Nov 28 '18 at 19:17

1 Answers1

0

Problem was with text contains predicate which need to user Text.textContains function in Java, thanks to Jason Plurad for his response and example.

ptc
  • 734
  • 5
  • 11