Skip to content

Instantly share code, notes, and snippets.

@okram
Created May 8, 2014 22:22
Show Gist options
  • Save okram/82ea8aa9dbe8700adfed to your computer and use it in GitHub Desktop.
Save okram/82ea8aa9dbe8700adfed to your computer and use it in GitHub Desktop.
public void mergeResults(final Graph original, final Graph computed, final Map<String, String> keyMapping) {
computed.V().forEach(v1 -> {
Vertex v2 = original.v(v1.getId());
keyMapping.forEach((k, v) -> {
if (v1.getProperty(k).isPresent()) {
v2.setProperty(v, v1.getProperty(k).get());
}
});
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment