ontocore-diagnostics 0.11.1

Ontology lint rules and diagnostic collection for OntoCore (ontocore-*)
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use ontocore_core::{Annotation, Axiom, Diagnostic, Entity, Import, Namespace, OntologyDocument};

/// Read-only catalog snapshot for lint rules (avoids cyclic dependency on `ontocore-catalog`).
#[derive(Debug, Clone, Default)]
pub struct DiagnosticInput<'a> {
    pub documents: &'a [OntologyDocument],
    pub entities: &'a [Entity],
    pub annotations: &'a [Annotation],
    pub axioms: &'a [Axiom],
    pub namespaces: &'a [Namespace],
    pub imports: &'a [Import],
}

impl<'a> DiagnosticInput<'a> {
    pub fn diagnostics(&self) -> Vec<Diagnostic> {
        crate::engine::collect_diagnostics(self)
    }
}