Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

❔ Property Inheritance #91

Open
ollyhensby opened this issue Apr 16, 2024 · 0 comments
Open

❔ Property Inheritance #91

ollyhensby opened this issue Apr 16, 2024 · 0 comments

Comments

@ollyhensby
Copy link

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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant