Re: Edge propert doesn't support SET cardinality ?

Suny <sahithiy...@...>


Is there a specific reason why it is not implemented on edges ?


On Wednesday, September 13, 2017 at 4:35:44 AM UTC-4, Robert Dale wrote:
That is correct.  This is because TinkerPop only supports Property (key/value) on edges.  Vertexes have VertexProperty -

Note, that property keys used on edges and properties have cardinality SINGLE. Attaching multiple values for a single key on an edge or property is not supported.

You could create multiple edges instead.

On Wed, Sep 13, 2017 at 04:02 Ankur Goel <an...@...> 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.


You received this message because you are subscribed to the Google Groups "JanusGraph users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To view this discussion on the web visit
For more options, visit
Robert Dale

Join to automatically receive all group messages.