2

I'm trying to add/update vertex and unknown number of properties using gremlin in java to janusgraph.

found an answer to add vertex here https://stackoverflow.com/a/56605921 couldnt convert this to work for add/update vertex.

i'm currently using this solution

g.V().has("vertexname", vertexname).fold().coalesce(__.unfold(), __.addV(label)).property("property1", property1value).property("property2", property2value).next();

However this doesnt work with unknown number of properties.

Is there a way i can combine the solution here https://stackoverflow.com/a/56605921 with what i'm using to work for add/update vertex with unknown number of properties?

Jin Lee
  • 3,194
  • 12
  • 46
  • 86
Sreerag
  • 31
  • 3
  • What do you mean by "an unknown number of properties"? Do you mean that the number isn't known when writing the program but is known at runtime? – Rebecca Nelson Jun 20 '19 at 18:46
  • we have different vertex labels. Properties of vertex are different for diferent label. i could make sepeate functions for add/update each vertex of label. however https://stackoverflow.com/a/56605921 is an interesting solution to inject maps to gremlin and make it work for dynamic collections. – Sreerag Jun 20 '19 at 21:19
  • hi were you able to find a solution for above problem ? @Sreerag – AbhiK May 06 '20 at 13:51

0 Answers0