unable to add edge gremlinpython janusgraph

10 views
Skip to first unread message

Real Life Adventure

unread,
May 21, 2020, 8:10:02 AM5/21/20
to JanusGraph users
i am trying to add edge b/w vertices.not received any error when it executes.but edge is not added to graph.

followed below steps
v1=g.V().has('id',1).next()
v2=g.V().has('id',13).next()
g.V(v1).addE("Serivces").to(v2).next()

Thanks,
RLA.




Raghavendar T S

unread,
May 21, 2020, 8:22:37 AM5/21/20
to janusgra...@googlegroups.com
Hi 

Can you provide the schema as well? What is the query which you used to verify the read edge operation?

Thank you

Real Life Adventure

unread,
May 21, 2020, 9:04:01 AM5/21/20
to janusgra...@googlegroups.com
for querying edge count below query used.
g.E().count() is showing 0 in python as well in gremlin console.

Thanks,
RLA.

--
You received this message because you are subscribed to the Google Groups "JanusGraph users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to janusgraph-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/janusgraph-users/CABmtsnmNydq_Yn6n9c%3DJxTdmtbTYptma%3D7b75%2B47wX-GQobr%3Dg%40mail.gmail.com.

Raghavendar T S

unread,
May 21, 2020, 9:09:44 AM5/21/20
to janusgra...@googlegroups.com
Hi

Can you share the schema?

Thank you



--
Raghavendar T S

Real Life Adventure

unread,
May 21, 2020, 9:17:38 AM5/21/20
to janusgra...@googlegroups.com
 below schema i have used.
server= mgmt.makeVertexLabel('server').make()
Apps= mgmt.makeVertexLabel('Apps').make()
TagId= mgmt.makePropertyKey('TagId').dataType(String.class).make()
Partof= mgmt.makeEdgeLabel('Partof').make()

Thanks,
RLA. 

Raghavendar T S

unread,
May 21, 2020, 9:29:03 AM5/21/20
to janusgra...@googlegroups.com
I am not sure about the issue. But can you try adding label filter in the query for read operations.
E.g. g.V().hasLabel('LABEL').has('id',1).next()

Can you share the response for each of the queries separately with and without adding the label filter?

Thank you

--
You received this message because you are subscribed to the Google Groups "JanusGraph users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to janusgraph-use...@googlegroups.com.

Real Life Adventure

unread,
May 21, 2020, 10:01:49 AM5/21/20
to janusgra...@googlegroups.com
i am able to add edge from gremlin console.
please see below commands successfully added edge from gremlin console.
v1=g.V().has('id',2).next()
v2=g.V().has('id',14).next()
g.V(v1).addE("Serivces").to(v2).next()

but from python iam unable to add edge.

Thanks,
RLA.


Kevin Schmidt

unread,
May 21, 2020, 10:10:11 AM5/21/20
to JanusGraph users list
Where/how are you doing the g.E().count()?  Is it in the same session/transaction as the add or different?

It is possible that you are doing the add in python and the check in gremlin console, but are not doing a commit in python and thus the add isn't visible to the transaction in gremlin console.  When you do the add and check in gremlin console, that is all in the same transaction and so it will be seen.

Try adding a g.tx().commit() to your python code and see what happens.

Kevin

Real Life Adventure

unread,
May 21, 2020, 11:54:20 AM5/21/20
to janusgra...@googlegroups.com
Hi  Kevin,
     i tried transaction commit also. but it is throwing error as GraphTraversalSource object has no attribute 'tx'.
i have used g.tx().commit().

Thanks,
RLA.

Reply all
Reply to author
Forward
0 new messages