#![doc = include_str!("../README.md")]
use datalog_structural_model::Program;
use rdf_reasoning::{Exclusion, Preset, PresetParseError};
use serde::Serialize;
mod cooperative;
pub mod entailment;
pub mod reasoning;
pub mod shacl12;
#[derive(Debug, Serialize)]
pub struct CompiledProfile {
pub preset: Preset,
pub program: Program,
pub exclusions: &'static [Exclusion],
}
impl CompiledProfile {
#[must_use]
pub fn new(preset: Preset) -> Self {
Self {
preset,
program: preset.program(),
exclusions: preset.exclusions(),
}
}
}
pub fn compile_profile(selector: &str) -> Result<CompiledProfile, PresetParseError> {
selector.parse().map(CompiledProfile::new)
}
pub fn profiles() -> impl ExactSizeIterator<Item = &'static str> {
Preset::ALL.iter().map(|preset| preset.name())
}