bSDD icon indicating copy to clipboard operation
bSDD copied to clipboard

❔ Property Inheritance

Open ollyhensby opened this issue 10 months ago • 0 comments

Describe the bug It mentions here in the documentation that The child Class does not inherit properties from the parent Class.

This statement is then followed by this example:

For example, the IfcWall is a parent class of IfcWallStandardCase. While IfcWall has the property AcousticRating, the IfcWallStandardCase doesn't.

It seems IfcWallStandardCase doesn't exist anymore in IFC 4.3 so I have tried to check the example using IfcWallSTANDARD instead. It appears that IfcWallSTANDARD does contain the property Acoustic Rating.

So, is it still true that child classes do not inherit properties from their parent class? Or is it that the example needs updating?

Also, just wanted to add that the new bsdd API is great so thank you for the great work on that!

To Reproduce Steps to reproduce the behaviour:

I've used the bsdd api to obtain the class properties for each class and then find the set difference between the two:

import requests

URL = lambda ifc_class: f"https://api.bsdd.buildingsmart.org/api/Class/v1?Uri=https%3A%2F%2Fidentifier.buildingsmart.org%2Furi%2Fbuildingsmart%2Fifc%2F4.3%2Fclass%2F{ifc_class}&IncludeClassProperties=true"

# Obtain data from bsdd api
response = requests.get(URL("IfcWall"))
ifc_wall = response.json()
response = requests.get(URL("IfcWallSTANDARD"))
ifc_wall_standard_case = response.json()

# Get sets of property names for each class
ifc_wall_property_names = set([property_["name"] for property_ in ifc_wall["classProperties"]])
ifc_wall_standard_case_property_names = set([property_["name"] for property_ in ifc_wall_standard_case["classProperties"]])

# I would expect this set difference between the properties to return AcousticRating
print(ifc_wall_property_names - ifc_wall_standard_case_property_names)

ollyhensby avatar Apr 16 '24 10:04 ollyhensby