edgegraph.builder.explicit.link_from_to#
- edgegraph.builder.explicit.link_from_to(v1, lnktype, v2, dontdup=False)#
Create a link of type
lnktypefromv1tov2.This function instantiates a new link type (a subclass of
TwoEndedLink. It then associates both given vertices to the link instance.See also
The
link_directed()andlink_undirected()functions createDirectedEdgeandUnDirectedEdgerespectively in a similar manner to this function.- Parameters:
v1 (Vertex) – One end of the link.
lnktype (type) – The class of the link.
v2 (Vertex) – The other end of the link.
dontdup (bool) – If set to True, performs a check for any already-existing links between v1 and v2. If any are found (of any type, directed or undirected), no new link is created, but the already-existing one is returned silently.
- Returns:
The link instance.
- Return type: