Gremlin shell won't work after I run remote operations

114 views
Skip to first unread message

Johnny Weng Luu

unread,
Jan 27, 2012, 9:10:59 PM1/27/12
to ne...@googlegroups.com
For some weird reason I can't run anything on Gremlin shell after I have done some remote Gremlin operations using HTTP gremlin plugin.

Eg.

In Gremlin shell:

  • gremlin> g.clear()
  • ==> 
  • gremlin> g.addVertex([name:'foo']); g.V.name
  • ==> foo

That one shows everything works.

Now in HTTP shell:

  • http> POST /db/data/ext/GremlinPlugin/graphdb/execute_script {"script": "g.clear()"}
  • ==> 200 OK
  • ==> "null"

And switch back to Gremlin shell:

  • gremlin> g.addVertex([name:'foo']); g.V.name
  • undefined

Something is clearly wrong here.

Seems like a bug.

Could someone help me out.

Johnny

Marko Rodriguez

unread,
Jan 27, 2012, 9:17:12 PM1/27/12
to ne...@googlegroups.com
Huh. Looks like the variable g got lost? ... Perhaps just do 'g' and see what it returns.

?,
Marko.

Johnny Weng Luu

unread,
Jan 27, 2012, 9:39:51 PM1/27/12
to ne...@googlegroups.com
g returns the graph:

  • ==> g
  • ==> neo4jgraph[EmbeddedGraphDatabase [/mnt/ad2a30dd7/data/graph.db]]
  • undefined

Johnny Weng Luu

unread,
Jan 27, 2012, 9:40:28 PM1/27/12
to ne...@googlegroups.com
I'm using the Neo4j heroku addon. Maybe someone could try the same thing to confirm this bug?

Johnny

Peter Neubauer

unread,
Jan 28, 2012, 3:30:52 AM1/28/12
to ne...@googlegroups.com
Johnny,
this happens in a local server installation, too. I file a bug for
now, https://github.com/neo4j/community/issues/205

Cheers,

/peter neubauer

G:  neubauer.peter
S:  peter.neubauer
P:  +46 704 106975
L:   http://www.linkedin.com/in/neubauer
T:   @peterneubauer

Neo4j 1.6 released                 - dzone.com/6S4K
The Neo4j Heroku Challenge   - http://neo4j-challenge.herokuapp.com/

Peter Neubauer

unread,
Jan 30, 2012, 2:50:12 AM1/30/12
to ne...@googlegroups.com
Just to let everyone know, this has been actually three bugs, see

https://github.com/neo4j/community/issues/208
https://github.com/tinkerpop/blueprints/issues/205
https://github.com/tinkerpop/blueprints/issues/200

That all where resulting in the behaviour seen at g.clear(). All these
are fixed now, but the blueprints issues will make it first in Neo4j
after a stable release there.

Meanwhile, try to avoid g.clear() with the current Neo4j version, and do

g.V.sideEffect{g.removeVertex(it)}

as a way to delete all content in the graph.

Cheers,

/peter neubauer

G:  neubauer.peter
S:  peter.neubauer
P:  +46 704 106975
L:   http://www.linkedin.com/in/neubauer
T:   @peterneubauer

Neo4j 1.6 released                 - dzone.com/6S4K
The Neo4j Heroku Challenge   - http://neo4j-challenge.herokuapp.com/

Johnny Weng Luu

unread,
Jan 30, 2012, 2:57:36 AM1/30/12
to ne...@googlegroups.com
Wow, cool that they all are fixed!

"g.V.sideEffect{g.removeVertex(it)}" didn't work.

Don't you mean: "g.V.sideEffect{g.removeVertex(it)}.iterate()"?



Johnny

Peter Neubauer

unread,
Jan 30, 2012, 3:02:36 AM1/30/12
to ne...@googlegroups.com
yeah,
depends on what shell you are in, REST for instance will automatically iterate.

Cheers,

/peter neubauer

