pub struct PathGraph { /* private fields */ }Expand description
An in-memory RDF graph for property path evaluation.
Stores triples as subject -> [(predicate, object)] for efficient lookup.
Implementations§
Source§impl PathGraph
impl PathGraph
Sourcepub fn add_triple(&mut self, subject: &str, predicate: &str, object: &str)
pub fn add_triple(&mut self, subject: &str, predicate: &str, object: &str)
Add a triple to the graph.
Sourcepub fn objects_of(&self, subject: &str, predicate: &str) -> Vec<String>
pub fn objects_of(&self, subject: &str, predicate: &str) -> Vec<String>
Return all objects reachable from subject via predicate.
Sourcepub fn subjects_of(&self, object: &str, predicate: &str) -> Vec<String>
pub fn subjects_of(&self, object: &str, predicate: &str) -> Vec<String>
Return all subjects that have predicate pointing to object.
Sourcepub fn all_predicates(&self) -> Vec<String>
pub fn all_predicates(&self) -> Vec<String>
Return all distinct predicates in the graph.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PathGraph
impl RefUnwindSafe for PathGraph
impl Send for PathGraph
impl Sync for PathGraph
impl Unpin for PathGraph
impl UnsafeUnpin for PathGraph
impl UnwindSafe for PathGraph
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more