Skip to main content

graphos_core/graph/
mod.rs

1//! Graph model implementations.
2//!
3//! Graphos supports two graph models:
4//!
5//! - [`lpg`] - Labeled Property Graph (default)
6//! - [`rdf`] - RDF Triple Store (optional, feature-gated)
7//!
8//! These are completely separate implementations with no abstraction overhead.
9
10pub mod lpg;
11
12#[cfg(feature = "rdf")]
13pub mod rdf;
14
15/// Direction of edge traversal.
16#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
17pub enum Direction {
18    /// Follow outgoing edges (from source to destination).
19    Outgoing,
20    /// Follow incoming edges (from destination to source).
21    Incoming,
22    /// Follow edges in either direction.
23    Both,
24}
25
26impl Direction {
27    /// Returns the opposite direction.
28    #[must_use]
29    pub const fn reverse(self) -> Self {
30        match self {
31            Direction::Outgoing => Direction::Incoming,
32            Direction::Incoming => Direction::Outgoing,
33            Direction::Both => Direction::Both,
34        }
35    }
36}