Closed sbromberger closed 6 years ago
Neat, thanks for the heads up!
I might have missed it, but is there a way to get nodes/edges based on a property? Eg. get the index for edges with :action == "knows"
?
Maybe I should move this to an issue on your repo, but it seems too trivial for that.
There's an opportunity for some syntactic sugar / convenience function, but in the meantime, you can do
filter(x->has_prop(g, x, :action), edges(g))
That will get you all the edges that have the :action
property set – not the value, for which you'd probably need
filter(x->has_prop(g, x, :action) && get_prop(g, x, :action) == "knows", edges(g))
@kescobo You've inspired me: https://github.com/JuliaGraphs/MetaGraphs.jl/pull/2
This new package might be of use to you. It extends LightGraphs to allow arbitrary vertex, edge, and graph metadata. Not in METADATA.jl yet, but hopefully within the next 24h.
https://github.com/JuliaGraphs/MetaGraphs.jl