I want to create PARENT - HAS_CHILD -> CHILD nodes in my graph database using single gremlin traversal.
Problem is that PARENT vertex, HAS_CHILD edge and CHILD vertex have different properties and should come from different Hashmaps.
I am using java api for gremlin.
I have not found any way of doing it and would appreciate help on this.
Update:::
I was able to achieve using multiple maps like this:
Map<String, String> map1 = new HashMap<String, String>(); map1.put("a", "1"); map1.put("b", "2"); map1.put("c", "3");
Map<String, String> map2 = new HashMap<String, String>(); map2.put("aa", "11"); map2.put("bb", "22"); map2.put("cc", "33");
g.withSideEffect("map1", map1).withSideEffect("map2", map2) .addV(label).as("vertex1").sideEffect(__.select("map1").unfold().as("kv").select("vertex1").property(__.select("kv").by(Column.keys),
__.select("kv").by(Column.values))) .addV(label).as("vertex2").sideEffect(__.select("map2").unfold().as("kv").select("vertex2").property(__.select("kv").by(Column.keys),__.select("kv").by(Column.values))) .iterate();
Thanks for the help.