pub trait ContextuableGraph<D, S, T, ST, SYM, VS, VT>where
D: Datable + Clone,
S: Spatial<VS> + Clone,
T: Temporal<VT> + Clone,
ST: SpaceTemporal<VS, VT> + Clone,
SYM: Symbolic + Clone,
VS: Clone,
VT: Clone,{
// Required methods
fn add_node(
&mut self,
value: Contextoid<D, S, T, ST, SYM, VS, VT>,
) -> Result<usize, ContextIndexError>;
fn contains_node(&self, index: usize) -> bool;
fn get_node(
&self,
index: usize,
) -> Option<&Contextoid<D, S, T, ST, SYM, VS, VT>>;
fn remove_node(
&mut self,
node_id: ContextoidId,
) -> Result<(), ContextIndexError>;
fn update_node(
&mut self,
node_id: ContextoidId,
new_node: Contextoid<D, S, T, ST, SYM, VS, VT>,
) -> Result<(), ContextIndexError>;
fn add_edge(
&mut self,
a: usize,
b: usize,
weight: RelationKind,
) -> Result<(), ContextIndexError>;
fn contains_edge(&self, a: usize, b: usize) -> bool;
fn remove_edge(
&mut self,
a: usize,
b: usize,
) -> Result<(), ContextIndexError>;
fn size(&self) -> usize;
fn is_empty(&self) -> bool;
fn number_of_nodes(&self) -> usize;
fn number_of_edges(&self) -> usize;
}Expand description
Trait for graph containing context-aware nodes.
D: Datable trait object S: Spatial trait object T: Temporable trait object ST: SpaceTemporal trait object V: Numeric type for dimension values
Provides methods for:
- Adding/removing nodes and edges
- Checking if nodes/edges exist
- Getting node references
- Getting graph size and counts
Nodes are Contextoid objects implementing required traits. Edges have a relation kind weight.
Methods return Result or Option types for error handling.