Skip to main content

RdfStatistics

Struct RdfStatistics 

Source
pub struct RdfStatistics {
    pub total_triples: u64,
    pub subject_count: u64,
    pub predicate_count: u64,
    pub object_count: u64,
    pub predicates: HashMap<String, PredicateStatistics>,
    pub subject_histogram: Option<Histogram>,
    pub object_histogram: Option<Histogram>,
    pub index_stats: IndexStatistics,
}
Expand description

Statistics for an RDF triple store.

Fields§

§total_triples: u64

Total number of triples.

§subject_count: u64

Number of unique subjects.

§predicate_count: u64

Number of unique predicates.

§object_count: u64

Number of unique objects.

§predicates: HashMap<String, PredicateStatistics>

Per-predicate statistics.

§subject_histogram: Option<Histogram>

Subject frequency histogram (for join selectivity).

§object_histogram: Option<Histogram>

Object frequency histogram.

§index_stats: IndexStatistics

Index access pattern statistics (for cost model).

Implementations§

Source§

impl RdfStatistics

Source

pub fn new() -> Self

Creates new empty RDF statistics.

Source

pub fn update_from_counts( &mut self, total_triples: u64, subject_count: u64, predicate_count: u64, object_count: u64, )

Updates statistics from an RDF store.

Source

pub fn update_predicate(&mut self, predicate: &str, stats: PredicateStatistics)

Adds or updates predicate statistics.

Source

pub fn get_predicate(&self, predicate: &str) -> Option<&PredicateStatistics>

Gets predicate statistics.

Source

pub fn estimate_triple_pattern_cardinality( &self, subject_bound: bool, predicate_bound: Option<&str>, object_bound: bool, ) -> f64

Estimates cardinality for a triple pattern.

§Arguments
  • subject_bound - Whether the subject is a constant
  • predicate_bound - Whether the predicate is a constant (and its value if so)
  • object_bound - Whether the object is a constant
Source

pub fn estimate_join_selectivity( &self, var_position1: TriplePosition, var_position2: TriplePosition, ) -> f64

Estimates join selectivity between two patterns sharing a variable.

Source

pub fn estimate_filter_selectivity(&self, predicate_iri: Option<&str>) -> f64

Estimates the cardinality after a FILTER operation.

Trait Implementations§

Source§

impl Clone for RdfStatistics

Source§

fn clone(&self) -> RdfStatistics

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for RdfStatistics

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for RdfStatistics

Source§

fn default() -> RdfStatistics

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.