KnowledgeGraphStore

Struct KnowledgeGraphStore 

Source
pub struct KnowledgeGraphStore { /* private fields */ }

Implementations§

Source§

impl KnowledgeGraphStore

Source

pub fn new(conn: Arc<Mutex<Connection>>, instance_id: impl Into<String>) -> Self

Source

pub fn from_connection(conn: Connection, instance_id: impl Into<String>) -> Self

Source

pub fn instance_id(&self) -> &str

Source

pub fn insert_graph_node( &self, session_id: &str, node_type: NodeType, label: &str, properties: &JsonValue, embedding_id: Option<i64>, ) -> Result<i64>

Source

pub fn get_graph_node(&self, node_id: i64) -> Result<Option<GraphNode>>

Source

pub fn list_graph_nodes( &self, session_id: &str, node_type: Option<NodeType>, limit: Option<i64>, ) -> Result<Vec<GraphNode>>

Source

pub fn count_graph_nodes(&self, session_id: &str) -> Result<i64>

Source

pub fn update_graph_node( &self, node_id: i64, properties: &JsonValue, ) -> Result<()>

Source

pub fn delete_graph_node(&self, node_id: i64) -> Result<()>

Source

pub fn insert_graph_edge( &self, session_id: &str, source_id: i64, target_id: i64, edge_type: EdgeType, predicate: Option<&str>, properties: Option<&JsonValue>, weight: f32, ) -> Result<i64>

Source

pub fn get_graph_edge(&self, edge_id: i64) -> Result<Option<GraphEdge>>

Source

pub fn list_graph_edges( &self, session_id: &str, source_id: Option<i64>, target_id: Option<i64>, ) -> Result<Vec<GraphEdge>>

Source

pub fn count_graph_edges(&self, session_id: &str) -> Result<i64>

Source

pub fn delete_graph_edge(&self, edge_id: i64) -> Result<()>

Source

pub fn find_shortest_path( &self, session_id: &str, source_id: i64, target_id: i64, max_hops: Option<usize>, ) -> Result<Option<GraphPath>>

Source

pub fn traverse_neighbors( &self, session_id: &str, node_id: i64, direction: TraversalDirection, depth: usize, ) -> Result<Vec<GraphNode>>

Source

pub fn graph_changelog_append( &self, session_id: &str, instance_id: &str, entity_type: &str, entity_id: i64, operation: &str, vector_clock: &str, data: Option<&str>, ) -> Result<i64>

Source

pub fn graph_changelog_get_since( &self, session_id: &str, since_timestamp: &str, ) -> Result<Vec<ChangelogEntry>>

Source

pub fn graph_changelog_prune(&self, days_to_keep: i64) -> Result<usize>

Source

pub fn graph_sync_state_get( &self, instance_id: &str, session_id: &str, graph_name: &str, ) -> Result<Option<String>>

Source

pub fn graph_sync_state_update( &self, instance_id: &str, session_id: &str, graph_name: &str, vector_clock: &str, ) -> Result<()>

Source

pub fn graph_set_sync_enabled( &self, session_id: &str, graph_name: &str, enabled: bool, ) -> Result<()>

Source

pub fn graph_get_sync_enabled( &self, session_id: &str, graph_name: &str, ) -> Result<bool>

Source

pub fn graph_list(&self, session_id: &str) -> Result<Vec<String>>

Source

pub fn graph_list_sync_enabled(&self) -> Result<Vec<(String, String)>>

List all sync-enabled graphs across all sessions

Source

pub fn graph_get_node_with_sync( &self, node_id: i64, ) -> Result<Option<SyncedNodeRecord>>

Source

pub fn graph_list_nodes_with_sync( &self, session_id: &str, sync_enabled_only: bool, include_deleted: bool, ) -> Result<Vec<SyncedNodeRecord>>

Source

pub fn graph_get_edge_with_sync( &self, edge_id: i64, ) -> Result<Option<SyncedEdgeRecord>>

Source

pub fn graph_list_edges_with_sync( &self, session_id: &str, sync_enabled_only: bool, include_deleted: bool, ) -> Result<Vec<SyncedEdgeRecord>>

Source

pub fn graph_update_node_sync_metadata( &self, node_id: i64, vector_clock: &str, last_modified_by: &str, sync_enabled: bool, ) -> Result<()>

Source

pub fn graph_update_edge_sync_metadata( &self, edge_id: i64, vector_clock: &str, last_modified_by: &str, sync_enabled: bool, ) -> Result<()>

Source

pub fn graph_mark_node_deleted( &self, node_id: i64, vector_clock: &str, deleted_by: &str, ) -> Result<()>

Source

pub fn graph_mark_edge_deleted( &self, edge_id: i64, vector_clock: &str, deleted_by: &str, ) -> Result<()>

Trait Implementations§

Source§

impl Clone for KnowledgeGraphStore

Source§

fn clone(&self) -> KnowledgeGraphStore

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,