Re: Edge propert doesn't support SET cardinality ?

Ankur Goel <ankur...@...>

Yes this feature is required, in absence it leads to multiple edge creation for  a multi value property.


On Wednesday, September 13, 2017 at 1:32:57 PM UTC+5:30, Ankur Goel wrote:

I am using embedded (cassandra + ES) janusgraph instance. and using below code to create vertex and edge:

                ManagementSystem mgmt = (ManagementSystem) graph.openManagement();

PropertyKey nameProperty = mgmt.makePropertyKey("names").dataType(String.class).cardinality(Cardinality.SET).make();

PropertyKey yoyoProperty = mgmt.makePropertyKey("yoyo").dataType(String.class).cardinality(Cardinality.SET).make();

mgmt.buildIndex("searchName", Vertex.class).addKey(nameProperty, Mapping.STRING.asParameter()).buildMixedIndex("search");

mgmt.buildIndex("searchYoyo", Vertex.class).addKey(yoyoProperty, Mapping.STRING.asParameter()).buildMixedIndex("search");

EdgeLabel directEdgeLabel = mgmt.makeEdgeLabel("edgeL").make();


// Insert a vertex

Vertex person1 = graph.addVertex();"names", "p1");"names", "p2");

Vertex person2 = graph.addVertex();"names", "p5");"names", "p6");

Edge edge = person1.addEdge("edgeL", person2);"yoyo", "wow");"yoyo", "hello");


Gremlin Output:

gremlin> g.E().valueMap()


gremlin> g.V().valueMap()

==>{names=[p1, p2]}

==>{names=[p5, p6]}

Looks edge property is not supporting SET cardinality.

Please suggest.


Join { to automatically receive all group messages.