private void addEdge(String source, String target) {
addEdge(source, target, 1);
}
private void addEdge(String source, String target, float weight) {
NodeDraft sourceNode;
if (!container.nodeExists(source)) {
sourceNode = container.factory().newNodeDraft();
sourceNode.setId(source);
container.addNode(sourceNode);
} else {
sourceNode = container.getNode(source);
}
NodeDraft targetNode;
if (!container.nodeExists(target)) {
targetNode = container.factory().newNodeDraft();
targetNode.setId(target);
container.addNode(targetNode);
} else {
targetNode = container.getNode(target);
}
EdgeDraft edge = container.getEdge(sourceNode, targetNode);