0

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

Berkay
  • 91
  • 7
  • not sure if you're still having this problem but perhaps a fully failing example with sample data would help: https://stackoverflow.com/questions/51388315/gremlin-choose-one-item-at-random – stephen mallette Jul 06 '21 at 10:43
  • thank you @stephenmallette . i solved issue with adding edges between existing nodes again. when i add edge between existing nodes this query returns correctly. should i clear question with sample data and response to the question with that way? – Berkay Jul 07 '21 at 15:10
  • It's OK to answer your own question also if that may help others that find the question. – Kelvin Lawrence Jul 08 '21 at 13:27

0 Answers0