I am wondering if there is an implementation of Blueprint's IndexableGraphHelper or equivalent work-around in Titan. During ETL, I want to ensure that I do not create duplicate vertices and my edges have are properly connected. So, I attempt to see if a vertex with the same key/value exists before creating as follows:
Iterable<Vertex> sampleVertices =graph.getVertices("MyKey", MyKevValue);
if (!sampleVertices.iterator().hasNext())
{
//create a new vertex here
}
else
{
for(Vertex v:sampleVertices)
{
sampleVertex=v;
//System.out.println("sampleVertexID: " + sampleVertex.getId().toString());
break;
}
}
I am a Titan novice and have not used Java in several years. Any help would be greatly appreciated.