Re: [TinkerPop] the provided graph has no 'edges' index error

71 views
Skip to first unread message

Peter Neubauer

unread,
Dec 16, 2011, 6:42:44 AM12/16/11
to gremli...@googlegroups.com
Ales,
is this an existing Neo4j gaph? If you want to let Blueprints to
assume the graph is fresh (which means it will try to create the
default indexes), construct the graph with

new Neo4jGraph(neo, true).

Otherwise, if existing indexes are found, Blueprints will leave the
graph alone. The init sequence could be smarter, agreed.

Cheers,

/peter neubauer

TC CEO of the year - vote for Emil Eifrém!
http://crunchies2011.techcrunch.com/nominate/

Google:neubauer.peter
Skype:peter.neubauer
Phone: +46 704 106975
LinkedIn   http://www.linkedin.com/in/neubauer
Twitter      @peterneubauer

brew install neo4j && neo4j start
heroku addons:add neo4j

On Fri, Dec 16, 2011 at 12:03 PM, Alexandre Blanquart
<alex.bl...@gmail.com> wrote:
> Hi,
>
> I downloaded and installed gremlin-1.4.
> In the gremlin-groovy console, I tried to get a SailGraph on top of
> Neo4jGraph as follows;
>
> gremlin> neo = new Neo4jGraph("/Users/alex/Desktop")
> ==>neo4jgraph[EmbeddedGraphDatabase [/Users/alex/Desktop]]
> gremlin>
> gremlin>
> gremlin> sailGraph = new SailGraph(new GraphSail(neo))
> SLF4J: Class path contains multiple SLF4J bindings.
> SLF4J: Found binding in
> [jar:file:/Users/alex/Documents/autocat/gremlin/gremlin-1.4/gremlin-groovy/target/gremlin-groovy-1.5-SNAPSHOT-standalone/lib/gossip-1.2.jar!/org/slf4j/impl/StaticLoggerBinder.class]
> SLF4J: Found binding in
> [jar:file:/Users/alex/Documents/autocat/gremlin/gremlin-1.4/gremlin-groovy/target/gremlin-groovy-1.5-SNAPSHOT-standalone/lib/slf4j-log4j12-1.5.6.jar!/org/slf4j/impl/StaticLoggerBinder.class]
> SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an
> explanation.
> the provided graph has no 'edges' index
> Display stack trace? [yN]
> gremlin>
> gremlin>
> gremlin> sailGraph = new SailGraph(new GraphSail(neo))
> the provided graph has no 'edges' index
> Display stack trace? [yN] y
> java.lang.IllegalStateException: the provided graph has no 'edges' index
> at
> com.tinkerpop.blueprints.pgm.oupls.sail.GraphSail.<init>(GraphSail.java:130)
> at
> com.tinkerpop.blueprints.pgm.oupls.sail.GraphSail.<init>(GraphSail.java:103)
> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
> at
> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
> at
> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
> at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
> at
> org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:77)
> at
> org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:102)
> at
> org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:54)
> at
> org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:182)
> at
> org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:190)
> at groovysh_evaluate.run(groovysh_evaluate:32)
> at groovysh_evaluate$run.call(Unknown Source)
> at
> org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
> at groovysh_evaluate$run.call(Unknown Source)
> at
> org.codehaus.groovy.tools.shell.Interpreter.evaluate(Interpreter.groovy:67)
> at org.codehaus.groovy.tools.shell.Interpreter$evaluate.call(Unknown Source)
> at org.codehaus.groovy.tools.shell.Groovysh.execute(Groovysh.groovy:152)
> at org.codehaus.groovy.tools.shell.Shell.leftShift(Shell.groovy:114)
> at org.codehaus.groovy.tools.shell.Shell$leftShift$0.call(Unknown Source)
> at org.codehaus.groovy.tools.shell.ShellRunner.work(ShellRunner.groovy:88)
> 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:39)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
> at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
> at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1054)
> at
> org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:128)
> at
> org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuper0(ScriptBytecodeAdapter.java:148)
> at
> org.codehaus.groovy.tools.shell.InteractiveShellRunner.work(InteractiveShellRunner.groovy:100)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at
> org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:267)
> at
> org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:52)
> at
> org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:137)
> 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:39)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
> at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
> at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1054)
> at
> org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:128)
> at
> org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuper0(ScriptBytecodeAdapter.java:148)
> at
> org.codehaus.groovy.tools.shell.InteractiveShellRunner.run(InteractiveShellRunner.groovy:66)
> at com.tinkerpop.gremlin.groovy.console.Console.<init>(Console.java:50)
> at com.tinkerpop.gremlin.groovy.console.Console.<init>(Console.java:57)
> at com.tinkerpop.gremlin.groovy.console.Console.main(Console.java:62)
> gremlin>
>
> In previous version gremlin-1.3 it works. Has the API changed?
>
> Best,
> Alex
>

Pierre De Wilde

unread,
Dec 16, 2011, 7:19:41 AM12/16/11
to gremli...@googlegroups.com
Hi Alex,

It works correctly if you store Neo4j graph in a subdirectory of Desktop:

gremlin> neo = new Neo4jGraph("/Users/Pierre/Desktop/neo4jgraph")  
==>neo4jgraph[EmbeddedGraphDatabase [/Users/Pierre/Desktop/neo4jgraph]]
gremlin> neo.indices
==>AUTOMATIC[edges:Edge][autoIndexKeys:null]
==>AUTOMATIC[vertices:Vertex][autoIndexKeys:null]
gremlin> sailGraph = new SailGraph(new GraphSail(neo))
==>sailgraph[graphsail]

Indeed, there is a strange behavior when storing Neo4j graph directly on Desktop -- automatic indices are NOT created:

gremlin> neo = new Neo4jGraph("/Users/Pierre/Desktop")
==>neo4jgraph[EmbeddedGraphDatabase [/Users/Pierre/Desktop]]
gremlin> neo.indices
gremlin>

As Peter suggests, if you still want to store Neo4j graph directly on the Desktop, a possible workaround is using the fresh parameter of Neo4jGraph():

Please note that the first parameter must be the native Neo4j (raw) graph, not the Blueprints Neo4j graph:

gremlin> neo = new Neo4jGraph(neo, true)
Could not find matching constructor for: com.tinkerpop.blueprints.pgm.impls.neo4j.Neo4jGraph(com.tinkerpop.blueprints.pgm.impls.neo4j.Neo4jGraph, java.lang.Boolean)
Display stack trace? [yN] 

gremlin> neo = new Neo4jGraph(neo.rawGraph, true)
==>neo4jgraph[EmbeddedGraphDatabase [/Users/Pierre/Desktop]]
gremlin> neo.indices
==>AUTOMATIC[edges:Edge][autoIndexKeys:null]
==>AUTOMATIC[vertices:Vertex][autoIndexKeys:null]
gremlin> sailGraph = new SailGraph(new GraphSail(neo))
==>sailgraph[graphsail]

I don't know why indices are not created when storing Neo4j graph on Desktop...

Peter? Marko?

Thanks,
Pierre

Alexandre Blanquart

unread,
Dec 16, 2011, 8:55:54 AM12/16/11
to gremli...@googlegroups.com
Hi,

Thanks both for the information. 
Indeed, Neo4jGraph constructors have changed a lot in the last release. 

Best,
Alex

Reply all
Reply to author
Forward
0 new messages