shapes_converter/shacl_to_shex/
shacl2shex_config.rs1use serde::{Deserialize, Serialize};
2use shacl_validation::shacl_config::ShaclConfig;
3
4#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, Default)]
6pub struct Shacl2ShExConfig {
7 pub starting_shapes_mode: Option<StartShapeMode>,
9
10 pub embed_bnodes: Option<bool>,
12
13 pub shacl: Option<ShaclConfig>,
15
16 pub add_target_class: Option<bool>,
18}
19
20impl Shacl2ShExConfig {
21 pub fn starting_shapes_mode(&self) -> StartShapeMode {
22 match &self.starting_shapes_mode {
23 None => StartShapeMode::default(),
24 Some(sm) => sm.clone(),
25 }
26 }
27
28 pub fn add_target_class(&self) -> bool {
29 match &self.add_target_class {
30 None => true,
31 Some(atc) => *atc,
32 }
33 }
34}
35
36#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, Default)]
37pub enum StartShapeMode {
38 #[default]
40 NonBNodes,
41}