Skip to main content

snomed_classify/
skipped.rs

1//! Constructs `classify` recognizes but doesn't model, per
2//! `spec/13-classification.md`'s "Scope" section. Every occurrence is
3//! reported, never silently dropped without a trace.
4
5use std::fmt;
6
7use snomed_core::sctid::SctId;
8
9#[derive(Debug, Clone, Copy, PartialEq, Eq)]
10pub enum SkippedConstruct {
11    /// A `ReflexiveObjectProperty` axiom — reflexivity isn't modeled.
12    ReflexiveProperty(SctId),
13    /// A `SubDataPropertyOf` axiom — data (concrete-value) property
14    /// hierarchy isn't modeled.
15    DataProperty(SctId),
16    /// A `DataHasValue` conjunct on `attribute`, dropped from whatever
17    /// intersection or existential filler it appeared in.
18    ConcreteValue { attribute: SctId },
19}
20
21impl fmt::Display for SkippedConstruct {
22    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
23        match self {
24            SkippedConstruct::ReflexiveProperty(id) => {
25                write!(f, "ReflexiveObjectProperty(:{id}) is not modeled")
26            }
27            SkippedConstruct::DataProperty(id) => {
28                write!(f, "SubDataPropertyOf involving :{id} is not modeled")
29            }
30            SkippedConstruct::ConcreteValue { attribute } => {
31                write!(
32                    f,
33                    "DataHasValue on attribute :{attribute} was dropped (concrete values aren't classified)"
34                )
35            }
36        }
37    }
38}