Skip to main content

Module subtype

Module subtype 

Source
Expand description

Subtype resolution without loading the EXPRESS schema at runtime.

The tables encode two releases, listed in VERIFIED_SCHEMA_VERSIONS: IFC4 ADD2 TC1, the base (TABLE_SCHEMA_VERSION), and IFC4X3 ADD2 as a delta over it. is_a_in and supertypes_of_in answer for one named release; ask tables_are_verified_for before trusting them for another.

§Why this table exists

EXPRESS SELECT types name abstract supertypes. IfcBooleanOperand permits IfcSolidModel, but no file contains one – files contain IfcExtrudedAreaSolid, four levels below it. Answering “may this entity stand in for that select member” therefore needs the inheritance chain.

ifc-schema can parse the official .exp files and answer exactly this, but requiring it would mean a geometry consumer must ship a 3 MB schema file to interpret a wall. The chains for the geometry-reachable entities are small and change only when the IFC schema does, so they are compiled in as data.

§Why the releases are separate rows, not one merged table

IFC4X3 does not only add entities. It also inserts abstract supertypes above four IFC4 entities: IfcOffsetCurve2D and IfcOffsetCurve3D gain IfcOffsetCurve, IfcFixedReferenceSweptAreaSolid and IfcSurfaceCurveSweptAreaSolid gain IfcDirectrixCurveSweptAreaSolid. One merged chain for those names would be wrong for one release or the other, so the IFC4X3 rows that differ live apart and are used only when a caller names IFC4X3.

The unversioned is_a and supertypes_of answer the IFC4 chain for every entity IFC4 declares, exactly as before IFC4X3 rows existed, and the IFC4X3 chain for entities only IFC4X3 declares. A name IFC4 lacks cannot occur in an IFC4 file, so that fallback changes no IFC4 answer. The only IFC4X3 answers it misses are the inserted abstract supertypes above: no select or rule in this crate asks for them, and is_a_in answers them.

§Keeping it honest

Generated from IFC4.exp and IFC4X3_ADD2.exp. tests/schema_coverage.rs compares every chain, per release, with the same normative sources, so drift fails the build rather than silently misclassifying a solid.

Constants§

TABLE_SCHEMA_VERSION
The base release of the compiled tables.
VERIFIED_SCHEMA_VERSIONS
Every release whose chains the compiled tables carry verbatim.

Functions§

is_a
Is entity the named type, or any subtype of it?
is_a_in
Is entity the named type, or any subtype of it, in version?
known_entities
Every entity this table knows, for cross-checking against the schema.
known_entities_in
Every entity version declares in these tables; empty for a release tables_are_verified_for rejects.
supertypes_of
The supertype chain of an entity, immediate parent first.
supertypes_of_in
The supertype chain of an entity in version, immediate parent first.
tables_are_verified_for
Does is_a_in answer subtype questions for version verbatim?