pub struct StaticGraph {Show 35 fields
pub graphid: String,
pub name: StaticTranslatableString,
pub author: Option<String>,
pub subtitle: Option<StaticTranslatableString>,
pub description: Option<StaticTranslatableString>,
pub nodes: Vec<StaticNode>,
pub nodegroups: Vec<StaticNodegroup>,
pub edges: Vec<StaticEdge>,
pub root: StaticNode,
pub version: Option<String>,
pub iconclass: Option<String>,
pub color: Option<String>,
pub isresource: Option<bool>,
pub slug: Option<String>,
pub is_editable: Option<bool>,
pub ontology_id: Option<Vec<String>>,
pub template_id: Option<String>,
pub deploymentdate: Option<String>,
pub deploymentfile: Option<String>,
pub jsonldcontext: Option<String>,
pub config: Value,
pub relatable_resource_model_ids: Vec<String>,
pub publication: Option<Value>,
pub resource_2_resource_constraints: Option<Vec<Value>>,
pub source_identifier_id: Option<String>,
pub is_active: Option<bool>,
pub has_unpublished_changes: Option<bool>,
pub is_copy_immutable: Option<bool>,
pub resource_instance_lifecycle: Option<Value>,
pub spatial_views: Option<Value>,
pub group_permissions: Option<Value>,
pub user_permissions: Option<Value>,
pub cards: Option<Vec<StaticCard>>,
pub cards_x_nodes_x_widgets: Option<Vec<StaticCardsXNodesXWidgets>>,
pub functions_x_graphs: Option<Vec<StaticFunctionsXGraphs>>,
/* private fields */
}Expand description
The main graph structure containing nodes, edges, and metadata
Fields§
§graphid: String§name: StaticTranslatableString§subtitle: Option<StaticTranslatableString>§description: Option<StaticTranslatableString>§nodes: Vec<StaticNode>§nodegroups: Vec<StaticNodegroup>§edges: Vec<StaticEdge>§root: StaticNode§version: Option<String>§iconclass: Option<String>§color: Option<String>§isresource: Option<bool>§slug: Option<String>§is_editable: Option<bool>§ontology_id: Option<Vec<String>>Ontology IDs used by this graph. Accepts a single string or an array of strings on the wire; a single-element list is serialised as a plain string for round-trip compatibility with upstream Arches.
template_id: Option<String>§deploymentdate: Option<String>§deploymentfile: Option<String>§jsonldcontext: Option<String>§config: Value§relatable_resource_model_ids: Vec<String>§publication: Option<Value>§resource_2_resource_constraints: Option<Vec<Value>>§source_identifier_id: Option<String>Source identifier for import/export tracking
is_active: Option<bool>Whether graph is active
has_unpublished_changes: Option<bool>Whether graph has unpublished changes
is_copy_immutable: Option<bool>Whether copy is immutable
resource_instance_lifecycle: Option<Value>Resource instance lifecycle configuration
spatial_views: Option<Value>Spatial views configuration
group_permissions: Option<Value>Group permissions
user_permissions: Option<Value>User permissions
cards: Option<Vec<StaticCard>>§cards_x_nodes_x_widgets: Option<Vec<StaticCardsXNodesXWidgets>>§functions_x_graphs: Option<Vec<StaticFunctionsXGraphs>>Implementations§
Source§impl StaticGraph
impl StaticGraph
Sourcepub fn from_json_string(json_str: &str) -> Result<StaticGraph, String>
pub fn from_json_string(json_str: &str) -> Result<StaticGraph, String>
Load a graph from a JSON string Handles both direct graph objects and wrapped format: {“graph”: […]}
Sourcepub fn build_indices(&mut self)
pub fn build_indices(&mut self)
Build the internal lookup indices
Sourcepub fn invalidate_indices(&mut self)
pub fn invalidate_indices(&mut self)
Invalidate all internal lookup indices.
This must be called after mutations that modify the nodes vector,
especially operations like retain() that shift element positions.
Sourcepub fn get_root(&self) -> &StaticNode
pub fn get_root(&self) -> &StaticNode
Get the root node
Sourcepub fn get_node_by_index(&self, idx: usize) -> Option<&StaticNode>
pub fn get_node_by_index(&self, idx: usize) -> Option<&StaticNode>
Get node by index
Sourcepub fn get_node_by_id(&self, id: &str) -> Option<&StaticNode>
pub fn get_node_by_id(&self, id: &str) -> Option<&StaticNode>
Get node by ID
Sourcepub fn get_node_by_alias(&self, alias: &str) -> Option<&StaticNode>
pub fn get_node_by_alias(&self, alias: &str) -> Option<&StaticNode>
Get node by alias
Sourcepub fn display_name(&self) -> String
pub fn display_name(&self) -> String
Get display name
Sourcepub fn display_subtitle(&self) -> String
pub fn display_subtitle(&self) -> String
Get subtitle
Get author
Sourcepub fn nodes_slice(&self) -> &[StaticNode]
pub fn nodes_slice(&self) -> &[StaticNode]
Get nodes slice
Sourcepub fn nodegroups_slice(&self) -> &[StaticNodegroup]
pub fn nodegroups_slice(&self) -> &[StaticNodegroup]
Get nodegroups slice
Sourcepub fn edges_slice(&self) -> &[StaticEdge]
pub fn edges_slice(&self) -> &[StaticEdge]
Get edges slice
Sourcepub fn root_node(&self) -> &StaticNode
pub fn root_node(&self) -> &StaticNode
Get root node
Sourcepub fn get_model_class_name(&self) -> Option<String>
pub fn get_model_class_name(&self) -> Option<String>
Get the model class name for this graph.
This returns the graph’s display name, which is used as the ResourceInstanceCacheEntry “type” field in TypeScript.
Sourcepub fn edges_map(&self) -> Option<&HashMap<String, Vec<String>>>
pub fn edges_map(&self) -> Option<&HashMap<String, Vec<String>>>
Get edges map (parent_nodeid -> child_nodeids) Returns None if indices haven’t been built
Sourcepub fn get_child_ids(&self, node_id: &str) -> Option<&Vec<String>>
pub fn get_child_ids(&self, node_id: &str) -> Option<&Vec<String>>
Get child node IDs for a given node
Sourcepub fn nodes_by_nodegroup(&self) -> Option<&HashMap<String, Vec<usize>>>
pub fn nodes_by_nodegroup(&self) -> Option<&HashMap<String, Vec<usize>>>
Get nodes by nodegroup (nodegroup_id -> node indices) Returns None if indices haven’t been built
Sourcepub fn get_nodes_in_nodegroup(&self, nodegroup_id: &str) -> Vec<&StaticNode>
pub fn get_nodes_in_nodegroup(&self, nodegroup_id: &str) -> Vec<&StaticNode>
Get nodes in a specific nodegroup
Sourcepub fn get_nodegroup_by_id(
&self,
nodegroup_id: &str,
) -> Option<&StaticNodegroup>
pub fn get_nodegroup_by_id( &self, nodegroup_id: &str, ) -> Option<&StaticNodegroup>
Get nodegroup by ID
Sourcepub fn nodes_by_alias_arc(&self) -> Option<&HashMap<String, Arc<StaticNode>>>
pub fn nodes_by_alias_arc(&self) -> Option<&HashMap<String, Arc<StaticNode>>>
Get Arc-wrapped nodes by alias map (for pseudo_value infrastructure) Returns None if indices haven’t been built
Sourcepub fn get_node_arc_by_alias(&self, alias: &str) -> Option<Arc<StaticNode>>
pub fn get_node_arc_by_alias(&self, alias: &str) -> Option<Arc<StaticNode>>
Get Arc-wrapped node by alias
Sourcepub fn deep_clone(&self) -> Self
pub fn deep_clone(&self) -> Self
Create a deep clone of the graph with fresh indices
Sourcepub fn push_node(&mut self, node: StaticNode)
pub fn push_node(&mut self, node: StaticNode)
Push a new node to the graph
Note: You must call build_indices() after all mutations to rebuild lookup tables.
Sourcepub fn push_edge(&mut self, edge: StaticEdge)
pub fn push_edge(&mut self, edge: StaticEdge)
Push a new edge to the graph
Sourcepub fn push_nodegroup(&mut self, nodegroup: StaticNodegroup)
pub fn push_nodegroup(&mut self, nodegroup: StaticNodegroup)
Push a new nodegroup to the graph
Sourcepub fn push_card(&mut self, card: StaticCard)
pub fn push_card(&mut self, card: StaticCard)
Push a new card to the graph
Sourcepub fn push_card_x_node_x_widget(&mut self, cxnxw: StaticCardsXNodesXWidgets)
pub fn push_card_x_node_x_widget(&mut self, cxnxw: StaticCardsXNodesXWidgets)
Push a new cards_x_nodes_x_widgets entry
Sourcepub fn cards_slice(&self) -> &[StaticCard]
pub fn cards_slice(&self) -> &[StaticCard]
Get cards slice (for mutation checks)
Sourcepub fn card_index(&self) -> Option<&CardIndex>
pub fn card_index(&self) -> Option<&CardIndex>
Get the card hierarchy index (None if graph has no cards)
Sourcepub fn cards_x_nodes_x_widgets_slice(&self) -> &[StaticCardsXNodesXWidgets]
pub fn cards_x_nodes_x_widgets_slice(&self) -> &[StaticCardsXNodesXWidgets]
Get cards_x_nodes_x_widgets slice
Sourcepub fn find_card_by_nodegroup(&self, nodegroup_id: &str) -> Option<&StaticCard>
pub fn find_card_by_nodegroup(&self, nodegroup_id: &str) -> Option<&StaticCard>
Find a card by nodegroup_id
Sourcepub fn find_node_by_alias(&self, alias: &str) -> Option<&StaticNode>
pub fn find_node_by_alias(&self, alias: &str) -> Option<&StaticNode>
Find a node by alias (without requiring indices to be built)
Sourcepub fn get_schema(&self) -> Value
pub fn get_schema(&self) -> Value
Get a simplified schema view of the graph showing node aliases and structure.
Returns a nested structure representing the tree with:
- Keys are node aliases (or nodeid if no alias)
- Values contain ‘datatype’, ‘nodeid’, optionally ‘required’, and ‘children’
Useful for understanding what keys are available in tree output.
Sourcepub fn set_descriptor_template(
&mut self,
descriptor_type: &str,
string_template: &str,
) -> Result<(), String>
pub fn set_descriptor_template( &mut self, descriptor_type: &str, string_template: &str, ) -> Result<(), String>
Set a descriptor template for a given descriptor type (e.g. “slug”, “name”).
The nodegroup_id is inferred from the <Node Name> placeholders in the
template by looking up nodes in the graph. All placeholder nodes must belong
to exactly one nodegroup — returns an error otherwise.
Creates or updates the descriptor function entry in functions_x_graphs.
Trait Implementations§
Source§impl Clone for StaticGraph
impl Clone for StaticGraph
Source§fn clone(&self) -> StaticGraph
fn clone(&self) -> StaticGraph
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more