1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
//! `ifc-schema` — the IFC schema **as data**, not as 2,500 generated structs.
//!
//! # The decision
//!
//! IfcOpenShell generates a class per IFC entity per schema version. That is a
//! very large amount of code, and it must be regenerated for every schema
//! release. This crate instead reads the normative EXPRESS files into tables
//! and answers questions against them.
//!
//! The evidence that this is the right call: IFC4x3 renames
//! `IfcBuildingElement` to `IfcBuiltElement` and drops `IfcProxy` and the whole
//! `*StandardCase` family. Generated types would fork the entire API surface;
//! a table just holds different rows.
//!
//! # What this crate is for
//!
//! | Module | Role |
//! | --- | --- |
//! | [`version`] | Which schema a file declares |
//! | [`express`] | Parser for the official `.exp` files |
//! | [`entity`] | Entity descriptors: name, supertype, slots |
//! | [`attribute`] | Attribute descriptors and declared types |
//! | [`types`] | Defined types, enumerations, selects |
//! | [`registry`] | The assembled, queryable schema |
//! | `inheritance` | Supertype-chain walking |
//!
//! # Relationship to the model
//!
//! `ifc-model` does **not** depend on this crate.
//! The model stores whatever a file contains, valid or not. The schema is what
//! you consult to *interpret* what was stored, and it is optional: a file whose
//! schema is unknown still parses, and its entities still round-trip.
//!
//! ```
//! use ifc_schema::Schema;
//!
//! let schema = Schema::from_express(
//! "SCHEMA IFC4;\n\
//! ENTITY IfcRoot; GlobalId : IfcGloballyUniqueId; END_ENTITY;\n\
//! ENTITY IfcWall SUBTYPE OF (IfcRoot); Name : IfcLabel; END_ENTITY;\n\
//! END_SCHEMA;",
//! );
//!
//! assert!(schema.is_a("IFCWALL", "IfcRoot"));
//! assert_eq!(schema.attribute_names("IfcWall"), ["GlobalId", "Name"]);
//! ```
pub use decode_schema as artifact_decode_schema;
pub use encode_schema as artifact_encode_schema;
pub use Attribute;
pub use ;
pub use EntityDef;
pub use ;
pub use Schema;
pub use ;
pub use SchemaVersion;