Set<String> set1=new HashSet<>();
set1.add("o1");
set2.add("o2");
set3.add("o3");
Set<String> set2=new HashSet();
set2.add("h1");
set2.add("h2");
g.addV("label").property(T.id,"id").next();
g.V("id").property(Cardinality.set, "set1",set1)
.property(Cardinality.single, "text", "hi")
.property(Cardinality.set, "set2",set2)
.next();
when this code
org.apache.tinkerpop.gremlin.driver.exception.ResponseException: {"requestId":"f92691e1-1f28-42ed-8fb0-2b4cf3cb48c1","code":"UnsupportedOperationException","detailedMessage":"Unsupported property value type: java.util.LinkedHashSet"}
if i loop it works
g.V("id").property(Cardinality.set, "set1","o1").next();
g.V("id").property(Cardinality.set, "set1","o2").next();
when trying to add multiple times it works .
Is there any way with out looping i mean adding the entire set at once.
gremlin> set1 = ["o1","o2","o3"] as Set==>o1==>o2==>o3gremlin> set2 = ["h1","h2"] as Set==>h1==>h2gremlin> g = TinkerGraph.open().traversal()==>graphtraversalsource[tinkergraph[vertices:0 edges:0], standard]gremlin> g.inject(["set1": set1, "set2": set2]).as("props").addV("label").property(id, "id").property(single, "text", "hi").as("v").select("props").unfold().as("prop").select(values).unfold().as("val").select("v").property(set, select("prop").by(keys), select("val")).iterate()gremlin> g.V().valueMap(true)==>[id:id,label:label,set2:[h1,h2],set1:[o1,o2,o3],text:[hi]]
--
You received this message because you are subscribed to the Google Groups "Gremlin-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/7ace49ff-adf3-4bef-bef1-b66fa5cd2324%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
g.V("id").project("text", "set1","set2").by("text").by("set1").by("set2").next();
Here is the error
Multiple properties exist for the provided key, use Vertex.properties(set1).
Can you help me i need to display all properties in the json format.
required output:
{ "text": "hi" ,"set1":["o1","o2","o3"],"set2":["h1","h2","h3"]}
gremlin> g.V().valueMap()==>[set2:[h1,h2],set1:[o1,o2,o3],text:[hi]]
gremlin> g.V().project("text","set1","set2").by("text").by(values("set1").fold()).by(values("set2").fold())==>[text:hi,set1:[o1,o2,o3],set2:[h1,h2]]
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/6c59e49f-38da-4c8f-a363-4cbb417c4276%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/889942b0-2283-470d-8b8c-515a700337ae%40googlegroups.com.
gremlin> g.V().project("text","set1","set2"). by(coalesce(values('text'),constant('NULL'))).