The inspector does not modify the model. It reports issues for
callers to handle. Provide a DataFormatSchema to enable
schema-specific checks; omit it to run only schema-agnostic
checks.
%%{init:{"theme":"dark"}}%%
flowchart LR
A[DataModel] --> B[inspectDataModel]
C[DataFormatSchema] --> B
B --> D[InspectionReport]
D -. errors .-> E[caller handles report]
%%{init:{"theme":"default"}}%%
flowchart LR
A[DataModel] --> B[inspectDataModel]
C[DataFormatSchema] --> B
B --> D[InspectionReport]
D -. errors .-> E[caller handles report]
flowchart LR
A[DataModel] --> B[inspectDataModel]
C[DataFormatSchema] --> B
B --> D[InspectionReport]
D -. errors .-> E[caller handles report]
Installation
npminstall@xeokit/sdk
Core Types
Issue: one finding with severity, code, message,
optional resource id, and optional context.
IFC_ELEMENT_AGGREGATED_NOT_CONTAINED (warning, opt-in via checkIfcElementContainment); IFC-only
Schema Selection
Each Inspection can declare a list of schema ids. The inspector resolves the model's
schema id from params.schema?.id ?? dataModel.schema and skips
inspections whose schemas list does not include it.
IFC inspections run only for IFC4 / IFC4x3 / IFC4X3 / IFC4x1 / IFC4X1 / IFC4_ADD2_TC1 / IFC2x3 / IFC2X3. Inspections without
schemas run for any model. A model with no schema id runs only
schema-agnostic inspections.
Dangling-reference checks (RELATIONSHIP_DANGLING_*,
OBJECT_DANGLING_PROPERTY_SET_REF) aren't included because
DataModel builder methods reject unknown ids at construction time, so a
live DataModel can't carry dangling endpoints.
DataModel Inspector
Runs inspections on a DataModel and returns a structured InspectionReport.
The inspector does not modify the model. It reports issues for callers to handle. Provide a DataFormatSchema to enable schema-specific checks; omit it to run only schema-agnostic checks.
Shape
Pipeline
Installation
Core Types
context.{codes[], description, run}. Walks a DataModel and returns issues.DataFormatSchema
A DataFormatSchema lists allowed object types, allowed relationship types, inheritance chains, and required or forbidden property sets. Pass one via InspectDataModelParams.schema.
Registries
Inspections are stored in an InspectionRegistry. DEFAULT_INSPECTION_REGISTRY contains the built-in inspections. Plugins can register more inspections:
Tests and one-off pipelines can create a fresh InspectionRegistry and pass it with InspectDataModelParams.registry.
Built-in inspections
OBJECT_MISSING_TYPE(error),OBJECT_DUPLICATE_PROPERTY_SET_REF(warning)OBJECT_UNKNOWN_TYPE(error, when schema supplied)RELATIONSHIP_SELF_REFERENCE(warning)RELATIONSHIP_UNKNOWN_TYPE(error, when schema supplied)OBJECT_REQUIRED_PROPERTY_SET_MISSING/OBJECT_FORBIDDEN_PROPERTY_SET(warnings, when schema supplied)RELATIONSHIP_FORBIDDEN_RELATING_TYPE/RELATIONSHIP_FORBIDDEN_RELATED_TYPE/RELATIONSHIP_SELF_REFERENCE_FORBIDDEN(errors, opt-in viacheckRelationshipTypeBinding)OBJECT_SCHEMA_MISMATCH/RELATIONSHIP_SCHEMA_MISMATCH(warnings, opt-in viacheckSchemaTagging)RELATIONSHIP_CYCLE(error, opt-in viacheckRelationshipCycles)IFC_NO_PROJECT/IFC_MULTIPLE_PROJECTS/IFC_PROJECT_HAS_PARENT/IFC_SPATIAL_PARENT_TYPE_MISMATCH(errors),IFC_SPATIAL_ORPHAN(warning); opt-in viacheckIfcSpatialHierarchy; IFC-onlyIFC_ELEMENT_AGGREGATED_NOT_CONTAINED(warning, opt-in viacheckIfcElementContainment); IFC-onlySchema Selection
Each Inspection can declare a list of schema ids. The inspector resolves the model's schema id from
params.schema?.id ?? dataModel.schemaand skips inspections whoseschemaslist does not include it.IFC inspections run only for
IFC4 / IFC4x3 / IFC4X3 / IFC4x1 / IFC4X1 / IFC4_ADD2_TC1 / IFC2x3 / IFC2X3. Inspections withoutschemasrun for any model. A model with no schema id runs only schema-agnostic inspections.Dangling-reference checks (
RELATIONSHIP_DANGLING_*,OBJECT_DANGLING_PROPERTY_SET_REF) aren't included becauseDataModelbuilder methods reject unknown ids at construction time, so a live DataModel can't carry dangling endpoints.