Graph Module¶
Graph Manager¶
GraphManager(adapter: Any, project: ProjectSummary)
¶
Graph manager for a specific project.
Provides graph operations like adding nodes/edges without requiring project context on each method call.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
adapter
|
Any
|
adapter (FluidizeSDK or LocalAdapter) |
required |
project
|
ProjectSummary
|
The project this graph manager is bound to |
required |
get() -> GraphData
¶
Get the complete graph for this project.
Returns:
Type | Description |
---|---|
GraphData
|
GraphData containing all nodes and edges for this project |
add_node(node: GraphNode, sim_global: bool = True) -> NodeManager
¶
Add a new node to this project's graph.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
node
|
GraphNode
|
The node to insert |
required |
sim_global
|
bool
|
Whether to use global simulations (placeholder for future) |
True
|
Returns:
Type | Description |
---|---|
NodeManager
|
The added node |
update_node_position(node: GraphNode) -> GraphNode
¶
delete_node(node_id: str) -> None
¶
Delete a node from this project's graph.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
node_id
|
str
|
ID of the node to delete |
required |
add_edge(edge: GraphEdge) -> GraphEdge
¶
delete_edge(edge_id: str) -> None
¶
Delete an edge from this project's graph.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
edge_id
|
str
|
ID of the edge to delete |
required |
Graph Processor¶
GraphProcessor(project: ProjectSummary)
¶
Local filesystem-based graph processor.
Handles all graph operations using the filesystem as the source of truth, compatible with the FastAPI interface but without cloud dependencies.
Initialize the graph processor.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
project
|
ProjectSummary
|
The project to operate on |
required |
get_graph() -> GraphData
¶
Gets the entire graph for the project from graph.json file.
Returns:
Type | Description |
---|---|
GraphData
|
GraphData containing all nodes and edges |
insert_node(node: GraphNode, sim_global: bool = True) -> GraphNode
¶
insert_node_from_scratch(GraphNode: GraphNode, nodeProperties: nodeProperties_simulation, nodeMetadata: nodeMetadata_simulation, repo_link: Optional[str] = None) -> GraphNode
¶
Inserts a new node into the graph from scratch, creating all necessary files and directories.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
GraphNode
|
GraphNode
|
The graph node to insert |
required |
nodeProperties
|
nodeProperties_simulation
|
Properties configuration for the node |
required |
nodeMetadata
|
nodeMetadata_simulation
|
Metadata configuration for the node |
required |
repo_link
|
Optional[str]
|
Optional repository URL to clone into the source directory |
None
|
Returns:
Type | Description |
---|---|
GraphNode
|
The inserted GraphNode |
update_node_position(node: GraphNode) -> GraphNode
¶
delete_node(node_id: str) -> None
¶
Deletes a node from the graph and removes its directory.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
node_id
|
str
|
ID of the node to delete |
required |
upsert_edge(edge: GraphEdge) -> GraphEdge
¶
delete_edge(edge_id: str) -> None
¶
Deletes an edge from the graph.json file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
edge_id
|
str
|
ID of the edge to delete |
required |
Graph Types¶
GraphData
¶
GraphNode
¶
Bases: BaseModel
A node in the graph.
Attributes:
Name | Type | Description |
---|---|---|
id |
str
|
Unique node ID. |
position |
Position
|
Node position. |
data |
graphNodeData
|
Extra metadata. |
type |
str
|
Renderer/type key. |
GraphEdge
¶
Bases: BaseModel
An edge in the graph.
Attributes:
Name | Type | Description |
---|---|---|
id |
str
|
Unique edge ID. |
source |
str
|
Source node ID. |
target |
str
|
Target node ID. |
type |
str
|
Renderer/type key. |