thinkaurelius / titan

Distributed Graph Database
http://titandb.io
Apache License 2.0
5.24k stars 1.01k forks source link

Method hasLabel not working #1003

Closed jordi-chacon closed 9 years ago

jordi-chacon commented 9 years ago

Hi,

I am using 0.9.0-M1 and running Titan Console against a local BerkeleyDB instance.

I have a bunch of nodes in my graph:

gremlin> g.V()
==>v[256]
==>v[512]
==>v[768]
==>v[1024]
==>v[1280]
==>v[2560256]
==>v[2560512]
==>v[2560768]
==>v[2561024]
==>v[2561280]

I would like to get the list of all vertices with label 'user':

gremlin> g.V().hasLabel('user')
No signature of method: com.thinkaurelius.titan.graphdb.tinkerpop.optimize.TitanGraphTraversal.hasLabel() is applicable for argument types: (java.lang.String) values: [user]
Display stack trace? [yN] y
groovy.lang.MissingMethodException: No signature of method: com.thinkaurelius.titan.graphdb.tinkerpop.optimize.TitanGraphTraversal.hasLabel() is applicable for argument types: (java.lang.String) values: [user]
        at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:56)
        at org.codehaus.groovy.runtime.callsite.PojoMetaClassSite.call(PojoMetaClassSite.java:46)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
        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:68)
        at org.codehaus.groovy.tools.shell.Groovysh.execute(Groovysh.groovy:159)
        at org.codehaus.groovy.tools.shell.Shell.leftShift(Shell.groovy:121)
        at org.codehaus.groovy.tools.shell.ShellRunner.work(ShellRunner.groovy:93)
        at org.codehaus.groovy.tools.shell.InteractiveShellRunner.super$2$work(InteractiveShellRunner.groovy)
        at sun.reflect.GeneratedMethodAccessor30.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:483)
        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:57)
        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:483)
        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:83)
        at org.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:215)
        at com.tinkerpop.gremlin.console.Console.<init>(Console.groovy:99)
        at java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:636)
        at org.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:215)
        at com.tinkerpop.gremlin.console.Console.main(Console.groovy:252)

According to the TinkerPop3 documentation, this should work and there are actually many examples with exactly that statement. Why am I getting this exception?

Thanks a lot!

mbroecheler commented 9 years ago

That's because TinkerPop is evolving rapidly and Titan will always be a bit behind until TP3 GA comes out. We are currently working on getting Titan up to speed with TP3 M8 which will resolve this.

zifnab87 commented 9 years ago

Hi! Is there a timeline for that? Thanks

spmallette commented 9 years ago

@zifnab87 Titan 1.0 is already released:

https://github.com/thinkaurelius/titan/wiki/Downloads#titan-100

zifnab87 commented 9 years ago

@spmallette Thanks! I meant the hasLabel(). I don't see it in the currently provided TinkerPop API..

spmallette commented 9 years ago

it's there - see the first code example here:

http://tinkerpop.incubator.apache.org/docs/3.0.1-incubating/#has-step