-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Certain commands return nothing #49
Comments
Hey! Are you saying that both Bellow is some info I gathered up concerning the setup. Let me know if there's anything out of place:
(Edit: A failing sample php code would be great. Looks like you're using sessions so that might be something to look into) |
Didn't know about the run method! It works with it just fine. We should add that to the documentation and also mention requirement for using next() to get v extracted from a method. Like: snowboarding = g.addV("hobby").property("name","Snow Boarding").next() fails without the next(). All examples are written for gremlin console and there seems to be a lot of differences how things need to be approached. This is my first real journey to Gremlin. |
Yeah seems like there are a few things worth noting. Some of which I should definitely add to the documentation. NO CONTENT 204 return error
There is such a thing as an "No content return error". This is how it's communicated back from the server and hasn't been changed on the TinkerPop end because it is (or has been) very useful for debugging purposes. This error just means the server isn't returning any info. It's not really an error so to speak. Because the driver bubbles up server issues, any empty return value will throw a similar error on the php end ( People implementing the driver should consider doing one of two things : $db = new Connection([
// ... config here ...
]);
$db->open();
try {
$db->send("g.V().drop()");
} catch (Exception $e) {
if($e instanceof ServerException && $e->getCode() == 204) {
/**
* best practice would be to log a warning in your application as it will help with
* debugging if you have an issue with your gremlin query.
*/
return []; // return an empty set.
} else {
throw $e;
}
} The other option is ( $db = new Connection([
"emptySet" => true, // this will automatically send you an empty array in place of an error.
// ... config here ...
]); Worth noting the second case does no log a warning. So some gremlin error debugging may be obscured by this. IterationsThe way the console works is that it automatically iterates your queries. It's a comfort feature.
|
Let me know if you think of a good way of structuring the documentation to mention these points. |
Great comments. I totally agree. This has been rather confusing experience due to lack of documentation / relatively small community. Even Tinkerpop 3 docs are outdated right at the tutorial. Need to find some good cook book / reference on this. |
I just skimmed it but this looked like a good guide : http://kelvinlawrence.net/book/Gremlin-Graph-Guide.html It won't make any mentions of iterations but you can pretty much ask here or on the gremlin user list if you have any questions regarding that. If you have any questions on the driver or gremlin in general feel free to create a new issue. I'll keep this open as a reminder to edit the documentation a bit. Maybe a quick start guide might be useful. |
I discovered his book yesterday and it is indeed best Gremlin guide out there. Thanks for all the detailed the help and pointers! |
I am running into an issue with
g.V().drop()
which would drop all vertices. None of the drop queries work for some reason... Once you add iterate() this is supposed to work.
g.V().drop().iterate()
These work fine in Gremlin console but not via PHP.
Running JanusGraph 0.2.0 (w/ Cassandra & ElasticSearch) with bundled gremlin server.
From GremlinServer logs:
The text was updated successfully, but these errors were encountered: