code: @Override
      public KamEdge replaceEdge(KamEdge kamEdge, FunctionEnum sourceFunction,
              String sourceLabel,
              RelationshipType relationship, FunctionEnum targetFunction,
              String targetLabel) {
  
          // replace source node
          final int sourceNodeId = kamEdge.getSourceNode().getId();
          final KamNode sourceReplacement =
                  new KamNodeImpl(this, sourceNodeId, sourceFunction, sourceLabel);
  
          // establish id to replacement node
          idNodeMap.put(sourceNodeId, sourceReplacement);
          nodeIdMap.put(sourceReplacement, sourceNodeId);
  
          //replace target node
          final int targetNodeId = kamEdge.getTargetNode().getId();
          final KamNode targetReplacement =
                  new KamNodeImpl(this, targetNodeId, targetFunction, targetLabel);
  
          // establish id to replacement node
          idNodeMap.put(targetNodeId, targetReplacement);
          nodeIdMap.put(targetReplacement, targetNodeId);
  
          final int edgeId = kamEdge.getId();
          final KamEdge replacement = new KamEdgeImpl(this, edgeId,
                  sourceReplacement, relationship, targetReplacement);
  
          // establish id to replacement edge
          idEdgeMap.put(edgeId, replacement);
          edgeIdMap.put(replacement, edgeId);
  
          // reconnect network
          Set<KamEdge> sourceOutgoing =
                  nodeSourceMap.remove(kamEdge.getSourceNode());
          sourceOutgoing.remove(kamEdge);
          sourceOutgoing.add(replacement);
          nodeSourceMap.put(sourceReplacement, sourceOutgoing);
          Set<KamEdge> targetIncoming =
                  nodeTargetMap.remove(kamEdge.getTargetNode());
          targetIncoming.remove(kamEdge);
          targetIncoming.add(replacement);
          nodeTargetMap.put(targetReplacement, targetIncoming);
  
          Set<KamEdge> sourceIncoming =
                  nodeTargetMap.remove(kamEdge.getSourceNode());
          nodeTargetMap.put(sourceReplacement, sourceIncoming);
  
          Set<KamEdge> targetOutgoing =
                  nodeSourceMap.remove(kamEdge.getTargetNode());
          nodeSourceMap.put(targetReplacement, targetOutgoing);
          return replacement;
      }
docs: {@inheritDoc}