path() output bug in gremlin-python with embedded neo4j

119 views
Skip to first unread message

Bailey Glen

unread,
Oct 9, 2017, 12:00:52 PM10/9/17
to Gremlin-users
My issue:
.path() doesn't seem to work in my setup from gremlin-python. For instance...
In [64]: g.V().hasLabel('HGNC').limit(5).both('ppi').simplePath().toList()
Out[64]:
[v[73260],
 v[60131],
 v[58111],
 v[65579],
 v[58127],
 v[64862],
 v[68876],
 v[65874],
 v[66937],
 v[57867]]

In [66]: g.V().hasLabel('HGNC').limit(5).both('ppi').simplePath().path().toList()
Out[66]:
[['@type', '@value'],
 ['@type', '@value'],
 ['@type', '@value'],
 ['@type', '@value'],
 ['@type', '@value'],
 ['@type', '@value'],
 ['@type', '@value'],
 ['@type', '@value'],
 ['@type', '@value'],
 ['@type', '@value']]



My setup:
I'm working in python with the offiical driver connecting to an embedded neo4j database on gremlin-server.
Tinkerpop built from fa246a1899b0d2165b43642f7ee0c21fe64ee6d9
Server with plugins: neo4j-gremlin,gremlin-python

host: 0
port: 8182
scriptEvaluationTimeout: 300000
channelizer: org.apache.tinkerpop.gremlin.server.channel.WebSocketChannelizer
graphs: {
  graph: files/neo4j-full.properties}
scriptEngines: {
  gremlin-groovy: {
    plugins: { org.apache.tinkerpop.gremlin.server.jsr223.GremlinServerGremlinPlugin: {},
               org.apache.tinkerpop.gremlin.jsr223.ImportGremlinPlugin: { 
                 classImports: [
                   "org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jElement",
                   "org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jGraph",
                   "org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jGraphVariables",
                   "org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jHelper",
                   "org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jProperty",
                   "org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jVertex",
                   "org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jVertexProperty",
                   "org.apache.tinkerpop.gremlin.neo4j.process.traversal.LabelP"],
                 methodImports: [org.apache.tinkerpop.gremlin.neo4j.process.traversal.LabelP#*]},
               org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin: {files: [scripts/empty-sample.groovy]}}
               },
  gremlin-python: {}}
serializers:
  - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV3d0] }}            # application/vnd.gremlin-v3.0+gryo
  - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0, config: { serializeResultToString: true }}                                                                      # application/vnd.gremlin-v3.0+gryo-stringd
  - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV3d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV3d0] }}        # application/json
processors:
  - { className: org.apache.tinkerpop.gremlin.server.op.session.SessionOpProcessor, config: { sessionTimeout: 28800000 }}
  - { className: org.apache.tinkerpop.gremlin.server.op.traversal.TraversalOpProcessor, config: { cacheExpirationTime: 600000, cacheMaxSize: 1000 }}
metrics: {
  consoleReporter: {enabled: true, interval: 180000},
  csvReporter: {enabled: true, interval: 180000, fileName: /tmp/gremlin-server-metrics.csv},
  jmxReporter: {enabled: true},
  slf4jReporter: {enabled: true, interval: 180000}}
strictTransactionManagement: false
maxInitialLineLength: 4096
maxHeaderSize: 8192
maxChunkSize: 8192
maxContentLength: 65536
maxAccumulationBufferComponents: 1024
resultIterationBatchSize: 64
writeBufferLowWaterMark: 32768
writeBufferHighWaterMark: 65536
ssl: {
  enabled: false}
threadPoolWorker: 4

initial neo4j database built in neo4j 3.2.3 

Stephen Mallette

unread,
Oct 11, 2017, 8:49:03 AM10/11/17
to Gremlin-users
I that is a serialization problem you might need to create an issue in JIRA....before you do though could you verify that you see the same problem with TinkerGraph?

--
You received this message because you are subscribed to the Google Groups "Gremlin-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/96c954ba-aef6-4fd6-a36c-1c004ef04648%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Bailey Glen

unread,
Oct 12, 2017, 1:16:06 PM10/12/17
to Gremlin-users
The issue does persist in a regular tinkergraph with gremlin-python. Can you point me to where I should submit the issue?
To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-user...@googlegroups.com.

