pub struct TribleSet {
pub eav: PATCH<TRIBLE_LEN, EAVOrder, ()>,
pub vea: PATCH<TRIBLE_LEN, VEAOrder, ()>,
pub ave: PATCH<TRIBLE_LEN, AVEOrder, ()>,
pub vae: PATCH<TRIBLE_LEN, VAEOrder, ()>,
pub eva: PATCH<TRIBLE_LEN, EVAOrder, ()>,
pub aev: PATCH<TRIBLE_LEN, AEVOrder, ()>,
}Expand description
Re-export of TribleSet.
A collection of Tribles.
A TribleSet is a collection of Tribles that can be queried and manipulated.
It supports efficient set operations like union, intersection, and difference.
The stored Tribles are indexed by the six possible orderings of their fields
in corresponding PATCHes.
Clone is extremely cheap and can be used to create a snapshot of the current state of the TribleSet.
Note that the TribleSet does not support an explicit delete/remove operation,
as this would conflict with the CRDT semantics of the TribleSet and CALM principles as a whole.
It does allow for set subtraction, but that operation is meant to compute the difference between two sets
and not to remove elements from the set. A subtle but important distinction.
Fields§
§eav: PATCH<TRIBLE_LEN, EAVOrder, ()>Entity → Attribute → Value index.
vea: PATCH<TRIBLE_LEN, VEAOrder, ()>Value → Entity → Attribute index.
ave: PATCH<TRIBLE_LEN, AVEOrder, ()>Attribute → Value → Entity index.
vae: PATCH<TRIBLE_LEN, VAEOrder, ()>Value → Attribute → Entity index.
eva: PATCH<TRIBLE_LEN, EVAOrder, ()>Entity → Value → Attribute index.
aev: PATCH<TRIBLE_LEN, AEVOrder, ()>Attribute → Entity → Value index.
Implementations§
Source§impl TribleSet
impl 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 TribleSet
impl AddAssign for TribleSet
Source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
+= operation. Read moreSource§impl<U> From<&SuccinctArchive<U>> for TribleSetwhere
U: Universe,
impl<U> From<&SuccinctArchive<U>> for TribleSetwhere
U: Universe,
Source§fn from(archive: &SuccinctArchive<U>) -> Self
fn from(archive: &SuccinctArchive<U>) -> Self
Source§impl<U> From<&TribleSet> for SuccinctArchive<U>
impl<U> From<&TribleSet> for SuccinctArchive<U>
Source§impl From<&TribleSet> for TribleSetFingerprint
impl From<&TribleSet> for TribleSetFingerprint
Source§impl FromIterator<Trible> for TribleSet
impl FromIterator<Trible> for TribleSet
Source§impl<'a> IntoIterator for &'a TribleSet
impl<'a> IntoIterator for &'a TribleSet
Source§impl ToBlob<SimpleArchive> for &TribleSet
impl ToBlob<SimpleArchive> for &TribleSet
Source§fn to_blob(self) -> Blob<SimpleArchive>
fn to_blob(self) -> Blob<SimpleArchive>
Source§impl ToBlob<SimpleArchive> for TribleSet
impl ToBlob<SimpleArchive> for TribleSet
Source§fn to_blob(self) -> Blob<SimpleArchive>
fn to_blob(self) -> Blob<SimpleArchive>
Source§impl TriblePattern for TribleSet
impl TriblePattern for TribleSet
Source§type PatternConstraint<'a> = TribleSetConstraint
type PatternConstraint<'a> = TribleSetConstraint
Source§fn pattern<V: ValueSchema>(
&self,
e: Variable<GenId>,
a: Variable<GenId>,
v: Variable<V>,
) -> Self::PatternConstraint<'static>
fn pattern<V: ValueSchema>( &self, e: Variable<GenId>, a: Variable<GenId>, v: Variable<V>, ) -> Self::PatternConstraint<'static>
Source§impl TryFromBlob<SimpleArchive> for TribleSet
impl TryFromBlob<SimpleArchive> for TribleSet
Source§type Error = UnarchiveError
type Error = UnarchiveError
Source§fn try_from_blob(blob: Blob<SimpleArchive>) -> Result<Self, Self::Error>
fn try_from_blob(blob: Blob<SimpleArchive>) -> Result<Self, Self::Error>
impl Eq for TribleSet
Auto Trait Implementations§
impl Freeze for TribleSet
impl RefUnwindSafe for TribleSet
impl Send for TribleSet
impl Sync for TribleSet
impl Unpin for TribleSet
impl UnsafeUnpin for TribleSet
impl UnwindSafe for TribleSet
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