ArangoDB-Community / arangodb-tinkerpop-provider

An implementation of the Tinkerpop OLTP Provider for ArangoDB
Apache License 2.0
83 stars 16 forks source link

Documentation and general questions #36

Closed a-marcel closed 5 years ago

a-marcel commented 5 years ago

Hello,

i use your latest version and copy one line from your README

Vertex v1 = g.addV("person").property(T.id, 1).property("name", "marko")
    .property("age", 29).next();

This results for me in an error:

java.lang.UnsupportedOperationException: Vertex does not support user supplied identifiers of this type
    at org.apache.tinkerpop.gremlin.structure.Vertex$Exceptions.userSuppliedIdsOfThisTypeNotSupported(Vertex.java:167)
    at com.arangodb.tinkerpop.gremlin.structure.ArangoDBGraph.addVertex(ArangoDBGraph.java:624)
    at org.apache.tinkerpop.gremlin.process.traversal.step.map.AddVertexStartStep.processNextStart(AddVertexStartStep.java:91)
    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:200)
    at com.serverless.HandlerTest.test(HandlerTest.java:103)
    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:498)
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
    at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
    at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
    at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
    at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
    at com.microsoft.java.test.runner.junit4.JUnit4TestReference.run(JUnit4TestReference.java:50)
    at com.microsoft.java.test.runner.junit4.CustomizedJUnit4CoreRunner.run(CustomizedJUnit4CoreRunner.java:45)
    at com.microsoft.java.test.runner.junit4.JUnit4Launcher.execute(JUnit4Launcher.java:30)
    at com.microsoft.java.test.runner.Launcher.main(Launcher.java:53)

Regarding the properties, i've two questions:

Vertex v1 = g.addV("person").property("name", "marko")
    .property("age", 29).next();

This creates an entry in the collection "graph_element_properties" and i see the provided data. But inside the collection "graph_person" i just see the entry without any properties. Is this normal or can we fix this ?

In your README you query g.v().has("name","marko") and it works perfect. My question is more from the performance side. How can i set an index on this property ?

Thanks a lot Marcel

arcanefoam commented 5 years ago

Hello Marcel, I will take a look at the exception.

Regarding the second question, can you please open a separate issue for that? that way we can keep track of each issue separately.

arcanefoam commented 5 years ago

The readme is indeed misleading. Currently we only support String ids. The reason for this is detailed in bug #37, which will also add support for UUIDs. Note that this behaviour is intentional in order for the arango tinkerpop provider to comply as much as possible with the Tinkerpop API, which in turn means passing their test suite. I will update the readme.