Stephen Mallette

unread,
Oct 12, 2017, 1:20:16 PM10/12/17
to Gremlin-users
It's here: 


Interesting that it doesn't fail equally on TinkerGraph. Not sure what it might be now. Hopefully you can provide some simple reproduction steps that makes this easy to look into. Thanks.

To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/7db80bd8-95b5-459a-a257-efc3622da7bd%40googlegroups.com.

Bailey Glen

unread,
Oct 12, 2017, 3:11:11 PM10/12/17
to Gremlin-users
I think we may have a miscommunication. 
If I start tinkerpop server with an modern in tinkergraph, connect via gremlin python, and request .path(), it DOES fail in the same way. Was this what you wanted me to test?

Stephen Mallette

unread,
Oct 12, 2017, 3:48:51 PM10/12/17
to Gremlin-users
sorry - i don't know why i misread that. i just tested on the tp32 branch and I can't recreate a serialization problem there:

>>> g.V().hasLabel('person').both().path().toList()
[[v[1], v[3]], [v[1], v[2]], [v[1], v[4]], [v[2], v[1]], [v[4], v[5]], [v[4], v[3]], [v[4], v[1]], [v[6], v[3]]]
>>> g.V().hasLabel('person').both().simplePath().path().toList()
[[v[1], v[3]], [v[1], v[2]], [v[1], v[4]], [v[2], v[1]], [v[4], v[5]], [v[4], v[3]], [v[4], v[1]], [v[6], v[3]]]

I searched through the CHANGELOG a bit, but couldn't pinpoint when it was fixed. 3.2.3 was a really early  release (first one basically) of gremlin-python. Perhaps there were some issues there. Try upgrading across the board to 3.2.6 to see if that resolve the problem. I say "across the board" as I'm not so sure if you could hit serialization incompatibilities with 3.2.6 gremlin-python and a different version of Gremlin Server/Neo4j.  In theory there shouldn't have been breaks in format there, but I'd be hesitant to say that with complete certainty.

I'm also just noticing that your Gremlin Server configuration makes use of GraphSON 3.0 with GraphSONMessageSerializerV3d0 - that serializer isn't available until TinkerPop 3.3.0. Again, this could all just be a version mixing problem. In general, try to use all the same versions of all things TinkerPop as versions are most rigorously tested that way - we only recently, as of 3.3.0, started doing tested across versions with respect to IO/serialization. Hopefully this will resolve your problem.


To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/7c8c8328-61e0-423d-a0d1-7ca89a131a76%40googlegroups.com.

Bailey Glen

unread,
Oct 12, 2017, 9:01:28 PM10/12/17
to Gremlin-users
So....
I'm on the tinkerpop master, probably a few commits back.  I'm on neo4j 3.2.3. I don't think I can use the tp32 branch, as the neo4j-gremlin plugin looks to be 2.3.3 still. T
he only version I was a bit unclear on is the python package itself. pip installed 3.3.0 and I wasn't sure if I needed to get a newer version from somewhere..

Stephen Mallette

unread,
Oct 13, 2017, 7:03:44 AM10/13/17
to Gremlin-users
Ok - I got confused because i saw Neo4j 3.2.3 which i thought was neo4j-gremlin 3.2.3 but you were actually referring quite literally to Neo4j 3.2.3 which is neo4j-gremlin 3.3.0..............that's not the first time that version confusion has happened. There definitely seems to appear to be a bug with path() now that I'm looking at the right thing:

>>> g.V().hasLabel('person').both().path().toList()
[[u'@type', u'@value'], [u'@type', u'@value'], [u'@type', u'@value'], [u'@type', u'@value'], [u'@type', u'@value'], [u'@type', u'@value'], [u'@type', u'@value'], [u'@type', u'@value']]

That pretty bad....created the issue for you:


trying to figure out a fix now. Thanks for reporting this.


To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/c283f648-1ab3-4228-a2e3-a6520123e474%40googlegroups.com.

Stephen Mallette

unread,
Oct 13, 2017, 12:41:03 PM10/13/17
to Gremlin-users
An easy enough fix (once I got past a bunch of yak shaving) that is awaiting review:


Will be a part of 3.3.1.
Reply all
Reply to author
Forward
0 new messages