edgegraph.structure.link.Link#
- class edgegraph.structure.link.Link(*, vertices=None, uid=None, attributes=None, _force_creation=False)#
Bases:
BaseObjectRepresents an edge in the edge-vertex graph.
Warning
This object is the base class for edge types, and should not be used on its own. Its meaning and semantics are undefined (it is neither a directed edge nor an undirected edge).
See also
UnDirectedEdge, a subclass representing an undirected edge between two verticesDirectedEdge, a subclass representing a directed edge between two vertices
- __init__(*, vertices=None, uid=None, attributes=None, _force_creation=False)#
Instantiate a new link (“edge”).
Warning
Generally, creating objects of this type is a bad idea, as their meaning is undefined. Instead, see the subclass types that implement directed or undirected edges.
- Parameters:
- Concurrency:
Thread-safe
See also
edgegraph.structure.base.BaseObject.__init__(), the superclass constructor
Methods
__init__(*[, vertices, uid, attributes, ...])Instantiate a new link ("edge").
add_to_universe(universe)Add this object to a new universe.
add_vertex(new)Add a vertex to this link.
remove_from_universe(universe)Remove this object from the specified universe.
unlink_from(kill)Remove the link association from the given vertex.
Attributes
Get the UID of this object.
Get the universes this object belongs to.
Return a tuple of vertices this edge connects.
- add_to_universe(universe)#
Add this object to a new universe.
If it is already there, no action is taken.
- Parameters:
universe (Universe) – the new universe to add this object to
- add_vertex(new)#
Add a vertex to this link.
- Parameters:
new (Vertex) – the vertex to add to the link
- Concurrency:
Thread-safe
- remove_from_universe(universe)#
Remove this object from the specified universe.
- Parameters:
universe (Universe) – the universe that this object will be removed from
- Raises:
ValueError – if this object is not present in the given universe
- property universes: list[Universe]#
Get the universes this object belongs to.
Note that the copy returned is just that, a copy. Modifications to this list that you may make will have no effect on the object.
See also
add_to_universe(),remove_from_universe()to add or remove this object from a given universe