Edges
- s3dgraphy.edges.edge.get_connections_datamodel(datamodel_path: str | None = None) ConnectionsDatamodel[source]
Get the global ConnectionsDatamodel instance.
This function implements a singleton pattern for efficient reuse.
- Parameters:
datamodel_path – Optional path to the connections datamodel JSON file. Only used on first call.
- Returns:
The global ConnectionsDatamodel instance
- class s3dgraphy.edges.edge.Edge(edge_id, edge_source, edge_target, edge_type)[source]
Bases:
objectRepresents an edge in the graph, connecting two nodes with a specific relationship type.
- to_dict()[source]
Converts the Edge instance to a dictionary format.
- Returns:
A dictionary representation of the edge, including its attributes.
- Return type:
Edge Types Dictionary
- s3dgraphy.edges.edge.EDGE_TYPES
dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object’s
(key, value) pairs
- dict(iterable) -> new dictionary initialized as if via:
d = {} for k, v in iterable:
d[k] = v
- dict(**kwargs) -> new dictionary initialized with the name=value pairs
in the keyword argument list. For example: dict(one=1, two=2)
The EDGE_TYPES dictionary contains all valid edge types with their labels and descriptions.