addEdge using gremlin through Rexster from dexgraph

51 views
Skip to first unread message

chandra

unread,
May 14, 2014, 5:10:37 AM5/14/14
to spar...@googlegroups.com
Hello Team,

 We are getting an issue when creating a new vertex and then creating a new Edge through gremlin.

Please find the code here:

g.addVertex(null,[namespaceType:4, accountNamespace:"AAAA", accountId:"BBBB", accountKey:2906705, accountType:-999999999, discoveryDate:1396512489000d, nodeType:1, accountScope:-999999999]

gremlin>g.v(5776386)
==>v[5776386]

gremlin>g.addEdge(null,g.v(3472800),g.v(5776386),'ISACCOUNTOWNEROF')
==>javax.script.ScriptException: java.lang.RuntimeException: [DEX: 10] Invalid destination.


This doesnot happen when we create a new Edge between already existing vertices (these are created through schema based ScriptParser).

The same thing happens with Tinkerpop Frames. Can you please clarify , are we missing fundamentally something where a dexgraph needs to be closed or committed each and everytime we create a vertex and subsequently an edge.

Regards,
Chandra.

c3po.ac

unread,
May 14, 2014, 6:23:05 AM5/14/14
to spar...@googlegroups.com
Hi,

When a new vertex is created using blueprints/gremlin, Sparksee (DEX for your version) uses the graph label to find the NodeType.
If the label is not set, a default node type would be used.

I guess that in your schema the edge type is restricted and the target node type is not  this default vertex type.

So you should set the label before adding the new vertex:

((DexGraph) g).label.set("the node type");
 g
.addVertex(null,...


The documentation for the Sparksee implementation of blueprints is here:
https://github.com/tinkerpop/blueprints/wiki/Sparksee-Implementation

Best regards


El dimecres 14 de maig de 2014 11:10:37 UTC+2, chandra va escriure:
Reply all
Reply to author
Forward
0 new messages