1#![doc = include_str!("../README.md")]
2
3use datalog_structural_model::Program;
4use rdf_reasoning::{Exclusion, Preset, PresetParseError};
5use serde::Serialize;
6
7mod cooperative;
8pub mod entailment;
9pub mod reasoning;
10pub mod shacl12;
11
12#[derive(Debug, Serialize)]
16pub struct CompiledProfile {
17 pub preset: Preset,
19 pub program: Program,
21 pub exclusions: &'static [Exclusion],
23}
24
25impl CompiledProfile {
26 #[must_use]
28 pub fn new(preset: Preset) -> Self {
29 Self {
30 preset,
31 program: preset.program(),
32 exclusions: preset.exclusions(),
33 }
34 }
35}
36
37pub fn compile_profile(selector: &str) -> Result<CompiledProfile, PresetParseError> {
42 selector.parse().map(CompiledProfile::new)
43}
44
45pub fn profiles() -> impl ExactSizeIterator<Item = &'static str> {
47 Preset::ALL.iter().map(|preset| preset.name())
48}