Closed mselite closed 3 years ago
Morning,
To connect to an existing graph you need to provide the existing graph's vertex and node information. The ConfigurationBuilder has methods for this: withVertexCollection, withEdgeCollection, etc. Since you are using an existing graph, you also need to call shouldPrefixCollectionNamesWithGraphName with a false as argument.
I think it will be easier to create a configuration file and use ArangoDBGraph.open(confFile). The github wiki has a page about the configuration file format.
Cheers,
On Mon, 26 Apr 2021, 08:42 mselite, @.***> wrote:
Hello, I am trying to connect with the tinkerpop to my Graph DB already created in ArangoDB, but i got some error: at org.apache.tinkerpop.gremlin.structure.util.GraphFactory.open(GraphFactory.java:82) at org.apache.tinkerpop.gremlin.structure.util.GraphFactory.open(GraphFactory.java:70) at TinkerpopArangoDB.main(TinkerpopArangoDB.java:141) Caused by: java.lang.reflect.InvocationTargetException at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at org.apache.tinkerpop.gremlin.structure.util.GraphFactory.open(GraphFactory.java:78) ... 2 more Caused by: com.arangodb.tinkerpop.gremlin.client.ArangoDBGraphException: Not all declared vertex names appear in the graph. Missing [gremlin_vertex] at com.arangodb.tinkerpop.gremlin.utils.ArangoDBUtil.checkGraphVertexCollections(ArangoDBUtil.java:339) at com.arangodb.tinkerpop.gremlin.utils.ArangoDBUtil.checkGraphForErrors(ArangoDBUtil.java:292) at com.arangodb.tinkerpop.gremlin.structure.ArangoDBGraph.
(ArangoDBGraph.java:600) at com.arangodb.tinkerpop.gremlin.structure.ArangoDBGraph.open(ArangoDBGraph.java:543) ... 7 more Here is the code I am using: ArangoDBConfigurationBuilder builder = new ArangoDBConfigurationBuilder(); builder.arangoHosts("127.0.0.1:8529") .arangoUser("root") .arangoPassword("xxxxxx") .dataBase("tinkerpop") .graph("gremlin"); BaseConfiguration conf = builder.build(); Graph graph = GraphFactory.open(conf); GraphTraversalSource gts = new GraphTraversalSource(graph); System.out.println("Database created: " + graph.toString());
Can some help me fix the problem. Thanks.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ArangoDB-Community/arangodb-tinkerpop-provider/issues/73, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAQOU3OBRAQKJJVQMTIH6XDTKUKMPANCNFSM43SJW57A .
Morning,
Thanks for your reply. I try your suggestion but I still got an error, should I declare twice the vertexCollection.
In my DB i have just two collection VertexCollection called: "vertex" and EdgeCollection called: edges.
Exception in thread "main" java.lang.RuntimeException: GraphFactory could not instantiate this Graph implementation [class com.arangodb.tinkerpop.gremlin.structure.ArangoDBGraph] at org.apache.tinkerpop.gremlin.structure.util.GraphFactory.open(GraphFactory.java:82) at org.apache.tinkerpop.gremlin.structure.util.GraphFactory.open(GraphFactory.java:70) at TinkerpopArangoDB.main(TinkerpopArangoDB.java:138) Caused by: java.lang.reflect.InvocationTargetException at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at org.apache.tinkerpop.gremlin.structure.util.GraphFactory.open(GraphFactory.java:78) ... 2 more Caused by: com.arangodb.tinkerpop.gremlin.client.ArangoDBGraphException: Not all declared vertex names appear in the graph. Missing [gremlin_vertex] at com.arangodb.tinkerpop.gremlin.utils.ArangoDBUtil.checkGraphVertexCollections(ArangoDBUtil.java:339) at com.arangodb.tinkerpop.gremlin.utils.ArangoDBUtil.checkGraphForErrors(ArangoDBUtil.java:292) at com.arangodb.tinkerpop.gremlin.structure.ArangoDBGraph.<init>(ArangoDBGraph.java:600) at com.arangodb.tinkerpop.gremlin.structure.ArangoDBGraph.open(ArangoDBGraph.java:543)
ArangoDBConfigurationBuilder builder = new ArangoDBConfigurationBuilder();
builder.arangoHosts("127.0.0.1:8529")
.arangoUser("root")
.arangoPassword("changeit")
.dataBase("tinkerpop");
builder.graph("gremlin")
.withVertexCollection("vertex")
.withEdgeCollection("edges")
.configureEdge("edges", "vertex", "vertex")
.shouldPrefixCollectionNamesWithGraphName(false);
And also i didn't the config file, if you can provide me the direct link, it help me. Thanks!
Hmm,
Can you please raise a bug for me? That should have worked.
Can you try with the config file?
https://github.com/ArangoDB-Community/arangodb-tinkerpop-provider/wiki/Configuration
On Mon, 26 Apr 2021, 09:35 mselite, @.***> wrote:
Morning,
Thanks for your reply. I try your suggestion but I still got an error, should I declare twice the vertexCollection. In my DB i have just two collection VertexCollection called: "vertex" and EdgeCollection called: edges. Exception in thread "main" java.lang.RuntimeException: GraphFactory could not instantiate this Graph implementation [class com.arangodb.tinkerpop.gremlin.structure.ArangoDBGraph] at org.apache.tinkerpop.gremlin.structure.util.GraphFactory.open(GraphFactory.java:82) at org.apache.tinkerpop.gremlin.structure.util.GraphFactory.open(GraphFactory.java:70) at TinkerpopArangoDB.main(TinkerpopArangoDB.java:138) Caused by: java.lang.reflect.InvocationTargetException at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at org.apache.tinkerpop.gremlin.structure.util.GraphFactory.open(GraphFactory.java:78) ... 2 more Caused by: com.arangodb.tinkerpop.gremlin.client.ArangoDBGraphException: Not all declared vertex names appear in the graph. Missing [gremlin_vertex] at com.arangodb.tinkerpop.gremlin.utils.ArangoDBUtil.checkGraphVertexCollections(ArangoDBUtil.java:339) at com.arangodb.tinkerpop.gremlin.utils.ArangoDBUtil.checkGraphForErrors(ArangoDBUtil.java:292) at com.arangodb.tinkerpop.gremlin.structure.ArangoDBGraph.
(ArangoDBGraph.java:600) at com.arangodb.tinkerpop.gremlin.structure.ArangoDBGraph.open(ArangoDBGraph.java:543) ArangoDBConfigurationBuilder builder = new ArangoDBConfigurationBuilder(); builder.arangoHosts("127.0.0.1:8529") .arangoUser("root") .arangoPassword("changeit") .dataBase("tinkerpop"); builder.graph("gremlin") .withVertexCollection("vertex") .withEdgeCollection("edges") .configureEdge("edges", "vertex", "vertex") .shouldPrefixCollectionNamesWithGraphName(false);
And also i didn't the config file, if you can provide me the direct link, it help me. Thanks!
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ArangoDB-Community/arangodb-tinkerpop-provider/issues/73#issuecomment-826630641, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAQOU3JIS5OJ2VFWX563WX3TKUQU3ANCNFSM43SJW57A .
I just tried it, but I got errors :
Exception
in thread "main" java.lang.NullPointerException
at com.arangodb.tinkerpop.gremlin.client.ArangoDBGraphClient.getGraphVariables(ArangoDBGraphClient.java:494)
at com.arangodb.tinkerpop.gremlin.structure.ArangoDBGraph.TinkerpopArangoDB.main(TinkerpopArangoDB.java:147)
Here is the code:
public static void main(String[] args) {
try {
Configuration config = new PropertiesConfiguration("config.properties");
ArangoDBGraph g = ArangoDBGraph.open(config);
System.out.println("Database created: " + g.toString());
}
catch (final ConfigurationException e) {
e.printStackTrace();
}
}
Here is config.properties file:
gremlin.graph = com.arangodb.tinkerpop.gremlin.structure.ArangoDBGraph
gremlin.arangodb.conf.graph.shouldPrefixCollectionNames = false
gremlin.arangodb.conf.graph.db = tinkerpop
gremlin.arangodb.conf.graph.name = gremlin
gremlin.arangodb.conf.graph.vertex = vertex
gremlin.arangodb.conf.graph.edge = edges
gremlin.arangodb.conf.graph.relation = edges:vertex->vertex
gremlin.arangodb.conf.arangodb.hosts = 127.0.0.1:8529
gremlin.arangodb.conf.arangodb.user = root
gremlin.arangodb.conf.arangodb.password = xxxx
Hi,
That bug should be fixed in version 2.0.3. Can you confirm the version you are using? If you are using 2.0.3, can you raise a bug so I wake sure the bug fix was deployed?
On Mon, 26 Apr 2021, 11:14 mselite, @.***> wrote:
I just tried it, but I got errors :
Exception in thread "main" java.lang.NullPointerException at com.arangodb.tinkerpop.gremlin.client.ArangoDBGraphClient.getGraphVariables(ArangoDBGraphClient.java:494) at com.arangodb.tinkerpop.gremlin.structure.ArangoDBGraph.(ArangoDBGraph.java:601) at com.arangodb.tinkerpop.gremlin.structure.ArangoDBGraph.open(ArangoDBGraph.java:543) at TinkerpopArangoDB.main(TinkerpopArangoDB.java:147)
Here is the code:
public static void main(String[] args) { try { Configuration config = new PropertiesConfiguration("config.properties"); ArangoDBGraph g = ArangoDBGraph.open(config); System.out.println("Database created: " + g.toString()); } catch (final ConfigurationException e) { e.printStackTrace(); }
}
Here is config.properties file:
gremlin.graph = com.arangodb.tinkerpop.gremlin.structure.ArangoDBGraph gremlin.arangodb.conf.graph.shouldPrefixCollectionNames = false gremlin.arangodb.conf.graph.db = tinkerpopgremlin.arangodb.conf.graph.name = gremlin gremlin.arangodb.conf.graph.vertex = vertex gremlin.arangodb.conf.graph.edge = edges gremlin.arangodb.conf.graph.relation = edges:vertex->vertex gremlin.arangodb.conf.arangodb.hosts = 127.0.0.1:8529 gremlin.arangodb.conf.arangodb.user = root gremlin.arangodb.conf.arangodb.password = xxxx
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ArangoDB-Community/arangodb-tinkerpop-provider/issues/73#issuecomment-826707925, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAQOU3OK4DHMG3GUSUNFQMTTKU4I5ANCNFSM43SJW57A .
Yes that's right, I was using version 2.0.2, now I switched to version 2.0.3 and it's fine, thanks :)
However, why the collection "TINKERPOP-GRAPH-VARIABLES" is created automatically?
Also I try to do simple query like: g.V().has('name','marko').next(); but I can't do it, I get this error :
Response:
404, Error: 1203 - AQL: collection or view not found: name: gremlin_ELEMENT-HAS-PROPERTIES (while parsing)`
Hi,
Tinkerpop needs/uses some additional graph metadata and having a separate collection for it was the approach that worked with Arango.
Would need to look into the error. Can you give details of your test graph so I can reproduce it? It will also help a lot if you open a bug to track the issue.
On Mon, 26 Apr 2021, 11:55 mselite, @.***> wrote:
Yes that's right, I was using version 2.0.2, now I switched to version 2.0.3 and it's fine, thanks :)
However, why the collection "TINKERPOP-GRAPH-VARIABLES" is created automatically?
Also I try to do simple query like: g.V().has('name','marko').next(); but I can't do it, I get this error :
Response: 404, Error: 1203 - AQL: collection or view not found: name: gremlin_ELEMENT-HAS-PROPERTIES (while parsing)`
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ArangoDB-Community/arangodb-tinkerpop-provider/issues/73#issuecomment-826736599, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAQOU3P73RDAHRLNZD42KPTTKVBCDANCNFSM43SJW57A .
Hi,
I am using the sample data of gremlin: https://filebin.net/9xompz6lgzjhkcq3
Morning,
Here is full output of the error :
`Exception in thread "main" com.arangodb.tinkerpop.gremlin.client.ArangoDBGraphException: General ArangoDB error (unkown error code) at com.arangodb.tinkerpop.gremlin.client.ArangoDBGraphClient$ArangoDBExceptions.getArangoDBException(ArangoDBGraphClient.java:109) at com.arangodb.tinkerpop.gremlin.client.ArangoDBGraphClient.executeAqlQuery(ArangoDBGraphClient.java:928) at com.arangodb.tinkerpop.gremlin.client.ArangoDBGraphClient.getElementProperties(ArangoDBGraphClient.java:669) at com.arangodb.tinkerpop.gremlin.structure.ArangoDBVertex.properties(ArangoDBVertex.java:253) at org.apache.tinkerpop.gremlin.process.traversal.step.util.HasContainer.test(HasContainer.java:92) at org.apache.tinkerpop.gremlin.process.traversal.step.util.HasContainer.testAll(HasContainer.java:180) at org.apache.tinkerpop.gremlin.process.traversal.step.filter.HasStep.filter(HasStep.java:50) at org.apache.tinkerpop.gremlin.process.traversal.step.filter.FilterStep.processNextStart(FilterStep.java:38) at org.apache.tinkerpop.gremlin.process.traversal.step.util.AbstractStep.next(AbstractStep.java:128) at org.apache.tinkerpop.gremlin.process.traversal.step.util.AbstractStep.next(AbstractStep.java:38) at org.apache.tinkerpop.gremlin.process.traversal.util.DefaultTraversal.next(DefaultTraversal.java:201) at TinkerpopArangoDB.main(TinkerpopArangoDB.java:157)
Caused by: com.arangodb.ArangoDBException: Response: 404, Error: 1203 - AQL: collection or view not found: name: gremlin_ELEMENT-HAS-PROPERTIES (while parsing) at com.arangodb.internal.util.ResponseUtils.checkError(ResponseUtils.java:52) at com.arangodb.internal.velocystream.VstCommunication.checkError(VstCommunication.java:155) at com.arangodb.internal.velocystream.VstCommunicationSync.execute(VstCommunicationSync.java:126) at com.arangodb.internal.velocystream.VstCommunicationSync.execute(VstCommunicationSync.java:40) at com.arangodb.internal.velocystream.VstCommunication.execute(VstCommunication.java:138) at com.arangodb.internal.velocystream.VstProtocol.execute(VstProtocol.java:46) at com.arangodb.internal.ArangoExecutorSync.execute(ArangoExecutorSync.java:71) at com.arangodb.internal.ArangoExecutorSync.execute(ArangoExecutorSync.java:57) at com.arangodb.internal.ArangoDatabaseImpl.query(ArangoDatabaseImpl.java:171) at com.arangodb.tinkerpop.gremlin.client.ArangoDBGraphClient.executeAqlQuery(ArangoDBGraphClient.java:925) `
Hope it will help !
Hi, I debug the issue. It seems that the current implementation does not cope correctly with existing graphs. The gremlin_ELEMENT-HAS-PROPERTIES, similar to the TINKERPOP-GRAPH-VARIABLES, is a collection that exists to deal with some of the implementation details of the driver. At the time of development the design was based on the wrong premise that graphs would always be created via the tinkerpop API.
Feature #38 deals with this issue and revamps the driver architecture. Till that is completed, graphs would need to be populated via the Tinkerpop API. Sorry.
Hello, I am trying to connect with the tinkerpop to my Graph DB already created in ArangoDB, but i got some error:
at org.apache.tinkerpop.gremlin.structure.util.GraphFactory.open(GraphFactory.java:82) at org.apache.tinkerpop.gremlin.structure.util.GraphFactory.open(GraphFactory.java:70) at TinkerpopArangoDB.main(TinkerpopArangoDB.java:141) Caused by: java.lang.reflect.InvocationTargetException at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at org.apache.tinkerpop.gremlin.structure.util.GraphFactory.open(GraphFactory.java:78) ... 2 more Caused by: com.arangodb.tinkerpop.gremlin.client.ArangoDBGraphException: Not all declared vertex names appear in the graph. Missing [gremlin_vertex] at com.arangodb.tinkerpop.gremlin.utils.ArangoDBUtil.checkGraphVertexCollections(ArangoDBUtil.java:339) at com.arangodb.tinkerpop.gremlin.utils.ArangoDBUtil.checkGraphForErrors(ArangoDBUtil.java:292) at com.arangodb.tinkerpop.gremlin.structure.ArangoDBGraph.<init>(ArangoDBGraph.java:600) at com.arangodb.tinkerpop.gremlin.structure.ArangoDBGraph.open(ArangoDBGraph.java:543) ... 7 more
Here is the code I am using:
Can some help me fix the problem. Thanks.