Trying to run the basic example from tinkerpop3 documentation in console

2,569 views
Skip to first unread message

choosy

unread,
Sep 14, 2015, 7:13:42 AM9/14/15
to Gremlin-users
Hi,


And I am trying to copy-paste the lines of e a simple example that I found in the documentation: http://tinkerpop.incubator.apache.org/docs/3.0.0-incubating/#gremlin-console

And I am getting this error:
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
$ bin/gremlin.sh

         \,,,/
         (o o)
-----oOOo-(3)-oOOo-----
plugin activated: tinkerpop.server
plugin activated: tinkerpop.utilities
plugin activated: tinkerpop.tinkergraph
gremlin> Graph graph = TinkerGraph.open();
==>tinkergraph[vertices:0 edges:0]
gremlin> Vertex marko = graph.addVertex(T.label, "person", T.id, 1, "name", "marko", "age", 29);
No such property: graph for class: groovysh_evaluate
Display stack trace? [yN] y
groovy.lang.MissingPropertyException: No such property: graph for class: groovysh_evaluate
        at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:51)
        at org.codehaus.groovy.runtime.callsite.PogoGetPropertySite.getProperty(PogoGetPropertySite.java:49)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGroovyObjectGetProperty(AbstractCallSite.java:304)
        at groovysh_evaluate.run(groovysh_evaluate:3)
        at org.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:215)
        at org.codehaus.groovy.tools.shell.Interpreter.evaluate(Interpreter.groovy:69)
        at org.codehaus.groovy.tools.shell.Groovysh.execute(Groovysh.groovy:185)
        at org.codehaus.groovy.tools.shell.Shell.leftShift(Shell.groovy:119)
        at org.codehaus.groovy.tools.shell.ShellRunner.work(ShellRunner.groovy:94)
        at org.codehaus.groovy.tools.shell.InteractiveShellRunner.super$2$work(InteractiveShellRunner.groovy)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
        at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:324)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1207)
        at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:130)
        at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuper0(ScriptBytecodeAdapter.java:150)
        at org.codehaus.groovy.tools.shell.InteractiveShellRunner.work(InteractiveShellRunner.groovy:123)
        at org.codehaus.groovy.tools.shell.ShellRunner.run(ShellRunner.groovy:58)
        at org.codehaus.groovy.tools.shell.InteractiveShellRunner.super$2$run(InteractiveShellRunner.groovy)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
        at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:324)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1207)
        at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:130)
        at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuper0(ScriptBytecodeAdapter.java:150)
        at org.codehaus.groovy.tools.shell.InteractiveShellRunner.run(InteractiveShellRunner.groovy:82)
        at org.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:215)
        at org.apache.tinkerpop.gremlin.console.Console.<init>(Console.groovy:134)
        at org.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:215)
        at org.apache.tinkerpop.gremlin.console.Console.main(Console.groovy:292)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Do you guys have any idea what am I missing?


Thanks,
choosy

Jason Plurad

unread,
Sep 14, 2015, 8:24:56 AM9/14/15
to Gremlin-users
2 things:

1. Use the 3.0.0-incubating zip instead of the 3.0.0.M9-incubating.zip. 3.0.0 is the GA release, while M9 was the last milestone before GA.

2. When working in the Gremlin Console, you should not include the type, i.e.

gremlin> graph = TinkerGraph.open();

==>tinkergraph[vertices:0 edges:0]

gremlin
> marko = graph.addVertex(T.label, "person", T.id, 1, "name", "marko", "age", 29);
==>v[1]

As you go through the examples in the documentation, look for the Java or Groovy indicator in the top-right corner. If it says Java, it is meant to be executed as part of a program. If it says Groovy, you can either run it as a program or within the Gremlin Console (also look for the gremlin> prompt).

Marko Rodriguez

unread,
Sep 14, 2015, 11:36:00 AM9/14/15
to gremli...@googlegroups.com
Hello,

Those lines you are copy pasting are Java, not Groovy. If you mouse over the code block in the docs, it tells you which language the example is in. For one, in the Gremlin-Console you don't type your variables. Thus, "Graph graph = " should be "graph =".

Good luck,
Marko.
--
You received this message because you are subscribed to the Google Groups "Gremlin-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/14c3df1d-030e-468d-9285-f926a4df5345%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

choosy

unread,
Sep 15, 2015, 3:57:59 AM9/15/15
to Gremlin-users
Thank you Marko!
Reply all
Reply to author
Forward
0 new messages