From 05ff47fcff632ff62c836dbd2595b9c410c7b327 Mon Sep 17 00:00:00 2001 From: Dion Moult Date: Sun, 26 Oct 2025 20:38:58 +1100 Subject: [PATCH] Remap deprecated entities in Brick 1.4 to new RealEstateCore URIs. --- src/ifcopenshell-python/ifcopenshell/util/brick.py | 2 ++ .../ifcopenshell/util/ifc4_to_brick.json | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/ifcopenshell-python/ifcopenshell/util/brick.py b/src/ifcopenshell-python/ifcopenshell/util/brick.py index 8c11dacdfe..04e0be5452 100644 --- a/src/ifcopenshell-python/ifcopenshell/util/brick.py +++ b/src/ifcopenshell-python/ifcopenshell/util/brick.py @@ -53,6 +53,8 @@ def get_brick_type(element: ifcopenshell.entity_instance) -> Union[str, None]: if not result: result = ifc4_to_brick_map.get(ifc_type_class, None) if result: + if result.startswith("http"): + return result return f"https://brickschema.org/schema/Brick#{result}" # Generic fallback if element.is_a("IfcDistributionElement"): diff --git a/src/ifcopenshell-python/ifcopenshell/util/ifc4_to_brick.json b/src/ifcopenshell-python/ifcopenshell/util/ifc4_to_brick.json index b8fba566ed..d76d2c0c80 100644 --- a/src/ifcopenshell-python/ifcopenshell/util/ifc4_to_brick.json +++ b/src/ifcopenshell-python/ifcopenshell/util/ifc4_to_brick.json @@ -26,5 +26,10 @@ "IfcFlowMeter.GASMETER": "Gas_Meter", "IfcFlowMeter.WATERMETER": "Water_Meter", "IfcElectricMotor": "Motor", - "IfcSolarDevice.SOLARPANEL": "PV_Panel" + "IfcSolarDevice.SOLARPANEL": "PV_Panel", + "IfcBuilding": "https://w3id.org/rec#Building", + "IfcBuildingStorey": "https://w3id.org/rec#Level", + "IfcSpace": "https://w3id.org/rec#Room", + "IfcSpatialZone": "https://w3id.org/rec#Zone", + "IfcSpatialZone.THERMAL": "https://w3id.org/rec#HVACZone" }