TaeraeGraph class
Lightweight in-memory graph engine.
Constructors
- TaeraeGraph()
- Creates an empty graph.
-
TaeraeGraph.fromJson(Map<
String, Object?> json) -
Rebuilds a graph from JSON data generated by toJson.
factory
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
clear(
) → void - Removes all nodes, edges, and indexes.
-
containsEdge(
String id) → bool -
Whether an edge with
idexists. -
containsNode(
String id) → bool -
Whether a node with
idexists. -
copy(
) → TaeraeGraph - Returns a deep copy of this graph.
-
edgeById(
String id) → TaeraeEdge? -
Returns the edge with
idornull. -
incoming(
String nodeId, {String? type}) → List< TaeraeEdge> -
Returns incoming edges for
nodeId, optionally filtered bytype. -
neighbors(
String nodeId, {String? type, bool bothDirections = true}) → List< TaeraeNode> -
Returns neighboring nodes for
nodeId, optionally filtered bytype. -
nodeById(
String id) → TaeraeNode? -
Returns the node with
idornull. -
nodesByLabel(
String label) → List< TaeraeNode> -
Returns nodes that contain
label. -
nodesWhereProperty(
String key, Object? value) → List< TaeraeNode> -
Returns nodes where property
keymatchesvalue. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
outgoing(
String nodeId, {String? type}) → List< TaeraeEdge> -
Returns outgoing edges for
nodeId, optionally filtered bytype. -
removeEdge(
String id) → bool -
Removes an edge by
id. -
removeNode(
String id) → bool - Removes a node and all incident edges.
-
shortestPathBfs(
String startId, String endId, {String? edgeType}) → List< String> ? -
Finds the shortest directed path from
startIdtoendIdusing BFS. -
toJson(
) → Map< String, Object?> - Serializes the graph to JSON.
-
toString(
) → String -
A string representation of this object.
inherited
-
upsertEdge(
String id, String from, String to, {String? type, Map< String, Object?> ? properties}) → TaeraeEdge -
Inserts a new edge or updates an existing edge by
id. -
upsertNode(
String id, {Iterable< String> ? labels, Map<String, Object?> ? properties}) → TaeraeNode -
Inserts a new node or updates an existing node by
id.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited