I am trying to write a generic update query to edit titan vertices.
GraphTraversal<Vertex,Vertex> tempNode = getVertexList(node.getKey(), g);
if(tempNode.hasNext())
{
Vertex vertex = tempNode.next();
final int length = node.getKey().getProperties().size() * 2 + 2;
Object[] keyValue = new Object[length];
int i = 0;
for(Map.Entry<String, Object> entry: node.getKey().getProperties().entrySet())
{
keyValue[i] = entry.getKey();
keyValue[i+1] = entry.getValue();
i += 2;
}
NodeStorage tempStorage = new NodeStorage(node.getValue().getId(), node.getKey().getProperties());
for(Map.Entry<String, Object> entry: node.getValue().getProperties().entrySet())
{
tempStorage.addProperty(entry.getKey(), entry.getValue());
}
vertex.property("hash", HashCreator.sha1FromNode(tempStorage), keyValue);
}
in getVertexList I simply get the vertex by a certain key I defined. I then check if the list contains anything. I then want to change the properties of it and add a hash property.
I unfortunately didn't find out how I may edit the label string of the vertice. Is there a way?