test is vertex exists with Gremlin / Gizmo

26 views
Skip to first unread message

schm...@gmail.com

unread,
Jan 24, 2018, 10:53:38 AM1/24/18
to cayley-users
Hello,
Let's say I have this .nq file:

"192.168.0.1" <type> "[address]" .
"192.168.0.1" <mac> "A" .
"192.168.0.1" <desc> "host1" .

"192.168.0.2" <type> "[address]" .
"192.168.0.2" <desc> "host2" .

"192.168.0.3" <type> "[address]" .
"192.168.0.3" <mac> "B" .
"192.168.0.3" <desc> "host3" .

"192.168.0.4" <type> "[address]" .
"192.168.0.4" <mac> "C" .
"192.168.0.4" <desc> "host4" .

If I do `g.V("192.168.0.5")` is there a way to know is the query returned something or nothing ?
I am currently using 0.6.1 because 0.7.0 does not really work for me for some reason (weird crashes/errors) and I have yet to find a solution.

I tried g.V("xxxx").ForEach() but it throws an exception if the query returned nothing, if I just try to examine the result of g.V("xxxx") it always returns a js object which is not that helpful.

I really like this project but it is really hard to work with, lack of documentation, no real way to easily debug your queries, crashes :(

Denys Smirnov

unread,
Jan 25, 2018, 12:26:38 PM1/25/18
to cayley-users
Hello,

First of all thanks for trying the project!

Note that main discussion was moved to https://discourse.cayley.io/

You can use ToArray to get a list of node as JS object, and get it's length, or use ForEach and increment a counter for each result.

It would also be helpful if you can share stack traces for crashes that you see in v0.7 - it can be fixed for the next minor release (~4 Feb). 

Hope this answers your question.

schm...@gmail.com

unread,
Jan 26, 2018, 3:27:18 AM1/26/18
to cayley-users
Hello, thanks for the answer but since calling ToArray or ForEach on an empty resultSet crash cayley 0.6.1 it looks like I am stuck...

I would love to report any clear issue with 0.7 but this is not what I experience, what I am doing is generating a .nq datafile from internal data and then start the cayley daemon in the background to query it.
In 0.6.1 this scheme works fine but with 0.7 I get EOFErrors while reading the http replies, sometimes the http requests even fails with connection refused...

I am sure the server is actually started because I am waiting for "listening on" to be printed on stdout before doing any requests.

I have not found any real alternative and I really like the project but I am not sure I can continue hitting walls like that every time I get back to it, this is really a frustrating experience :(

Denys Smirnov

unread,
Jan 26, 2018, 4:28:18 AM1/26/18
to cayley-users
Can you please share more information about your setup? I'm particularly interested in what backend are you using, what version of API, and the query that generates EOFs.

I understand that getting these kind of problems is frustrating and we are sorry that you get this impression. But we haven't received any similar bug reports for v0.7 yet, thus will highly appreciate your feedback and any information regarding an issue so we can fix it ASAP.  
Reply all
Reply to author
Forward
0 new messages