I'm working with gremlin and gremlinpython for the first time, and I'm hitting a wall when I try to create new vertexes and an edge between them. I've looked at some of the other resources online, but I'm kind of reaching my wits end. Here is what I have so far.
def merge_vertexes_and_edge(g, name1:str, name2:str, src: int, dest: int):
g.V().has('name', name1).fold().coalesce(
unfold(),
addV('node').property('id', str(src)).property('name', name1)
).as_('v1').V().has('name', name2).fold().coalesce(
unfold(),
addV('node').property('id', str(dest)).property('name', name2)
).as_('v2').V('v1').out('knows').has('name', name2).fold().coalesce(
unfold(),
addE('knows').from_('v1').to('v2').property('name', f"{src}-{dest}")
).iterate()
```
I created two helper functions, that for now, do well enough.