bricaud / graphexp

Interactive visualization of the Gremlin graph database with D3.js
Apache License 2.0
783 stars 216 forks source link

Search Query Fails on Amazon Neptune When Filtering on Vertex Property #44

Closed AndreiTapai closed 1 year ago

AndreiTapai commented 6 years ago

https://github.com/bricaud/graphexp/blob/fe930a9b78d561b0afedc98b4a28cbdfc777e70a/scripts/graphioGremlin.js#L130

Connected to an Amazon Neptune backend, SINGLE_COMMANDS_AND_NO_VARS = true:

Filtering on a vertex property name produces g.V().has('name', 'blah').aggregate('node').outE().as('edge').inV().where(within('node')).select('edge').toList();

The problem is that if the vertex property being filtered on is unique, the where(within('node')) returns an empty list of vertices. This comes out of Neptune as a 204 No Content which might not be handled correctly as nothing is rendered even though the vertex exists.

bricaud commented 6 years ago

Thanks. I don't see yet how to fix it, but I will have a look at it this week.

AndreiTapai commented 6 years ago

Well my idea would be to catch a 204 on the edge request and handle it gracefully somehow and just display the one node that would be returned by the vertex request. the click query should work from that point on. I might have time this week to make a PR for this.

bricaud commented 6 years ago

Yes. After catching a 204 error, a way would be to resend the request but without the edge query (since there is no edge) and setting edges = []. I put this edge query in case there are nodes sharing the same property and that are connected by edges, I want to display these edges together with the nodes.