Вызывая graphTraversal.V()
, обычно записываемый как g.V()
, вы создаете новый объект Traversal
на каждой итерации цикла. Просто создайте экземпляр Traversal
вне цикла for
и затем перейдите оттуда:
while ((currentDataLine = nodeBufferedReader.readLine()) != null)
{
//split graph data
data = currentDataLine.split(DELIMITER);
Traversal t = g.V(data[15]);
for (int i = 0; i < data.length - 1; i++)
{
if (i == 15) continue;
if (data[i].isEmpty() || data[i] == "") continue;
t = t.property(header[i], data[i]);
}
// remember to actually execute your Traversal - that doesn't happen
// until you next(), iterate(), etc.
t.iterate()
}