0

I am running a gremlin match query that limits the results based on the value of some of the properties of the graph. When I run the query in the gremlin console I get 91 vertices that match the pattern. When I run the same query through a javascript websocket connection I get only 64 returned. If I add .count() to the query I get the 91 expected. Is there a setting to allow all the results to be retrieved?

g.V().match(__.as('Patient').hasLabel('Patient').has('gender',eq('Male')).has('birth_date',gt(Date.parse('yyyy-mm-dd','1970-01-01'))).has('adoptee',true)).select('Patient')

Should get 91 but instead get

(64) [{…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}]

1 Answers1

1

64 is an interesting number. It is the default setting for resultIterationBatchSize in the Gremlin Server yaml file. Try to increase that and see if that fixes the problem. That said, you shouldn't have to do that as that setting just means that if the result exceeds 64 items then another batch of 64 should follow until the result is completed. There may have been a bug related to that with Gremlin Javascript at some point - if you can recreate the problem on the latest version you may need to create an issue in JIRA.

stephen mallette
  • 45,298
  • 5
  • 67
  • 135
  • Changing the resultIterationBatchSize in the YAML file changed the results. So do you think this is a bug that I should create a JIRA issue? – Shane Quint Apr 25 '19 at 21:15
  • I am actually not using the javascript language variant, but instead connecting to the gremlin server directly from a browser websocket connection. – Shane Quint Apr 25 '19 at 21:53
  • if you're not using gremlinjavascript or a compatible driver, then i guess i would expect the problem you're seeing. there is an underlying subprotocol within the websocket standard for Gremlin Server and only a compatible driver would likely gather the streamed results properly. – stephen mallette Apr 26 '19 at 10:59
  • I have recently tried to implement the gremlin-javascript on node.js and have not been able to get the example in the TinkerPop example to work. I am trying to run a script using the client.submit() because I have configured the server with ConfiguredGraphFactory and need to issue an ConfiguredGraphFactory.open(). It seems that the GLV has changed and gremlin.driver.Client doesn't exist any longer. I tried gremlin.createClient but then submit doesn't exist. – Shane Quint Sep 18 '19 at 23:12
  • did you try this? http://tinkerpop.apache.org/docs/current/reference/#_submitting_scripts_4 – stephen mallette Sep 19 '19 at 10:08