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