Hello Praveen,

if you know the key attributes of the vertices you can build the document 
handle by "collectionName" + "/" + "documentKey".
Example:

arangoDriver.startBatchMode();

for(String line : lines)
{
  String[] data = line.split(",");
           
  BaseDocument device = new BaseDocument();
  BaseDocument phyAddress = new BaseDocument(); 
  BaseDocument conn = new BaseDocument();

  String keyDevice = data[0];
  String handleDevice = "DeviceId/" + keyDevice; 
           
  device.setDocumentKey(keyDevice);
  device.addAttribute("device_id",data[0]);

  String keyPhyAddress = data[1];
  String handlePhyAddress = "PhysicalLocation/" + keyPhyAddress; 

  phyAddress.setDocumentKey(keyPhyAddress);
  phyAddress.addAttribute("address",data[1]);

  final DocumentEntity<BaseDocument> from = 
arangoDriver.graphCreateVertex("testGraph", "DeviceId", device, null);      
 
  final DocumentEntity<BaseDocument> to = 
arangoDriver.graphCreateVertex("testGraph", "PhysicalLocation", phyAddress, 
null);

  arangoDriver.graphCreateEdge("testGraph", "DeviceId_PhysicalLocation", 
null, handleDevice, handlePhyAddress, null, null);

}
arangoDriver.executeBatch();

-- 
You received this message because you are subscribed to the Google Groups 
"ArangoDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to