ifc-validate -- Schema and model validation: is this file actually legal IFC?
Split from parsing on purpose. A reader that rejects everything imperfect is useless on real data -- roughly half of production files violate something -- so parsing is permissive and validation is an explicit, separate pass.
What a report means
# use ifc_model::Model;
# fn demo(model: &Model) {
let report = ifc_validate::validate(model, ifc_schema::ifc4());
if report.is_conformant() {
// No *errors*. There may still be warnings, and there are certainly
// rules this validator does not evaluate -- `report.summary()`
// says how many.
}
# }
The three severities are not a mood scale. [Severity::Error] means the
file breaks a schema requirement; [Severity::Warning] means it is legal
but will behave badly; [Severity::Unsupported] is a statement about
this validator, not about the file. Only errors affect
[Report::is_conformant].
What this crate deliberately does not do
It does not evaluate arbitrary EXPRESS WHERE expressions -- there is no
expression evaluator here. Rules that need one are registered as
unsupported and reported, so a clean report never silently means
"unchecked". See [where_rule::RULES].
It does not check aggregate bounds (LIST [3:?]), because the schema
parser retains whether an attribute is an aggregate but not its bounds.
Claiming otherwise would be worse than the gap.
It also does not derive INVERSE relationship semantics. A selected rule
whose IFC2X3 form depends on an inverse is therefore reported unsupported,
even when a later schema revision exposes equivalent direct attributes.
Module map
| Module | Role |
|---|---|
[header] |
Declared schema and implementation level |
[structure] |
References, required slots, cardinality, unique ids |
[type_check] |
Values against their declared EXPRESS types |
[where_rule] |
Native rules, and honest reporting of the rest |
[report] |
Findings, paths, severities, summaries |
[error] |
Why validation could not run |