SteelBridgeLabs / neo4j-gremlin-bolt

Apache License 2.0
0 stars 1 forks source link

Unable to load json dataset #91

Closed MartinBrugnara closed 4 years ago

MartinBrugnara commented 4 years ago

Hi all,

I am trying to load a dataset with the standard gremlin API but I got strange errors. Could you please point me in the right direction to debug this?

The dataset is the classic 'tinkerpop-modern.json', and it is encoded correctly as works correctly with other dbs.

(code cleaned up)

// Connect to neo4j
Driver driver = GraphDatabase.driver("bolt://localhost", AuthTokens.basic("neo4j", "neo4j"));
Neo4JElementIdProvider<?> vertexIdProvider = new DatabaseSequenceElementIdProvider(driver);
Neo4JElementIdProvider<?> edgeIdProvider = new DatabaseSequenceElementIdProvider(driver);
Graph g = new Neo4JGraph(driver, "db", vertexIdProvider, edgeIdProvider)) 

// Load the data
GraphSONReader.build().create().readGraph(new FileInputStream(new File(ds.path)), g);

Exception

Feb 05, 2020 5:46:32 PM org.neo4j.driver.internal.logging.JULogger info
INFO: Direct driver instance 1412925683 created for server address localhost:7687
Exception in thread "main" java.lang.IllegalArgumentException: Property value [1] is of type class java.lang.Integer is not supported
        at org.apache.tinkerpop.gremlin.structure.Property$Exceptions.dataTypeOfPropertyValueNotSupported(Property.java:163)
        at org.apache.tinkerpop.gremlin.structure.Property$Exceptions.dataTypeOfPropertyValueNotSupported(Property.java:159)
        at com.steelbridgelabs.oss.neo4j.structure.Neo4JBoltSupport.checkPropertyValue(Neo4JBoltSupport.java:39)
        at com.steelbridgelabs.oss.neo4j.structure.Neo4JVertex.property(Neo4JVertex.java:731)
        at org.apache.tinkerpop.gremlin.structure.util.Attachable$Method.lambda$createVertex$12(Attachable.java:297)
        at java.base/java.util.Iterator.forEachRemaining(Iterator.java:133)
        at org.apache.tinkerpop.gremlin.structure.util.Attachable$Method.createVertex(Attachable.java:294)
        at org.apache.tinkerpop.gremlin.structure.util.Attachable$Method.lambda$create$10(Attachable.java:150)
        at org.apache.tinkerpop.gremlin.structure.util.Attachable.attach(Attachable.java:64)
        at org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONReader.lambda$readGraph$1(GraphSONReader.java:107)
        at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
        at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
        at java.base/java.util.Iterator.forEachRemaining(Iterator.java:133)
        at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
        at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
        at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
        at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
        at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
        at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
        at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:497)
        at org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONReader.readGraph(GraphSONReader.java:105)
        at com.graphbenchmark.queries.mgm.Load.query(Load.java:26)
        at com.graphbenchmark.queries.mgm.Load.query(Load.java:15)
        at com.graphbenchmark.common.GenericQuery.execute(GenericQuery.java:21)
        at com.graphbenchmark.common.GenericShell.exec_one_shot(GenericShell.java:113)
        at com.graphbenchmark.common.GenericShell.exec(GenericShell.java:99)
        at com.graphbenchmark.common.GenericShell.main(GenericShell.java:224)

Thanks, M

rjbaucells commented 4 years ago

It looks like the Tinkerpop readGraph() implementation is not looking at the Graph instance features (see). Neo4J does not support Integer values, only Long. The exception message Property value [1] is of type class java.lang.Integer is not supported is telling you the problem.

MartinBrugnara commented 4 years ago

Thank you for the quick response.