@ifc-lite/parser 7.1.0 → 8.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/attribute-helpers.d.ts +23 -5
- package/dist/attribute-helpers.d.ts.map +1 -1
- package/dist/attribute-helpers.js +74 -13
- package/dist/attribute-helpers.js.map +1 -1
- package/dist/classification-resolver.d.ts.map +1 -1
- package/dist/classification-resolver.js +42 -6
- package/dist/classification-resolver.js.map +1 -1
- package/dist/columnar-parser-attributes.d.ts +1 -1
- package/dist/columnar-parser-attributes.d.ts.map +1 -1
- package/dist/columnar-parser-attributes.js +36 -1
- package/dist/columnar-parser-attributes.js.map +1 -1
- package/dist/columnar-parser-indexes.d.ts.map +1 -1
- package/dist/columnar-parser-indexes.js +24 -1
- package/dist/columnar-parser-indexes.js.map +1 -1
- package/dist/columnar-parser-relationships.d.ts +2 -1
- package/dist/columnar-parser-relationships.d.ts.map +1 -1
- package/dist/columnar-parser-relationships.js +2 -2
- package/dist/columnar-parser-relationships.js.map +1 -1
- package/dist/columnar-parser-root-attributes.d.ts.map +1 -1
- package/dist/columnar-parser-root-attributes.js +3 -0
- package/dist/columnar-parser-root-attributes.js.map +1 -1
- package/dist/columnar-parser.d.ts +4 -11
- package/dist/columnar-parser.d.ts.map +1 -1
- package/dist/columnar-parser.js +24 -11
- package/dist/columnar-parser.js.map +1 -1
- package/dist/cost-extractor.js +2 -2
- package/dist/cost-extractor.js.map +1 -1
- package/dist/cost-overlay.d.ts +34 -2
- package/dist/cost-overlay.d.ts.map +1 -1
- package/dist/cost-reader.d.ts +10 -0
- package/dist/cost-reader.d.ts.map +1 -1
- package/dist/cost-reader.js +82 -17
- package/dist/cost-reader.js.map +1 -1
- package/dist/cost.d.ts +1 -1
- package/dist/cost.d.ts.map +1 -1
- package/dist/data-store-transport.d.ts.map +1 -1
- package/dist/data-store-transport.js +8 -0
- package/dist/data-store-transport.js.map +1 -1
- package/dist/effective-entity-record.d.ts +35 -0
- package/dist/effective-entity-record.d.ts.map +1 -0
- package/dist/effective-entity-record.js +43 -0
- package/dist/effective-entity-record.js.map +1 -0
- package/dist/effective-relationship-overlay.d.ts +31 -0
- package/dist/effective-relationship-overlay.d.ts.map +1 -0
- package/dist/effective-relationship-overlay.js +111 -0
- package/dist/effective-relationship-overlay.js.map +1 -0
- package/dist/entity-extractor.d.ts.map +1 -1
- package/dist/entity-extractor.js +33 -15
- package/dist/entity-extractor.js.map +1 -1
- package/dist/exact-relationship-edges.d.ts +46 -0
- package/dist/exact-relationship-edges.d.ts.map +1 -0
- package/dist/exact-relationship-edges.js +89 -0
- package/dist/exact-relationship-edges.js.map +1 -0
- package/dist/identity-hints.d.ts +32 -0
- package/dist/identity-hints.d.ts.map +1 -0
- package/dist/identity-hints.js +131 -0
- package/dist/identity-hints.js.map +1 -0
- package/dist/ifc-schema.d.ts +9 -0
- package/dist/ifc-schema.d.ts.map +1 -1
- package/dist/ifc-schema.js +37 -2
- package/dist/ifc-schema.js.map +1 -1
- package/dist/index.d.ts +6 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -4
- package/dist/index.js.map +1 -1
- package/dist/material-resolver.d.ts +3 -0
- package/dist/material-resolver.d.ts.map +1 -1
- package/dist/material-resolver.js +6 -2
- package/dist/material-resolver.js.map +1 -1
- package/dist/on-demand-extractors.d.ts +11 -37
- package/dist/on-demand-extractors.d.ts.map +1 -1
- package/dist/on-demand-extractors.js +13 -5
- package/dist/on-demand-extractors.js.map +1 -1
- package/dist/parser.worker.d.ts.map +1 -1
- package/dist/parser.worker.js +3 -1
- package/dist/parser.worker.js.map +1 -1
- package/dist/project-units.d.ts.map +1 -1
- package/dist/project-units.js +7 -0
- package/dist/project-units.js.map +1 -1
- package/dist/property-unit.d.ts.map +1 -1
- package/dist/property-unit.js +1 -0
- package/dist/property-unit.js.map +1 -1
- package/dist/property-value-parser.d.ts +14 -18
- package/dist/property-value-parser.d.ts.map +1 -1
- package/dist/property-value-parser.js +26 -11
- package/dist/property-value-parser.js.map +1 -1
- package/dist/quantity-collect.d.ts +2 -0
- package/dist/quantity-collect.d.ts.map +1 -1
- package/dist/quantity-collect.js +2 -1
- package/dist/quantity-collect.js.map +1 -1
- package/dist/quantity-extractor.d.ts.map +1 -1
- package/dist/quantity-extractor.js +7 -5
- package/dist/quantity-extractor.js.map +1 -1
- package/dist/query-backend-maps.d.ts +5 -8
- package/dist/query-backend-maps.d.ts.map +1 -1
- package/dist/query-backend-maps.js +8 -15
- package/dist/query-backend-maps.js.map +1 -1
- package/dist/relationship-extractor.d.ts.map +1 -1
- package/dist/relationship-extractor.js +6 -4
- package/dist/relationship-extractor.js.map +1 -1
- package/dist/relationship-schema-slots.d.ts +8 -8
- package/dist/relationship-schema-slots.d.ts.map +1 -1
- package/dist/relationship-schema-slots.js +31 -18
- package/dist/relationship-schema-slots.js.map +1 -1
- package/dist/schedule-calendar-types.d.ts +2 -3
- package/dist/schedule-calendar-types.d.ts.map +1 -1
- package/dist/schedule-calendar-types.js +12 -24
- package/dist/schedule-calendar-types.js.map +1 -1
- package/dist/schedule-control-extractor.d.ts +3 -4
- package/dist/schedule-control-extractor.d.ts.map +1 -1
- package/dist/schedule-control-extractor.js +4 -7
- package/dist/schedule-control-extractor.js.map +1 -1
- package/dist/schedule-extractor.d.ts +4 -1
- package/dist/schedule-extractor.d.ts.map +1 -1
- package/dist/schedule-extractor.js +26 -43
- package/dist/schedule-extractor.js.map +1 -1
- package/dist/schedule-types.d.ts +3 -4
- package/dist/schedule-types.d.ts.map +1 -1
- package/dist/schedule-types.js +4 -10
- package/dist/schedule-types.js.map +1 -1
- package/dist/spatial-hierarchy-attributes.d.ts.map +1 -1
- package/dist/spatial-hierarchy-attributes.js +3 -0
- package/dist/spatial-hierarchy-attributes.js.map +1 -1
- package/dist/spatial-hierarchy-builder.d.ts.map +1 -1
- package/dist/spatial-hierarchy-builder.js +1 -0
- package/dist/spatial-hierarchy-builder.js.map +1 -1
- package/dist/structural-load-extractor.d.ts.map +1 -1
- package/dist/structural-load-extractor.js +2 -0
- package/dist/structural-load-extractor.js.map +1 -1
- package/dist/structural-step-values.d.ts.map +1 -1
- package/dist/structural-step-values.js +1 -0
- package/dist/structural-step-values.js.map +1 -1
- package/dist/unit-extractor.d.ts.map +1 -1
- package/dist/unit-extractor.js +6 -0
- package/dist/unit-extractor.js.map +1 -1
- package/dist/worker-index-publication.d.ts.map +1 -1
- package/dist/worker-index-publication.js +7 -0
- package/dist/worker-index-publication.js.map +1 -1
- package/package.json +6 -6
package/dist/entity-extractor.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
/**
|
|
5
5
|
* Entity extractor - parses full entity content from STEP format
|
|
6
6
|
*/
|
|
7
|
-
import { createLogger } from '@ifc-lite/data';
|
|
7
|
+
import { createLogger, isCompleteStepNumericLiteral } from '@ifc-lite/data';
|
|
8
8
|
import { decodeIfcString } from '@ifc-lite/encoding';
|
|
9
9
|
import { isIndexableExpressId } from './express-id.js';
|
|
10
10
|
import { entityParameters } from './step-entity-parameters.js';
|
|
@@ -320,17 +320,29 @@ export class EntityExtractor {
|
|
|
320
320
|
//
|
|
321
321
|
// Number.isFinite, not !isNaN: a STEP real whose exponent overflows the
|
|
322
322
|
// IEEE-754 double range (`1.0E400`) parses to `Infinity`, and
|
|
323
|
-
// `isNaN(Infinity)` is `false`, so
|
|
324
|
-
// property table a non-finite number reaches every writer,
|
|
325
|
-
// `JSON.stringify(Infinity)` is `null` — the file loses the value
|
|
326
|
-
// diagnostic anywhere along the way.
|
|
323
|
+
// `isNaN(Infinity)` is `false`, so a guard of only `!isNaN` would admit
|
|
324
|
+
// it. From the property table a non-finite number reaches every writer,
|
|
325
|
+
// where `JSON.stringify(Infinity)` is `null` — the file loses the value
|
|
326
|
+
// with no diagnostic anywhere along the way.
|
|
327
|
+
//
|
|
328
|
+
// `isCompleteStepNumericLiteral`, not just `parseFloat`: `parseFloat`
|
|
329
|
+
// accepts any leading numeric prefix and silently discards the rest, so a
|
|
330
|
+
// corrupted literal with a dropped comma between two reals — `1.52.3` —
|
|
331
|
+
// parses as `1.52` with no error, and `1.5abc` parses as `1.5`. The
|
|
332
|
+
// overflow guard above catches a token that is a complete, valid literal
|
|
333
|
+
// naming an unrepresentable number; it says nothing about a token that
|
|
334
|
+
// was never a complete literal to begin with. Requiring the STEP
|
|
335
|
+
// REAL/INTEGER grammar match cover the *whole* token, not just yield a
|
|
336
|
+
// finite prefix, closes that second hole without disturbing the first.
|
|
327
337
|
//
|
|
328
338
|
// Falling through preserves the literal as the raw token (the branch
|
|
329
339
|
// below), which is what this function already does for every other token
|
|
330
340
|
// it cannot represent as a number. That keeps the data the file actually
|
|
331
|
-
// contained — a reader can still see `1.0E400`. Rejecting the
|
|
332
|
-
// outright would drop data the file did contain; clamping would
|
|
333
|
-
// value.
|
|
341
|
+
// contained — a reader can still see `1.0E400` or `1.52.3`. Rejecting the
|
|
342
|
+
// attribute outright would drop data the file did contain; clamping would
|
|
343
|
+
// invent a value; truncating to the parseable prefix (`1.52.3` -> `1.52`)
|
|
344
|
+
// would invent a DIFFERENT value indistinguishable downstream from a real
|
|
345
|
+
// one — the exact failure this branch exists to avoid.
|
|
334
346
|
//
|
|
335
347
|
// This is NOT by itself enough to say "nothing is silently dropped".
|
|
336
348
|
// Preserving the string only helps consumers whose value type admits a
|
|
@@ -340,14 +352,20 @@ export class EntityExtractor {
|
|
|
340
352
|
// which is how `quantity-collect` and `georef-extractor` turned an
|
|
341
353
|
// unreadable value into a plausible `0`. Absence is detectable; a zero
|
|
342
354
|
// easting is a coordinate. Both now refuse and warn instead of
|
|
343
|
-
// substituting — see `isOverflowingNumericLiteral`
|
|
344
|
-
// `attribute-helpers.ts
|
|
345
|
-
//
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
355
|
+
// substituting — see `isOverflowingNumericLiteral` and
|
|
356
|
+
// `isMalformedNumericLiteral` in `attribute-helpers.ts`, combined in
|
|
357
|
+
// `isUnrepresentableNumericValue`, and its call sites. Any NEW
|
|
358
|
+
// `number`-typed consumer of this function's output owes the same
|
|
359
|
+
// decision, for BOTH hazards this comment now describes, not just the
|
|
360
|
+
// overflow one it used to describe alone.
|
|
361
|
+
if (isCompleteStepNumericLiteral(value)) {
|
|
362
|
+
const num = parseFloat(value);
|
|
363
|
+
if (Number.isFinite(num)) {
|
|
364
|
+
return num;
|
|
365
|
+
}
|
|
349
366
|
}
|
|
350
|
-
// Enumeration, non-finite numeric literal,
|
|
367
|
+
// Enumeration, non-finite numeric literal, malformed numeric literal, or
|
|
368
|
+
// other identifier: the raw token.
|
|
351
369
|
return value;
|
|
352
370
|
}
|
|
353
371
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entity-extractor.js","sourceRoot":"","sources":["../src/entity-extractor.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D;;GAEG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"entity-extractor.js","sourceRoot":"","sources":["../src/entity-extractor.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D;;GAEG;AAEH,OAAO,EAAE,YAAY,EAAE,4BAA4B,EAAE,MAAM,gBAAgB,CAAC;AAC5E,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,OAAO,EAAE,aAAa,EAAuB,MAAM,mBAAmB,CAAC;AAIvE,MAAM,GAAG,GAAG,YAAY,CAAC,iBAAiB,CAAC,CAAC;AAE5C,kGAAkG;AAClG,MAAM,eAAe,GAAG,GAAG,CAAC;AAE5B;;;;;GAKG;AACH,MAAM,gBAAgB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DAAuD;QACvD,EAAE;QACF,qEAAqE;QACrE,uEAAuE;QACvE,uEAAuE;QACvE,mEAAmE;QACnE,0EAA0E;QAC1E,mEAAmE;QACnE,uEAAuE;QACvE,+DAA+D;QAC/D,uDAAuD;QACvD,qEAAqE;QACrE,+DAA+D;QAC/D,kEAAkE;QAClE,sEAAsE;QACtE,0CAA0C;QAC1C,IAAI,4BAA4B,CAAC,KAAK,CAAC,EAAE,CAAC;YACxC,MAAM,GAAG,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC;YAC9B,IAAI,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;gBACzB,OAAO,GAAG,CAAC;YACb,CAAC;QACH,CAAC;QAED,yEAAyE;QACzE,mCAAmC;QACnC,OAAO,KAAK,CAAC;IACf,CAAC;CACF"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { IfcDataStore } from './columnar-parser.js';
|
|
2
|
+
/** One exact-class edge touching an entity (#4205). */
|
|
3
|
+
export interface ExactRelationshipEdge {
|
|
4
|
+
relationshipId: number;
|
|
5
|
+
relationshipType: string;
|
|
6
|
+
direction: 'forward' | 'inverse';
|
|
7
|
+
entity: {
|
|
8
|
+
id: number;
|
|
9
|
+
name?: string;
|
|
10
|
+
type: string;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
/** Structured relationship information for one entity. */
|
|
14
|
+
export interface EntityRelationships {
|
|
15
|
+
voids: Array<{
|
|
16
|
+
id: number;
|
|
17
|
+
name?: string;
|
|
18
|
+
type: string;
|
|
19
|
+
}>;
|
|
20
|
+
fills: Array<{
|
|
21
|
+
id: number;
|
|
22
|
+
name?: string;
|
|
23
|
+
type: string;
|
|
24
|
+
}>;
|
|
25
|
+
groups: Array<{
|
|
26
|
+
id: number;
|
|
27
|
+
name?: string;
|
|
28
|
+
type: string;
|
|
29
|
+
}>;
|
|
30
|
+
connections: Array<{
|
|
31
|
+
id: number;
|
|
32
|
+
name?: string;
|
|
33
|
+
type: string;
|
|
34
|
+
}>;
|
|
35
|
+
/** Optional for consumers/backends compiled against the pre-#4205 shape. */
|
|
36
|
+
relations?: ExactRelationshipEdge[];
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Return every graph edge touching `entityId`, preserving the exact IfcRel*
|
|
40
|
+
* STEP class. Compatibility aliases such as IfcRelNests occupy two enum
|
|
41
|
+
* buckets, so the result is deduplicated by relationship record and target.
|
|
42
|
+
*/
|
|
43
|
+
export declare function extractExactRelationshipEdges(store: IfcDataStore, entityId: number): ExactRelationshipEdge[];
|
|
44
|
+
/** Return unique opposite-end ids for one exact EXPRESS relationship class. */
|
|
45
|
+
export declare function extractExactRelatedIds(store: IfcDataStore, entityId: number, relationshipType: string, direction: 'forward' | 'inverse', isDeletedRelationship?: (relationshipId: number) => boolean): number[];
|
|
46
|
+
//# sourceMappingURL=exact-relationship-edges.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exact-relationship-edges.d.ts","sourceRoot":"","sources":["../src/exact-relationship-edges.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAGzD,uDAAuD;AACvD,MAAM,WAAW,qBAAqB;IAClC,cAAc,EAAE,MAAM,CAAC;IACvB,gBAAgB,EAAE,MAAM,CAAC;IACzB,SAAS,EAAE,SAAS,GAAG,SAAS,CAAC;IACjC,MAAM,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;CACvD;AAED,0DAA0D;AAC1D,MAAM,WAAW,mBAAmB;IAChC,KAAK,EAAE,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC1D,KAAK,EAAE,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC1D,MAAM,EAAE,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC3D,WAAW,EAAE,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAChE,4EAA4E;IAC5E,SAAS,CAAC,EAAE,qBAAqB,EAAE,CAAC;CACvC;AAED;;;;GAIG;AACH,wBAAgB,6BAA6B,CACzC,KAAK,EAAE,YAAY,EACnB,QAAQ,EAAE,MAAM,GACjB,qBAAqB,EAAE,CA6DzB;AAED,+EAA+E;AAC/E,wBAAgB,sBAAsB,CAClC,KAAK,EAAE,YAAY,EACnB,QAAQ,EAAE,MAAM,EAChB,gBAAgB,EAAE,MAAM,EACxB,SAAS,EAAE,SAAS,GAAG,SAAS,EAChC,qBAAqB,GAAE,CAAC,cAAc,EAAE,MAAM,KAAK,OAAqB,GACzE,MAAM,EAAE,CAUV"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
2
|
+
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
3
|
+
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
|
4
|
+
import { exactTypeName, RelationshipType, relationshipTypeName, resolvedTypeName } from '@ifc-lite/data';
|
|
5
|
+
import { normalizeIfcTypeName } from './ifc-schema.js';
|
|
6
|
+
/**
|
|
7
|
+
* Return every graph edge touching `entityId`, preserving the exact IfcRel*
|
|
8
|
+
* STEP class. Compatibility aliases such as IfcRelNests occupy two enum
|
|
9
|
+
* buckets, so the result is deduplicated by relationship record and target.
|
|
10
|
+
*/
|
|
11
|
+
export function extractExactRelationshipEdges(store, entityId) {
|
|
12
|
+
const result = [];
|
|
13
|
+
const seen = new Set();
|
|
14
|
+
const entityInfo = (id) => {
|
|
15
|
+
// @raw-entity-enumeration-ok graph edge already chose this target; the source index only supplies its exact STEP class fallback
|
|
16
|
+
const ref = store.entityIndex.byId.get(id);
|
|
17
|
+
const exactType = exactTypeName(store.entities, id);
|
|
18
|
+
const type = (exactType !== 'Unknown' ? exactType : undefined)
|
|
19
|
+
?? resolvedTypeName(store.entities, id)
|
|
20
|
+
?? (ref ? normalizeIfcTypeName(ref.type) : undefined)
|
|
21
|
+
?? 'Unknown';
|
|
22
|
+
const name = store.entities.getName(id);
|
|
23
|
+
return { id, name: name || undefined, type };
|
|
24
|
+
};
|
|
25
|
+
const append = (direction) => {
|
|
26
|
+
const edges = direction === 'forward' ? store.relationships.forward : store.relationships.inverse;
|
|
27
|
+
const touchingEdges = edges.getEdges(entityId);
|
|
28
|
+
// Compatibility pairs occupy both a broad traversal bucket and an
|
|
29
|
+
// exact bucket. Reserve each broad record represented by an exact
|
|
30
|
+
// bucket before deduplicating by record id. This also covers server
|
|
31
|
+
// payloads whose entity table omits the IfcRel* row, where the graph
|
|
32
|
+
// buckets are the only source of the exact class.
|
|
33
|
+
const aliasRecords = new Map();
|
|
34
|
+
for (const edge of touchingEdges) {
|
|
35
|
+
const primaryType = edge.type === RelationshipType.Nests
|
|
36
|
+
? RelationshipType.Aggregates
|
|
37
|
+
: edge.type === RelationshipType.AssignsToGroupByFactor
|
|
38
|
+
? RelationshipType.AssignsToGroup
|
|
39
|
+
: undefined;
|
|
40
|
+
if (primaryType === undefined)
|
|
41
|
+
continue;
|
|
42
|
+
for (const relationshipId of [edge.relationshipId, ...(edge.shadowedRelationshipIds ?? [])]) {
|
|
43
|
+
const key = `${edge.target}:${primaryType}:${relationshipId}`;
|
|
44
|
+
aliasRecords.set(key, (aliasRecords.get(key) ?? 0) + 1);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
for (const edge of touchingEdges) {
|
|
48
|
+
for (const relationshipId of [edge.relationshipId, ...(edge.shadowedRelationshipIds ?? [])]) {
|
|
49
|
+
const aliasKey = `${edge.target}:${edge.type}:${relationshipId}`;
|
|
50
|
+
const aliasesRemaining = aliasRecords.get(aliasKey) ?? 0;
|
|
51
|
+
if (aliasesRemaining > 0) {
|
|
52
|
+
aliasRecords.set(aliasKey, aliasesRemaining - 1);
|
|
53
|
+
continue;
|
|
54
|
+
}
|
|
55
|
+
if (relationshipId !== 0) {
|
|
56
|
+
const key = `${direction}:${relationshipId}:${edge.target}`;
|
|
57
|
+
if (seen.has(key))
|
|
58
|
+
continue;
|
|
59
|
+
seen.add(key);
|
|
60
|
+
}
|
|
61
|
+
result.push({
|
|
62
|
+
relationshipId,
|
|
63
|
+
relationshipType: resolvedTypeName(store.entities, relationshipId)
|
|
64
|
+
?? relationshipTypeName(edge.type),
|
|
65
|
+
direction,
|
|
66
|
+
entity: entityInfo(edge.target),
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
append('forward');
|
|
72
|
+
append('inverse');
|
|
73
|
+
return result;
|
|
74
|
+
}
|
|
75
|
+
/** Return unique opposite-end ids for one exact EXPRESS relationship class. */
|
|
76
|
+
export function extractExactRelatedIds(store, entityId, relationshipType, direction, isDeletedRelationship = () => false) {
|
|
77
|
+
const result = [];
|
|
78
|
+
const seen = new Set();
|
|
79
|
+
for (const edge of extractExactRelationshipEdges(store, entityId)) {
|
|
80
|
+
if (edge.direction !== direction || edge.relationshipType !== relationshipType)
|
|
81
|
+
continue;
|
|
82
|
+
if (isDeletedRelationship(edge.relationshipId) || seen.has(edge.entity.id))
|
|
83
|
+
continue;
|
|
84
|
+
seen.add(edge.entity.id);
|
|
85
|
+
result.push(edge.entity.id);
|
|
86
|
+
}
|
|
87
|
+
return result;
|
|
88
|
+
}
|
|
89
|
+
//# sourceMappingURL=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E,CAAC;QAChE,IAAI,IAAI,CAAC,SAAS,KAAK,SAAS,IAAI,IAAI,CAAC,gBAAgB,KAAK,gBAAgB;YAAE,SAAS;QACzF,IAAI,qBAAqB,CAAC,IAAI,CAAC,cAAc,CAAC,IAAI,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;YAAE,SAAS;QACrF,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QACzB,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IAChC,CAAC;IACD,OAAO,MAAM,CAAC;AAClB,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { type IfcDataStore } from './columnar-parser.js';
|
|
2
|
+
import { EntityExtractor } from './entity-extractor.js';
|
|
3
|
+
/**
|
|
4
|
+
* The name path of the nearest spatial container of an element (`Project/
|
|
5
|
+
* Building/Level 2/Room 204`), or `undefined` when the element is not
|
|
6
|
+
* contained anywhere the hierarchy knows about. Prefers the finest container
|
|
7
|
+
* (`elementToContainer`: a space or zone) over the storey.
|
|
8
|
+
*
|
|
9
|
+
* An unnamed node contributes its `LongName`, else its IFC class name, so the
|
|
10
|
+
* path stays stable across exports. Names are trimmed so trailing whitespace
|
|
11
|
+
* an authoring tool leaves behind does not split one storey into two.
|
|
12
|
+
*/
|
|
13
|
+
export declare function spatialContainerPath(store: IfcDataStore, expressId: number): string | undefined;
|
|
14
|
+
/** How an authored key is spelled: `Tag`, or `<PsetName>.<PropertyName>`. */
|
|
15
|
+
export interface AuthoredKeySpec {
|
|
16
|
+
kind: 'tag' | 'property';
|
|
17
|
+
pset?: string;
|
|
18
|
+
property?: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Parse a `--key-from` style spec. `Tag` (case-insensitive) reads the IfcElement
|
|
22
|
+
* `Tag` attribute; anything containing a dot is `Pset.Property`. Returns
|
|
23
|
+
* `undefined` for a spec that names neither.
|
|
24
|
+
*/
|
|
25
|
+
export declare function parseAuthoredKeySpec(spec: string): AuthoredKeySpec | undefined;
|
|
26
|
+
/**
|
|
27
|
+
* The authored key of one entity under a spec, or `undefined` when the entity
|
|
28
|
+
* carries none (empty and whitespace-only values count as none — an empty
|
|
29
|
+
* `Tag` is the schema's default, not an identity).
|
|
30
|
+
*/
|
|
31
|
+
export declare function authoredKeyValue(store: IfcDataStore, expressId: number, spec: AuthoredKeySpec, extractor?: EntityExtractor): string | undefined;
|
|
32
|
+
//# sourceMappingURL=identity-hints.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"identity-hints.d.ts","sourceRoot":"","sources":["../src/identity-hints.ts"],"names":[],"mappings":"AAoBA,OAAO,EAA6B,KAAK,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpF,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AA6CxD;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAO/F;AAED,6EAA6E;AAC7E,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,KAAK,GAAG,UAAU,CAAC;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,eAAe,GAAG,SAAS,CAM9E;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,YAAY,EACnB,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,eAAe,EACrB,SAAS,GAAE,eAAmD,GAC7D,MAAM,GAAG,SAAS,CAsBpB"}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
2
|
+
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
3
|
+
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
|
4
|
+
/**
|
|
5
|
+
* Two store queries every diff adapter (CLI, MCP, viewer) needs identically
|
|
6
|
+
* (issue #4955), kept here so three copies cannot drift:
|
|
7
|
+
*
|
|
8
|
+
* - {@link spatialContainerPath}: WHERE an element sits, as a stable NAME
|
|
9
|
+
* path from the project down to its nearest spatial container. Names, never
|
|
10
|
+
* GlobalIds — a from-scratch re-export re-GUIDs the storeys too.
|
|
11
|
+
* - {@link authoredKeyValue}: an AUTHORED identifier the model maintains on
|
|
12
|
+
* purpose (`Tag`, or a property such as `Pset_Asset.AssetId`), which a
|
|
13
|
+
* downstream party may prefer over GlobalId as the cross-revision key.
|
|
14
|
+
*
|
|
15
|
+
* Neither knows anything about diffing. They answer "where is this" and
|
|
16
|
+
* "what does this property say", which is what a parser is for.
|
|
17
|
+
*/
|
|
18
|
+
import { IfcTypeEnumToString } from '@ifc-lite/data';
|
|
19
|
+
import { extractPropertiesOnDemand } from './columnar-parser.js';
|
|
20
|
+
import { EntityExtractor } from './entity-extractor.js';
|
|
21
|
+
import { getAttributeNamesAcrossSchemas } from './ifc-schema.js';
|
|
22
|
+
/** Per-hierarchy cache of node id → full name path, built on first use. */
|
|
23
|
+
const PATH_CACHE = new WeakMap();
|
|
24
|
+
/**
|
|
25
|
+
* A node's label in the path: its trimmed `Name`, else its `LongName`, else
|
|
26
|
+
* its IFC class (`IfcBuilding`). Never the express id — that is reassigned on
|
|
27
|
+
* every export, and Duplex's unnamed IfcBuilding put a `#36` into every path
|
|
28
|
+
* so no two revisions ever agreed (issue #4955, xmatch finding F4). A class
|
|
29
|
+
* label is coarse but stable, and two unnamed buildings under one site are
|
|
30
|
+
* rare enough to accept the tie.
|
|
31
|
+
*/
|
|
32
|
+
function nodeLabel(node) {
|
|
33
|
+
const name = node.name.trim();
|
|
34
|
+
if (name.length > 0)
|
|
35
|
+
return name;
|
|
36
|
+
const longName = node.longName?.trim() ?? '';
|
|
37
|
+
if (longName.length > 0)
|
|
38
|
+
return longName;
|
|
39
|
+
return IfcTypeEnumToString(node.type);
|
|
40
|
+
}
|
|
41
|
+
function pathsOf(hierarchy) {
|
|
42
|
+
const cached = PATH_CACHE.get(hierarchy);
|
|
43
|
+
if (cached)
|
|
44
|
+
return cached;
|
|
45
|
+
const paths = new Map();
|
|
46
|
+
// An explicit worklist rather than recursion: the hierarchy is file-supplied
|
|
47
|
+
// (or transported from a worker), so a very deep chain must not exhaust the
|
|
48
|
+
// stack and a cycle must not spin. First visit wins, which also means the
|
|
49
|
+
// first-declared parent names the path for a node reachable twice.
|
|
50
|
+
const stack = [{ node: hierarchy.project, prefix: '' }];
|
|
51
|
+
while (stack.length > 0) {
|
|
52
|
+
const { node, prefix } = stack.pop();
|
|
53
|
+
if (paths.has(node.expressId))
|
|
54
|
+
continue;
|
|
55
|
+
const path = prefix ? `${prefix}/${nodeLabel(node)}` : nodeLabel(node);
|
|
56
|
+
paths.set(node.expressId, path);
|
|
57
|
+
for (let i = node.children.length - 1; i >= 0; i--) {
|
|
58
|
+
const child = node.children[i];
|
|
59
|
+
if (!paths.has(child.expressId))
|
|
60
|
+
stack.push({ node: child, prefix: path });
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
PATH_CACHE.set(hierarchy, paths);
|
|
64
|
+
return paths;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* The name path of the nearest spatial container of an element (`Project/
|
|
68
|
+
* Building/Level 2/Room 204`), or `undefined` when the element is not
|
|
69
|
+
* contained anywhere the hierarchy knows about. Prefers the finest container
|
|
70
|
+
* (`elementToContainer`: a space or zone) over the storey.
|
|
71
|
+
*
|
|
72
|
+
* An unnamed node contributes its `LongName`, else its IFC class name, so the
|
|
73
|
+
* path stays stable across exports. Names are trimmed so trailing whitespace
|
|
74
|
+
* an authoring tool leaves behind does not split one storey into two.
|
|
75
|
+
*/
|
|
76
|
+
export function spatialContainerPath(store, expressId) {
|
|
77
|
+
const hierarchy = store.spatialHierarchy;
|
|
78
|
+
if (!hierarchy)
|
|
79
|
+
return undefined;
|
|
80
|
+
const container = hierarchy.elementToContainer?.get(expressId) ?? hierarchy.elementToStorey.get(expressId);
|
|
81
|
+
if (container === undefined)
|
|
82
|
+
return undefined;
|
|
83
|
+
return pathsOf(hierarchy).get(container);
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Parse a `--key-from` style spec. `Tag` (case-insensitive) reads the IfcElement
|
|
87
|
+
* `Tag` attribute; anything containing a dot is `Pset.Property`. Returns
|
|
88
|
+
* `undefined` for a spec that names neither.
|
|
89
|
+
*/
|
|
90
|
+
export function parseAuthoredKeySpec(spec) {
|
|
91
|
+
const trimmed = spec.trim();
|
|
92
|
+
if (trimmed.toLowerCase() === 'tag')
|
|
93
|
+
return { kind: 'tag' };
|
|
94
|
+
const dot = trimmed.indexOf('.');
|
|
95
|
+
if (dot <= 0 || dot === trimmed.length - 1)
|
|
96
|
+
return undefined;
|
|
97
|
+
return { kind: 'property', pset: trimmed.slice(0, dot), property: trimmed.slice(dot + 1) };
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* The authored key of one entity under a spec, or `undefined` when the entity
|
|
101
|
+
* carries none (empty and whitespace-only values count as none — an empty
|
|
102
|
+
* `Tag` is the schema's default, not an identity).
|
|
103
|
+
*/
|
|
104
|
+
export function authoredKeyValue(store, expressId, spec, extractor = new EntityExtractor(store.source)) {
|
|
105
|
+
let raw;
|
|
106
|
+
if (spec.kind === 'tag') {
|
|
107
|
+
const ifcType = store.entities.getTypeName(expressId);
|
|
108
|
+
const index = getAttributeNamesAcrossSchemas(ifcType).indexOf('Tag');
|
|
109
|
+
// @raw-entity-enumeration-ok authored-key lookup reads the specified entity's source Tag slot, not an entity set
|
|
110
|
+
const ref = store.entityIndex.byId.get(expressId);
|
|
111
|
+
if (index < 0 || !ref)
|
|
112
|
+
return undefined;
|
|
113
|
+
raw = extractor.extractEntity(ref)?.attributes?.[index];
|
|
114
|
+
}
|
|
115
|
+
else {
|
|
116
|
+
for (const set of extractPropertiesOnDemand(store, expressId)) {
|
|
117
|
+
if (set.name !== spec.pset)
|
|
118
|
+
continue;
|
|
119
|
+
const property = set.properties.find((candidate) => candidate.name === spec.property);
|
|
120
|
+
if (property) {
|
|
121
|
+
raw = property.value;
|
|
122
|
+
break;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
if (raw === null || raw === undefined)
|
|
127
|
+
return undefined;
|
|
128
|
+
const value = typeof raw === 'object' ? JSON.stringify(raw) : String(raw);
|
|
129
|
+
return value.trim().length > 0 ? value.trim() : undefined;
|
|
130
|
+
}
|
|
131
|
+
//# sourceMappingURL=identity-hints.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"identity-hints.js","sourceRoot":"","sources":["../src/identity-hints.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,mBAAmB,EAA2C,MAAM,gBAAgB,CAAC;AAC9F,OAAO,EAAE,yBAAyB,EAAqB,MAAM,sBAAsB,CAAC;AACpF,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,8BAA8B,EAAE,MAAM,iBAAiB,CAAC;AAEjE,2EAA2E;AAC3E,MAAM,UAAU,GAAG,IAAI,OAAO,EAAyC,CAAC;AAExE;;;;;;;GAOG;AACH,SAAS,SAAS,CAAC,IAAiB;IAClC,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;IAC9B,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC;QAAE,OAAO,IAAI,CAAC;IACjC,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IAC7C,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC;QAAE,OAAO,QAAQ,CAAC;IACzC,O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,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;AAC5D,CAAC"}
|
package/dist/ifc-schema.d.ts
CHANGED
|
@@ -28,6 +28,15 @@ export declare function getAttributeNames(type: string): string[];
|
|
|
28
28
|
* `getAttributeNames`); only otherwise-empty lookups consult the union.
|
|
29
29
|
*/
|
|
30
30
|
export declare function getAttributeNamesAcrossSchemas(type: string): string[];
|
|
31
|
+
/** Attribute names in one model schema, falling back to the bundled union. */
|
|
32
|
+
export declare function getAttributeNamesForSchema(type: string, schema: string | undefined): string[];
|
|
33
|
+
/**
|
|
34
|
+
* The declared EXPRESS type of one attribute (`IfcDoorPanelProperties.PanelOperation`
|
|
35
|
+
* → `IfcDoorPanelOperationEnum`) in one model schema, falling back to the IFC4
|
|
36
|
+
* pin. `undefined` when the entity or attribute is unknown. IDS reads a
|
|
37
|
+
* predefined property set's attributes as properties, and this is their dataType.
|
|
38
|
+
*/
|
|
39
|
+
export declare function getAttributeTypeForSchema(type: string, attribute: string, schema: string | undefined): string | undefined;
|
|
31
40
|
/**
|
|
32
41
|
* Check if a type is a real IFC entity class in any bundled schema.
|
|
33
42
|
*
|
package/dist/ifc-schema.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ifc-schema.d.ts","sourceRoot":"","sources":["../src/ifc-schema.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ifc-schema.d.ts","sourceRoot":"","sources":["../src/ifc-schema.ts"],"names":[],"mappings":"AAoDA,eAAO,MAAM,mBAAmB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAgBtD,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE3D;AAoED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAGxD;AAED;;;;;;;;;GASG;AACH,wBAAgB,8BAA8B,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAMrE;AAED,8EAA8E;AAC9E,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,EAAE,CAS7F;AAED;;;;;GAKG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAUzH;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAGjD;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAMpD;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAI1D;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAG7E;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAQzD;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAI3D"}
|
package/dist/ifc-schema.js
CHANGED
|
@@ -8,15 +8,21 @@
|
|
|
8
8
|
* Do NOT hardcode entity types or attributes here; regenerate instead.
|
|
9
9
|
*/
|
|
10
10
|
import { SCHEMA_REGISTRY, getAllAttributesForEntity, isKnownEntity, getInheritanceChainForEntity, getEntityMetadata } from './generated/schema-registry.js';
|
|
11
|
-
import {
|
|
11
|
+
import { getSchemaRegistryForVersion } from './generated/schema-registry-by-version.js';
|
|
12
|
+
import { ENTITIES_IFC2X3, ENTITIES_IFC4_EXPRESS, ENTITIES_IFC4X3, IFC_DATA_TYPES } from '@ifc-lite/data';
|
|
12
13
|
// Union map across every bundled IFC schema (2X3 + 4 + 4X3). The parser
|
|
13
14
|
// has to categorize entities from ANY schema the user loads — so the
|
|
14
15
|
// inheritance walk must consult more than the IFC4 registry the parser's
|
|
15
16
|
// codegen pinned. Later schemas win on name collision (a non-issue in
|
|
16
17
|
// practice because the modern schemas are supersets).
|
|
18
|
+
//
|
|
19
|
+
// The IFC4 table is `ENTITIES_IFC4_EXPRESS`, not the raw `ENTITIES_IFC4`: the
|
|
20
|
+
// raw table carries alignment-extension entities IFC4 does not declare
|
|
21
|
+
// (#5204), and folding them in made `isKnownType` answer `true` for names no
|
|
22
|
+
// bundled schema has.
|
|
17
23
|
const ENTITY_INFO_BY_UPPER = (() => {
|
|
18
24
|
const map = new Map();
|
|
19
|
-
for (const list of [ENTITIES_IFC2X3,
|
|
25
|
+
for (const list of [ENTITIES_IFC2X3, ENTITIES_IFC4_EXPRESS, ENTITIES_IFC4X3]) {
|
|
20
26
|
for (const entity of list) {
|
|
21
27
|
map.set(entity.name.toUpperCase(), entity);
|
|
22
28
|
}
|
|
@@ -164,6 +170,35 @@ export function getAttributeNamesAcrossSchemas(type) {
|
|
|
164
170
|
const info = ENTITY_INFO_BY_UPPER.get(canonical.toUpperCase());
|
|
165
171
|
return info ? [...info.attributes] : [];
|
|
166
172
|
}
|
|
173
|
+
/** Attribute names in one model schema, falling back to the bundled union. */
|
|
174
|
+
export function getAttributeNamesForSchema(type, schema) {
|
|
175
|
+
const normalized = schema?.toUpperCase().replace(/[^A-Z0-9]/g, '');
|
|
176
|
+
if (normalized === 'IFC2X3' || normalized === 'IFC4' || normalized === 'IFC4X3') {
|
|
177
|
+
const registry = getSchemaRegistryForVersion(normalized);
|
|
178
|
+
const canonical = Object.keys(registry.entities).find(name => name.toUpperCase() === type.toUpperCase());
|
|
179
|
+
const attributes = canonical ? registry.entities[canonical]?.allAttributes : undefined;
|
|
180
|
+
if (attributes)
|
|
181
|
+
return attributes.map(attribute => attribute.name);
|
|
182
|
+
}
|
|
183
|
+
return getAttributeNamesAcrossSchemas(type);
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* The declared EXPRESS type of one attribute (`IfcDoorPanelProperties.PanelOperation`
|
|
187
|
+
* → `IfcDoorPanelOperationEnum`) in one model schema, falling back to the IFC4
|
|
188
|
+
* pin. `undefined` when the entity or attribute is unknown. IDS reads a
|
|
189
|
+
* predefined property set's attributes as properties, and this is their dataType.
|
|
190
|
+
*/
|
|
191
|
+
export function getAttributeTypeForSchema(type, attribute, schema) {
|
|
192
|
+
const normalized = schema?.toUpperCase().replace(/[^A-Z0-9]/g, '');
|
|
193
|
+
let attributes;
|
|
194
|
+
if (normalized === 'IFC2X3' || normalized === 'IFC4' || normalized === 'IFC4X3') {
|
|
195
|
+
const registry = getSchemaRegistryForVersion(normalized);
|
|
196
|
+
const canonical = Object.keys(registry.entities).find(name => name.toUpperCase() === type.toUpperCase());
|
|
197
|
+
attributes = canonical ? registry.entities[canonical]?.allAttributes : undefined;
|
|
198
|
+
}
|
|
199
|
+
attributes ??= getAllAttributesForEntity(type);
|
|
200
|
+
return attributes.find(a => a.name === attribute)?.type;
|
|
201
|
+
}
|
|
167
202
|
/**
|
|
168
203
|
* Check if a type is a real IFC entity class in any bundled schema.
|
|
169
204
|
*
|
package/dist/ifc-schema.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ifc-schema.js","sourceRoot":"","sources":["../src/ifc-schema.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D;;;;;GAKG;AAEH,OAAO,EAAE,eAAe,EAAE,yBAAyB,EAAE,aAAa,EAAE,4BAA4B,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAC5J,OAAO,EAAE,eAAe,EAAE,
|
|
1
|
+
{"version":3,"file":"ifc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;;;;;;GAgBG;AACH,MAAM,UAAU,qBAAqB,CAAC,IAAY;IAC9C,MAAM,KAAK,GAAG,mBAAmB,CAAC,IAAI,CAAC,CAAC;IACxC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,qBAAqB,CAAC;QAAE,OAAO,KAAK,CAAC;IACzD,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC;AAC5C,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export type { IfcZipContents } from './ifczip.js';
|
|
|
3
3
|
export { StepTokenizer } from './tokenizer.js';
|
|
4
4
|
export { EntityIndexBuilder } from './entity-index.js';
|
|
5
5
|
export { EntityExtractor } from './entity-extractor.js';
|
|
6
|
+
export { spatialContainerPath, authoredKeyValue, parseAuthoredKeySpec, type AuthoredKeySpec } from './identity-hints.js';
|
|
6
7
|
export { STEP_TRIVIA } from './step-trivia.js';
|
|
7
8
|
export { asSourceBytes, contiguousSourceBytes, isSourceBytes, sourceBytesFromTransferable, compressSourceInPlace, sourceBlockStats, EMPTY_SOURCE_BYTES, } from './source-bytes.js';
|
|
8
9
|
export { compressSource, shouldCompressSource, COMPRESSION_MIN_BYTES, type CompressedSource, } from './source-compress.js';
|
|
@@ -11,7 +12,7 @@ export type { IfcSourceBytes, IfcSourceTransfer } from './source-bytes.js';
|
|
|
11
12
|
export { CompactEntityIndex, CompactEntityIndexBuilder, buildCompactEntityIndex } from './compact-entity-index.js';
|
|
12
13
|
export { scanIfcEntities } from './entity-scanner.js';
|
|
13
14
|
export type { EntityScanPath, EntityScanResult, PreScannedEntityIndex, WasmScanApi } from './entity-scanner.js';
|
|
14
|
-
export { REL_TYPE_MAP, isIfcTypeLikeEntity } from './columnar-parser-indexes.js';
|
|
15
|
+
export { REL_TYPE_MAP, SECONDARY_REL_TYPE_MAP, isIfcTypeLikeEntity } from './columnar-parser-indexes.js';
|
|
15
16
|
export { IFC_SUBTYPES, expandTypes, QUERY_REL_TYPE_MAP } from './query-backend-maps.js';
|
|
16
17
|
export { PropertyExtractor } from './property-extractor.js';
|
|
17
18
|
export { QuantityExtractor } from './quantity-extractor.js';
|
|
@@ -21,7 +22,7 @@ export { extractLengthUnitScale, resolveEntityLengthUnitScale, resolveOwningIfcP
|
|
|
21
22
|
export { extractProjectUnits, measureUnit, ProjectUnits, type ResolvedUnit, type MeasureUnit, } from './project-units.js';
|
|
22
23
|
export { quantitySiScale } from './quantity-collect.js';
|
|
23
24
|
export { scaleMeasureValue, scaledPropertyValue, roundToScale } from './measure-unit-scale.js';
|
|
24
|
-
export { ColumnarParser, type IfcDataStore, type EntityByIdIndex, extractPropertiesOnDemand, extractQuantitiesOnDemand, extractEntityAttributesOnDemand, extractAllEntityAttributes, getRawNamedAttributes, extractRootAttributesFromEntity, extractClassificationsOnDemand, extractClassificationSystemsOnDemand, extractMaterialsOnDemand, extractAllMaterialsOnDemand, extractMaterialPropertiesOnDemand, extractMaterialPropertiesForMaterialId, resolveMaterialDefId, resolveAllMaterialDefIds, collectMaterialLeaves, buildMaterialUsageIndex, getMaterialDisplay, extractTypePropertiesOnDemand, extractTypeEntityOwnProperties, extractTypeQuantitiesOnDemand, mergeInheritedPropertySets, mergeInheritedQuantitySets, extractDocumentsOnDemand, extractRelationshipsOnDemand, extractGroupMembersOnDemand, extractGroupAssignmentFactorOnDemand, extractGeoreferencingOnDemand, type ClassificationInfo, type ClassificationSystemNames, type MaterialInfo, type MaterialLayerInfo, type MaterialProfileInfo, type MaterialConstituentInfo, type MaterialPsetGroup, type MaterialLeaf, type MaterialUsage, type TypePropertyInfo, type TypeQuantityInfo, type DocumentInfo, type EntityRelationships, type GroupMember } from './columnar-parser.js';
|
|
25
|
+
export { ColumnarParser, type IfcDataStore, type EntityByIdIndex, extractPropertiesOnDemand, extractQuantitiesOnDemand, extractEntityAttributesOnDemand, extractAllEntityAttributes, getRawNamedAttributes, extractRootAttributesFromEntity, extractClassificationsOnDemand, extractClassificationSystemsOnDemand, extractMaterialsOnDemand, extractAllMaterialsOnDemand, extractMaterialPropertiesOnDemand, extractMaterialPropertiesForMaterialId, resolveMaterialDefId, resolveAllMaterialDefIds, collectMaterialLeaves, buildMaterialUsageIndex, getMaterialDisplay, extractTypePropertiesOnDemand, extractTypeEntityOwnProperties, extractTypeQuantitiesOnDemand, mergeInheritedPropertySets, mergeInheritedQuantitySets, extractDocumentsOnDemand, extractRelationshipsOnDemand, extractExactRelatedIds, extractGroupMembersOnDemand, extractGroupAssignmentFactorOnDemand, extractGeoreferencingOnDemand, type ClassificationInfo, type ClassificationSystemNames, type MaterialInfo, type MaterialLayerInfo, type MaterialProfileInfo, type MaterialConstituentInfo, type MaterialPsetGroup, type MaterialLeaf, type MaterialUsage, type TypePropertyInfo, type TypeQuantityInfo, type DocumentInfo, type EntityRelationships, type GroupMember } from './columnar-parser.js';
|
|
25
26
|
export type { IfcStoreBase, IfcSourceHeader, SpatialHierarchy, EntityTable } from '@ifc-lite/data';
|
|
26
27
|
export { parseSourceHeader } from './source-header.js';
|
|
27
28
|
export { attachDataStoreAccessors, type IfcStoreData } from './data-store-accessors.js';
|
|
@@ -43,7 +44,9 @@ export type * from './generated/entities.js';
|
|
|
43
44
|
export * from './generated/enums.js';
|
|
44
45
|
export { serializeValue, toStepLine, generateHeader, generateStepFile, parseStepValue, ref, enumVal, isEntityRef, isEnumValue, type StepValue, type StepEntity, type EntityRef as StepEntityRef, type EnumValue, } from './generated/serializers.js';
|
|
45
46
|
export * from './types.js';
|
|
46
|
-
export { getAttributeNames, getAttributeNamesAcrossSchemas, getAttributeNameAt, isKnownType, isInstantiable, isQueryableObjectType, normalizeIfcTypeName, resolveEntityNameAlias, getInheritanceChain as getInheritanceChainAcrossSchemas } from './ifc-schema.js';
|
|
47
|
+
export { getAttributeNames, getAttributeNamesAcrossSchemas, getAttributeNamesForSchema, getAttributeTypeForSchema, getAttributeNameAt, isKnownType, isInstantiable, isQueryableObjectType, normalizeIfcTypeName, resolveEntityNameAlias, getInheritanceChain as getInheritanceChainAcrossSchemas } from './ifc-schema.js';
|
|
48
|
+
export { resolveEffectiveEntityRecord, type EffectiveEntityRecord, type EntityRecordEdits } from './effective-entity-record.js';
|
|
49
|
+
export { resolveEffectiveRelationshipOverlay, effectiveRelationshipEdges, type EffectiveRelationship, type EffectiveRelationshipOverlay, type RelationshipOverlayReader } from './effective-relationship-overlay.js';
|
|
47
50
|
import type { ParseResult } from './types.js';
|
|
48
51
|
import { type IfcDataStore } from './columnar-parser.js';
|
|
49
52
|
import { type PreScannedEntityIndex, type WasmScanApi } from './entity-scanner.js';
|