@ifc-lite/query 1.14.11 → 1.14.12
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/README.md +14 -6
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -26,7 +26,7 @@ console.log(`${walls.length} external load-bearing walls`);
|
|
|
26
26
|
|
|
27
27
|
for (const wall of walls) {
|
|
28
28
|
console.log(wall.name, wall.globalId);
|
|
29
|
-
console.log(wall.properties
|
|
29
|
+
console.log(wall.properties); // lazily-loaded psets
|
|
30
30
|
}
|
|
31
31
|
```
|
|
32
32
|
|
|
@@ -52,7 +52,7 @@ query
|
|
|
52
52
|
.execute();
|
|
53
53
|
```
|
|
54
54
|
|
|
55
|
-
Supported: `=`, `!=`, `>`, `<`, `>=`, `<=`, `
|
|
55
|
+
Supported: `=`, `!=`, `>`, `<`, `>=`, `<=`, `contains`, `startsWith`.
|
|
56
56
|
|
|
57
57
|
## Graph traversal
|
|
58
58
|
|
|
@@ -65,18 +65,18 @@ console.log(wall.building()?.name); // 'Office Tower'
|
|
|
65
65
|
|
|
66
66
|
// Containment + composition
|
|
67
67
|
const openings = wall.contains(); // openings hosted by the wall
|
|
68
|
-
const aggregates = wall.
|
|
68
|
+
const aggregates = wall.decomposes();
|
|
69
69
|
```
|
|
70
70
|
|
|
71
71
|
## SQL via DuckDB-WASM
|
|
72
72
|
|
|
73
73
|
```typescript
|
|
74
74
|
const result = await query.sql(`
|
|
75
|
-
SELECT type, COUNT(*) AS count, AVG(
|
|
75
|
+
SELECT e.type, COUNT(*) AS count, AVG(q.value) AS avg_volume
|
|
76
76
|
FROM entities e
|
|
77
77
|
JOIN quantities q ON q.entity_id = e.express_id
|
|
78
|
-
WHERE q.
|
|
79
|
-
GROUP BY type
|
|
78
|
+
WHERE q.quantity_name = 'NetVolume'
|
|
79
|
+
GROUP BY e.type
|
|
80
80
|
ORDER BY count DESC
|
|
81
81
|
LIMIT 10
|
|
82
82
|
`);
|
|
@@ -86,6 +86,14 @@ console.table(result.rows);
|
|
|
86
86
|
|
|
87
87
|
Tables exposed: `entities`, `properties`, `quantities`, `relationships`. Useful when you'd rather write SQL than chain method calls.
|
|
88
88
|
|
|
89
|
+
DuckDB is loaded lazily on the first `sql()` call and is not bundled (it would add ~4 MB). To use the SQL API, install it alongside:
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
npm install @duckdb/duckdb-wasm
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
The fluent query API works without it.
|
|
96
|
+
|
|
89
97
|
## API
|
|
90
98
|
|
|
91
99
|
See the [Querying Guide](https://ltplus-ag.github.io/ifc-lite/guide/querying/) and [API Reference](https://ltplus-ag.github.io/ifc-lite/api/typescript/#ifc-litequery).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ifc-lite/query",
|
|
3
|
-
"version": "1.14.
|
|
3
|
+
"version": "1.14.12",
|
|
4
4
|
"description": "Query system for IFC-Lite",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -13,10 +13,10 @@
|
|
|
13
13
|
}
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@ifc-lite/parser": "^3.
|
|
17
|
-
"@ifc-lite/data": "^2.
|
|
18
|
-
"@ifc-lite/spatial": "^1.14.
|
|
19
|
-
"@ifc-lite/geometry": "^3.
|
|
16
|
+
"@ifc-lite/parser": "^3.8.1",
|
|
17
|
+
"@ifc-lite/data": "^2.5.1",
|
|
18
|
+
"@ifc-lite/spatial": "^1.14.11",
|
|
19
|
+
"@ifc-lite/geometry": "^3.1.3"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
22
|
"typescript": "^6.0.3",
|