buildingSMART / bSDD

The buildingSMART Data Dictionary repository, where we publish the documentation, examples and more. We don't publish here the data, the source code of the bSDD service or the front end of the website.
https://www.buildingsmart.org/users/services/buildingsmart-data-dictionary/
MIT License
135 stars 36 forks source link

❔ Property Inheritance #91

Closed ollyhensby closed 4 months ago

ollyhensby commented 6 months ago

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)
atomczak commented 4 months ago

@ollyhensby the bSDD doesn't automatically inherit properties. You see the same property in both parent/child element, because it was explicitly defined in the upload. This shifts the effort from the software interpreting bSDD to the admin publishing in bSDD.