finding edges in a graph by label?

904 views
Skip to first unread message

Paul Grebenc

unread,
Sep 24, 2012, 3:52:37 PM9/24/12
to gremli...@googlegroups.com
I've been looking at the possibility of finding all edges in a graph based on the edge label value, and I haven't found a way.

There is a getEdges(key, value) method on the Graph interface, but it does not return anything if the key is 'label'.  I've determined that I can get around this issue by simply adding another property to the edge containing the label value, which I can match against with the getEdges call, but I am wondering if there is a better way, rather than duplicating the label value as a property on the edge?

Regards,
Paul

Marko Rodriguez

unread,
Sep 24, 2012, 4:15:40 PM9/24/12
to gremli...@googlegroups.com
Hi,

That is a bug. graph.getEdges("label","myLabel") should return all edges with that particular label.

If you make an issue, we will have that fixed for the next release.

Another way to do what you want is:

g.V.outE('knows')

gremlin> g = TinkerGraphFactory.createTinkerGraph()
==>tinkergraph[vertices:6 edges:6]
gremlin> g.V.outE('knows')
==>e[7][1-knows->2]
==>e[8][1-knows->4]

Good luck,
Marko.

http://markorodriguez.com
> --
>
>

Dan Halbert

unread,
Nov 20, 2012, 4:08:05 PM11/20/12
to gremli...@googlegroups.com
Sorry for dredging up an old thread, but I can't find any bug filed on this by the original poster (or anyone). Was it fixed or should I submit a bug?  --Dan

Marko Rodriguez

unread,
Nov 20, 2012, 4:24:16 PM11/20/12
to gremli...@googlegroups.com

Hi,

Please make a ticket.

Thanks,
Marko.

http://markorodriguez.com

--
 
 
Reply all
Reply to author
Forward
0 new messages