I'd like to use the grim library to create and traverse graphs, but I don't understand how to access a graph having the label in a string.
import grim
import sequtils
var g = newGraph("my graph")
let node = g.addNode("F4", %(Id: "none", desc: "OK"))
let dest = g.addNode("F8", %(Id: "dest"))
# get node knowing label?
let label1 = "F4"
echo g.node(label1) # <--- this does not work:
This script returns:
unhandled exception: key not found: F4 [KeyError]
Can you tell me how to access a node having the label?
In my graph each label is unique, but it's not granted by the library so that can be the issue, so maybe I'm looking for a better attribute to use to uniquely identify a node.
Thanks for any advice!