pub struct AdvancedGraphStats {
pub triple_count: usize,
pub unique_subjects: usize,
pub unique_predicates: usize,
pub unique_objects: usize,
pub avg_triples_per_subject: f64,
pub max_triples_per_subject: usize,
pub singleton_subjects: usize,
pub top_predicates: Vec<(String, usize)>,
}Expand description
Advanced graph statistics
Fields§
§triple_count: usizeTotal number of triples
unique_subjects: usizeNumber of unique subjects
unique_predicates: usizeNumber of unique predicates
unique_objects: usizeNumber of unique objects
avg_triples_per_subject: f64Average triples per subject
max_triples_per_subject: usizeMaximum triples for any subject
singleton_subjects: usizeNumber of subjects with only one triple
top_predicates: Vec<(String, usize)>Most common predicates (top 10)
Implementations§
Source§impl AdvancedGraphStats
impl AdvancedGraphStats
Sourcepub fn compute(triples: &[Triple]) -> Self
pub fn compute(triples: &[Triple]) -> Self
Compute advanced statistics for a graph
§Example
use oxirs_ttl::toolkit::graph_utils::AdvancedGraphStats;
use oxirs_core::model::{Triple, NamedNode};
let triples = vec![
Triple::new(
NamedNode::new("http://example.org/s1")?,
NamedNode::new("http://example.org/p")?,
NamedNode::new("http://example.org/o1")?,
),
Triple::new(
NamedNode::new("http://example.org/s1")?,
NamedNode::new("http://example.org/p")?,
NamedNode::new("http://example.org/o2")?,
),
];
let stats = AdvancedGraphStats::compute(&triples);
assert_eq!(stats.triple_count, 2);
assert_eq!(stats.unique_subjects, 1);Trait Implementations§
Source§impl Clone for AdvancedGraphStats
impl Clone for AdvancedGraphStats
Source§fn clone(&self) -> AdvancedGraphStats
fn clone(&self) -> AdvancedGraphStats
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AdvancedGraphStats
impl Debug for AdvancedGraphStats
Source§impl PartialEq for AdvancedGraphStats
impl PartialEq for AdvancedGraphStats
impl StructuralPartialEq for AdvancedGraphStats
Auto Trait Implementations§
impl Freeze for AdvancedGraphStats
impl RefUnwindSafe for AdvancedGraphStats
impl Send for AdvancedGraphStats
impl Sync for AdvancedGraphStats
impl Unpin for AdvancedGraphStats
impl UnsafeUnpin for AdvancedGraphStats
impl UnwindSafe for AdvancedGraphStats
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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