Skip to main content

KnowledgeGraphManager

Struct KnowledgeGraphManager 

Source
pub struct KnowledgeGraphManager { /* private fields */ }
Expand description

Manager for knowledge graph operations Provides async API wrapping SQLite database with proper blocking isolation

Implementations§

Source§

impl KnowledgeGraphManager

Source

pub fn new(db_path: PathBuf) -> Result<Self>

Create new manager with database at given path

Source

pub async fn create_entities( &self, entities: Vec<Entity>, ) -> Result<Vec<Entity>>

Create entities (returns only newly created entities)

Source

pub async fn create_relations( &self, relations: Vec<Relation>, ) -> Result<Vec<Relation>>

Create relations (returns only newly created relations)

Source

pub async fn add_observations( &self, inputs: Vec<ObservationInput>, ) -> Result<Vec<ObservationResult>>

Add observations to multiple entities (batch operation)

Source

pub async fn delete_entities(&self, names: Vec<String>) -> Result<usize>

Delete entities (cascade deletes relations via FOREIGN KEY)

Source

pub async fn delete_observations( &self, deletions: Vec<ObservationDeletion>, ) -> Result<()>

Delete observations from multiple entities (batch operation)

Source

pub async fn delete_relations(&self, relations: Vec<Relation>) -> Result<usize>

Delete relations

Source

pub async fn read_graph(&self) -> Result<KnowledgeGraph>

Read entire knowledge graph

Source

pub async fn search_nodes( &self, query: Option<String>, ) -> Result<KnowledgeGraph>

Search nodes using FTS5 full-text search

Source

pub async fn open_nodes(&self, names: Vec<String>) -> Result<KnowledgeGraph>

Open specific nodes by names

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> 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V