pub struct PredicateStatistics {
pub triple_count: u64,
pub distinct_subjects: u64,
pub distinct_objects: u64,
pub is_functional: bool,
pub is_inverse_functional: bool,
pub object_type_distribution: HashMap<String, u64>,
pub object_histogram: Option<Histogram>,
}Expand description
Statistics for a specific predicate (property).
Fields§
§triple_count: u64Number of triples with this predicate.
distinct_subjects: u64Number of unique subjects using this predicate.
distinct_objects: u64Number of unique objects for this predicate.
is_functional: boolWhether this predicate is functional (1 object per subject).
is_inverse_functional: boolWhether this predicate is inverse functional (1 subject per object).
object_type_distribution: HashMap<String, u64>Object type statistics (for typed literals).
object_histogram: Option<Histogram>Histogram of object values (for selective filters).
Implementations§
Source§impl PredicateStatistics
impl PredicateStatistics
Sourcepub fn new(
triple_count: u64,
distinct_subjects: u64,
distinct_objects: u64,
) -> Self
pub fn new( triple_count: u64, distinct_subjects: u64, distinct_objects: u64, ) -> Self
Creates new predicate statistics.
Sourcepub fn with_functional(self, functional: bool) -> Self
pub fn with_functional(self, functional: bool) -> Self
Marks the predicate as functional.
Sourcepub fn with_object_histogram(self, histogram: Histogram) -> Self
pub fn with_object_histogram(self, histogram: Histogram) -> Self
Adds object histogram.
Sourcepub fn with_object_types(self, types: HashMap<String, u64>) -> Self
pub fn with_object_types(self, types: HashMap<String, u64>) -> Self
Adds object type distribution.
Sourcepub fn avg_objects_per_subject(&self) -> f64
pub fn avg_objects_per_subject(&self) -> f64
Average number of objects per subject.
Sourcepub fn avg_subjects_per_object(&self) -> f64
pub fn avg_subjects_per_object(&self) -> f64
Average number of subjects per object.
Sourcepub fn object_equality_selectivity(&self, _value: &Value) -> f64
pub fn object_equality_selectivity(&self, _value: &Value) -> f64
Selectivity of a value equality filter on objects.
Trait Implementations§
Source§impl Clone for PredicateStatistics
impl Clone for PredicateStatistics
Source§fn clone(&self) -> PredicateStatistics
fn clone(&self) -> PredicateStatistics
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for PredicateStatistics
impl RefUnwindSafe for PredicateStatistics
impl Send for PredicateStatistics
impl Sync for PredicateStatistics
impl Unpin for PredicateStatistics
impl UnwindSafe for PredicateStatistics
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