sophia_reasoner 0.10.0

A Rust toolkit for RDF and Linked Data - reasoner over Simple, RDF and RDF-Schema entailments
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//! I define the trait [`RuleSet`], as well as a number of implementations of that trait.
use crate::{Inconsistency, ReasonableGraph, d_entailment::Recognized};

mod _simple;
pub use _simple::Simple;
mod _rdf;
pub use _rdf::Rdf;
mod _rdfs;
pub use _rdfs::Rdfs;

/// A [`RuleSet`] implements a specific entailment regime.
pub trait RuleSet: Sized + Send + Sync {
    /// Prepare the internal structure of `graph` before triples are inserted.
    fn prepare<D: Recognized>(graph: &mut ReasonableGraph<D, Self>);
    /// Saturare `graph` with all inferred triples.
    fn saturate<D: Recognized>(graph: &mut ReasonableGraph<D, Self>) -> Result<(), Inconsistency>;
}