G:  neubauer.peter
S:  peter.neubauer
P:  +46 704 106975
L:   http://www.linkedin.com/in/neubauer
T:   @peterneubauer

Neo4j 1.6 released                 - dzone.com/6S4K
The Neo4j Heroku Challenge   - http://neo4j-challenge.herokuapp.com/

Johnny Weng Luu

unread,
Jan 30, 2012, 3:05:34 AM1/30/12
to ne...@googlegroups.com
You mean the opposite?

Sending Gremlin queries using the REST Gremlin plugin didn't iterate, but using the Gremlin shell did iterate automatically.

Why are queries sent by REST not iterated automatically?

Johnny

Peter Neubauer

unread,
Jan 30, 2012, 3:15:17 AM1/30/12
to ne...@googlegroups.com
yes,
true. REST should be iterated, and the Gremlin shell, too. What was
the one were it didn't work?

Cheers,

/peter neubauer

G:  neubauer.peter
S:  peter.neubauer
P:  +46 704 106975
L:   http://www.linkedin.com/in/neubauer
T:   @peterneubauer

Neo4j 1.6 released                 - dzone.com/6S4K
The Neo4j Heroku Challenge   - http://neo4j-challenge.herokuapp.com/

Johnny Weng Luu

unread,
Jan 30, 2012, 3:16:58 AM1/30/12
to ne...@googlegroups.com
It didn't work when I'm sending a gremlin script through HTTP.

Johnny

Peter Neubauer

unread,
Jan 30, 2012, 3:23:13 AM1/30/12
to ne...@googlegroups.com
Ahh ok. I think that is extected.

Cheers,

/peter neubauer

G:  neubauer.peter
S:  peter.neubauer
P:  +46 704 106975
L:   http://www.linkedin.com/in/neubauer
T:   @peterneubauer

Neo4j 1.6 released                 - dzone.com/6S4K
The Neo4j Heroku Challenge   - http://neo4j-challenge.herokuapp.com/

Johnny Weng Luu

unread,
Jan 30, 2012, 3:24:26 AM1/30/12
to ne...@googlegroups.com
But why?

Johnny

DasIstAberSeltsam

unread,
Feb 12, 2013, 8:01:56 PM2/12/13
to ne...@googlegroups.com
I also find that a little confusing, that most things that one tests in the shell don't work in a script and vice versa, since the shell automatically iterates.
This confused me a lot when starting with Gremlin.

On Monday, 30 January 2012 03:24:26 UTC-5, Johnny Luu wrote:
But why?

Johnny

Michael Hunger

unread,
Feb 12, 2013, 8:39:43 PM2/12/13
to ne...@googlegroups.com
If it wouldn't iterate it wouldn't be able to show anything.

And for the plugin automatic iteration could be an option but if you 
#1 want to do other stuff
#2 want to stream

This might not be what you want?

Cheers

Michael

(neo4j.org) <-[:WORKS_ON]- (@mesirii) -[:TAKES_CARE_OF]-> (you) -[:WORKS_WITH]->(@Neo4j)




--
You received this message because you are subscribed to the Google Groups "Neo4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email to neo4j+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Martin Boissier

unread,
Feb 12, 2013, 9:10:54 PM2/12/13
to ne...@googlegroups.com
Well, I personally don't expect a REPL to iterate over each object
that I enter into the REPL. I definitely would not do it automatically
in the plugin, but rather make it explicit in the REPL.

But I am quite new to Gremlin, there might be a lot of other things to consider.

2013/2/12 Michael Hunger <michael...@neotechnology.com>:

Marko Rodriguez

unread,
Feb 12, 2013, 9:39:14 PM2/12/13
to ne...@googlegroups.com
Hi,

If you don't want it to iterate for you in the REPL, you can do this:

gremlin> g.v(1).my.traversal; null
==>null
gremlin>

HTH,
Marko.

http://markorodriguez.com
Reply all
Reply to author
Forward
0 new messages