Skip to main content

Crate snomed_classify

Crate snomed_classify 

Source
Expand description

EL-profile subsumption classifier for SNOMED CT OWL axioms, per spec/13-classification.md.

SNOMED CT’s logic profile is OWL 2 EL, chosen specifically because EL subsumption is decidable in polynomial time via a completion (saturation) algorithm — the same family of algorithm real SNOMED CT reasoners (ELK, CEL) implement. This crate implements that algorithm (Baader/Brandt/Lutz, “Pushing the EL Envelope”, IJCAI 2005, plus the EL+ role-hierarchy/composition extension for property chains and transitive attributes SNOMED CT actually uses) from scratch, in terms of snomed_owl::Axiomsnomed-owl parses syntax, this crate reasons over the result.

classify answers subsumption (“is A a subtype of B, according to these axioms”) — it does not generate RF2 relationship rows or reduce redundant attributes (SNOMED’s “necessary normal form”); see spec/13’s “Not yet implemented” section.

use snomed_core::sctid::SctId;
use snomed_owl::{parse, Axiom};
use snomed_classify::classify;

let axioms: Vec<Axiom> = [
    "SubClassOf(:64572001 :404684003)", // |Disease| ⊑ |Clinical finding|
    "SubClassOf(:22298006 :64572001)",  // |Myocardial infarction| ⊑ |Disease|
]
.iter()
.map(|s| parse(s).unwrap())
.collect();

let report = classify(&axioms);
let mi = SctId::parse("22298006").unwrap();
let finding = SctId::parse("404684003").unwrap();
assert!(report.classification.is_subsumed_by(mi, finding)); // transitively entailed
assert!(report.skipped.is_empty());

Structs§

Classification
The result of classify: every named concept’s entailed named superclasses (transitively closed).
ClassificationReport
classify’s result: the classification, plus every input construct it recognized but couldn’t model (spec/13’s “Scope” section) — reported, never silently dropped without a trace.

Enums§

SkippedConstruct

Functions§

classify
Computes the full entailed subsumption hierarchy over axioms, via the EL completion algorithm (spec/13-classification.md).