I think i made a mistake such a duplicate the vertices.
I have two query and responses are different.
from gremlin_python.process.traversal import P
d_o_c = graph.V().has("cid", "value", '123124').in_('o_f_d').values().toList()
c_o_d = graph.V().has("did", "value", P.within(d_o_c)).out('o_f_d').values().toList()
print(c_o_d)
The response of above query is:
[[1231245, 123124]]
Query of the above is not fast at all.
So I changed my query like that:
c_o_d = graph.V().has("cid", "value", '123124').in_('o_f_d').out('o_f_d').values().toList()
print(c_o_d)
The response of the query is:
[123124]
Also I want to see the path of the query:
c_o_d = graph.V().has("client_id", "value", '123124').in_('o_f_d').out('o_f_d').path().by('value').toList()
Response of the query is:
[path[123124, 34335-324434-23-4-5445, 123124]]
The other cid is not coming out with above query. Is there a another way to get the result like first query else than the drop duplicates and adding edges between vertices?
My graph is:
'cid-a' <---o_f_d---- 'did' ---o_f_d---> 'cid-b'
I need the get all 'cid' values from cid-a