pub struct Fragment { /* private fields */ }Expand description
Re-export of Fragment.
A rooted (or multi-root) fragment of a knowledge graph.
A fragment is a TribleSet plus a (possibly empty) set of “exported” entity
ids that act as entry points into the contained facts. Exports are not
privileged in the graph model itself; they are simply the ids the producer
wants to hand back to the caller as the fragment’s interface.
Implementations§
Source§impl Fragment
impl Fragment
Sourcepub fn rooted(root: Id, facts: TribleSet) -> Self
pub fn rooted(root: Id, facts: TribleSet) -> Self
Creates a fragment that exports a single root id.
Sourcepub fn new<I>(exports: I, facts: TribleSet) -> Selfwhere
I: IntoIterator<Item = Id>,
pub fn new<I>(exports: I, facts: TribleSet) -> Selfwhere
I: IntoIterator<Item = Id>,
Creates a fragment with the given exported ids.
Export ids are canonicalized as a set (duplicates are ignored). Empty exports are allowed.
Sourcepub fn exports(&self) -> impl Iterator<Item = Id> + '_
pub fn exports(&self) -> impl Iterator<Item = Id> + '_
Returns the exported ids for this fragment, in deterministic (lexicographic) order.
pub fn facts(&self) -> &TribleSet
pub fn into_facts(self) -> TribleSet
pub fn into_parts(self) -> (PATCH<16>, TribleSet)
Methods from Deref<Target = TribleSet>§
Sourcepub fn intersect(&self, other: &Self) -> Self
pub fn intersect(&self, other: &Self) -> Self
Returns a new set containing only tribles present in both sets.
Sourcepub fn difference(&self, other: &Self) -> Self
pub fn difference(&self, other: &Self) -> Self
Returns a new set containing tribles in self but not in other.
Sourcepub fn fingerprint(&self) -> TribleSetFingerprint
pub fn fingerprint(&self) -> TribleSetFingerprint
Sourcepub fn contains(&self, trible: &Trible) -> bool
pub fn contains(&self, trible: &Trible) -> bool
Returns true when the exact trible is present in the set.
Sourcepub fn value_in_range<V: ValueSchema>(
&self,
variable: Variable<V>,
min: Value<V>,
max: Value<V>,
) -> TribleSetRangeConstraint
pub fn value_in_range<V: ValueSchema>( &self, variable: Variable<V>, min: Value<V>, max: Value<V>, ) -> TribleSetRangeConstraint
Creates a constraint that proposes only values in the byte range
[min, max] (inclusive) using the VEA index with infixes_range.
Use with and! alongside a pattern! for efficient range queries:
find!(ts: Value<NsTAIInterval>,
and!(
pattern!(&data, [{ ?id @ attr: ?ts }]),
data.value_in_range(ts, min_ts, max_ts),
)
)Trait Implementations§
Source§impl AddAssign<Fragment> for TribleSet
impl AddAssign<Fragment> for TribleSet
Source§fn add_assign(&mut self, rhs: Fragment)
fn add_assign(&mut self, rhs: Fragment)
+= operation. Read moreSource§impl AddAssign<TribleSet> for Fragment
impl AddAssign<TribleSet> for Fragment
Source§fn add_assign(&mut self, rhs: TribleSet)
fn add_assign(&mut self, rhs: TribleSet)
+= operation. Read moreSource§impl AddAssign for Fragment
impl AddAssign for Fragment
Source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
+= operation. Read moreSource§impl<'a> IntoIterator for &'a Fragment
impl<'a> IntoIterator for &'a Fragment
impl Eq for Fragment
impl StructuralPartialEq for Fragment
Auto Trait Implementations§
impl Freeze for Fragment
impl RefUnwindSafe for Fragment
impl Send for Fragment
impl Sync for Fragment
impl Unpin for Fragment
impl UnsafeUnpin for Fragment
impl UnwindSafe for Fragment
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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>
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>
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