This is an extension of a problem that I was having in the Console. I am now trying to write a Java App incorporating Gremlin graph traversals. I have added the Blazegraph-Gremlin library to my app and I am working with data from a Blazegraph database.
Here, I've written out a small demo to show my problem. Sorry for the excess of print statements, but I wanted to demonstrate in the output exactly what was happening at each step.
System.out.println("Show me first vertex you find");
System.out.println(g.V().next());
Vertex v1 = g.V().next();
System.out.println("Prove that the variable is set properly (it is)");
System.out.println(v1);
Object v1id = g.V().id().next();
System.out.println("Get the ID of the object to pass to g.V()");
System.out.println(v1id);
GraphTraversal<Vertex, Vertex> v2 = g.V(v1id);
System.out.println("Try to find the vertex given the ID");
Vertex v3 = g.V(v1id).next();
System.out.println(v3);
Output of the above code:
Show me first vertex you find
v[8080/source/sampledata1/008a46ce-d7f9-4c60-b7ca-1ccaa6ce7bbd/identifier]
Prove that the variable is set properly (it is)
v[8080/source/sampledata1/008a46ce-d7f9-4c60-b7ca-1ccaa6ce7bbd/identifier]
Get the ID of the object to pass to g.V()
8080/source/sampledata1/008a46ce-d7f9-4c60-b7ca-1ccaa6ce7bbd/identifier
ERROR 2017-03-23 16:20:44,463 1530 com.bigdata.Banner [main] Uncaught exception in thread
org.apache.tinkerpop.gremlin.process.traversal.util.FastNoSuchElementException
From the responses I received to previous posts, I was given the impression that this may be a bug in Blazegraph. With that said, I would appreciate any help/support I can get on the Gremlin side of things, since I am fairly committed to using Blazegraph at this point. If anyone has any syntax suggestions/sees something I am doing improperly/wants more details, please respond. I will be happy to provide more examples if necessary.
Thanks!