pub struct RdfDiffEngine;Expand description
Engine for computing and manipulating RDF dataset diffs.
Implementations§
Source§impl RdfDiffEngine
impl RdfDiffEngine
Sourcepub fn compute(before: &[Triple], after: &[Triple]) -> DatasetDiff
pub fn compute(before: &[Triple], after: &[Triple]) -> DatasetDiff
Compute the diff between before and after triple sets.
added= triples inafterthat are not inbeforeremoved= triples inbeforethat are not inafter
Sourcepub fn apply_diff(base: Vec<Triple>, diff: &DatasetDiff) -> Vec<Triple>
pub fn apply_diff(base: Vec<Triple>, diff: &DatasetDiff) -> Vec<Triple>
Apply diff to base, returning the resulting dataset.
Removes all triples listed in diff.removed from base, then appends
all triples in diff.added, de-duplicating the result.
Sourcepub fn invert(diff: DatasetDiff) -> DatasetDiff
pub fn invert(diff: DatasetDiff) -> DatasetDiff
Invert a diff — swap added and removed so applying the result
undoes the original diff.
Sourcepub fn compose(d1: DatasetDiff, d2: DatasetDiff) -> DatasetDiff
pub fn compose(d1: DatasetDiff, d2: DatasetDiff) -> DatasetDiff
Compose two diffs into a single diff representing the net effect of
applying d1 followed by d2.
Net effect:
- Net added = (d1.added ∪ d2.added) \ d2.removed
- Net removed = (d1.removed ∪ d2.removed) \ d2.added
Sourcepub fn is_empty(diff: &DatasetDiff) -> bool
pub fn is_empty(diff: &DatasetDiff) -> bool
Return true if diff represents no change (no added and no removed triples).
Auto Trait Implementations§
impl Freeze for RdfDiffEngine
impl RefUnwindSafe for RdfDiffEngine
impl Send for RdfDiffEngine
impl Sync for RdfDiffEngine
impl Unpin for RdfDiffEngine
impl UnsafeUnpin for RdfDiffEngine
impl UnwindSafe for RdfDiffEngine
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> 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