pub struct HeterogeneousGraph {
pub name: String,
pub relations: HashMap<(String, String, String), Graph>,
pub all_nodes: HashMap<String, Vec<NodeId>>,
pub metadata: GraphMetadata,
}Expand description
A heterogeneous graph with multiple node and edge types.
Fields§
§name: StringGraph name.
relations: HashMap<(String, String, String), Graph>Subgraphs by relation type (source_type, edge_type, target_type).
all_nodes: HashMap<String, Vec<NodeId>>All node IDs by type.
metadata: GraphMetadataMetadata.
Implementations§
Source§impl HeterogeneousGraph
impl HeterogeneousGraph
Sourcepub fn add_relation(
&mut self,
source_type: &str,
edge_type: &str,
target_type: &str,
graph: Graph,
)
pub fn add_relation( &mut self, source_type: &str, edge_type: &str, target_type: &str, graph: Graph, )
Adds a relation (edge type between node types).
Sourcepub fn get_relation(
&self,
source_type: &str,
edge_type: &str,
target_type: &str,
) -> Option<&Graph>
pub fn get_relation( &self, source_type: &str, edge_type: &str, target_type: &str, ) -> Option<&Graph>
Gets a relation graph.
Sourcepub fn compute_statistics(&mut self)
pub fn compute_statistics(&mut self)
Computes statistics for the heterogeneous graph.
Trait Implementations§
Source§impl Clone for HeterogeneousGraph
impl Clone for HeterogeneousGraph
Source§fn clone(&self) -> HeterogeneousGraph
fn clone(&self) -> HeterogeneousGraph
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for HeterogeneousGraph
impl Debug for HeterogeneousGraph
Source§impl<'de> Deserialize<'de> for HeterogeneousGraph
impl<'de> Deserialize<'de> for HeterogeneousGraph
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for HeterogeneousGraph
impl RefUnwindSafe for HeterogeneousGraph
impl Send for HeterogeneousGraph
impl Sync for HeterogeneousGraph
impl Unpin for HeterogeneousGraph
impl UnwindSafe for HeterogeneousGraph
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more