Docs

Inheriting properties

In the previous guides we have discussed how to get started with subject composition as well as understanding properties. In this guide we want to show you how these concepts can come together. Let’s take a look at the composition we defined in previous How-to guides:

Subject type definition:
graph TD B[
Floor
] --> D[
Room
Parent type: Floor] --> F[
Temperature Sensor
Parent type: Room]
Example:
graph TD B(Floor 1) B --> D[Room 1A] D --> F[Temperature Sensor 1A]
Example:
graph TD B(Floor 2) B --> D[Room 2A] D --> F[Temperature Sensor 2A]

In some cases, it can be beneficial to inherit properties from a parent. In the example above, we will make an assumption that we would like to create a new property, named “Temperature setpoint” that will be defined on each level of the subject composition, but will be populated solely on the parent. To do this, we must create a new property, assign it to the various subject types, and then proceed to populate only the highest level of the composition, in our case Floor. Our objective will be to populate a temperature setpoint of 20 for all subjects with Floor 1 as parent, and a temperature setpoint of 18 for all subjects with Floor 2 as parent.

1. Click "Settings"

2. Click "Properties"

3. Click to add a new property type.

4. Set the data type to Number

5. Do not restrict values

6. Finalize and create property

7. Navigate to "Subjects"

8. Click "Types"

9. We will now connect the newly created Property to the subject type "Floor"

10. Click "Add property"

11. Click "Temperature setpoint"

12. Click "Add property"

13. Navigate back to "Types"

14. We will now connect the newly created Property to the subject type "Room"

15. Click "Add property"

16. Click "Temperature setpoint"

17. Click "Add property"

18. Navigate back to "Types"

19. We will now connect the newly created Property to the last subject type "Temperature Sensor"

20. Click "Add property"

21. Click "Temperature setpoint"

22. Click "Add property"

23. Navigate back to "Subjects"

24. We will first fill the newly created property for "Floor 1"

25. Edit the subject

26. Populate the property with the value, in this case 20

27. Navigate back to "Subjects"

28. We will now fill the newly created property for "Floor 2"

29. Edit the subject

30. Populate the property with the value, in this case 18

31. Click "Subjects"

32. Click "Floor 1"

33. Navigate down the subject composition by using the arrows shown. You might notice that for all underlying subjects, the Temperature setpoint has been automatically inherited.

34. Navigate to "Room 1A"

35. Click here.

36. Click "Subjects"

37. Click here to edit the subject

38. Seeing as this temperature sensor is a child of a subject that has populated the Temperature setpoint property, the default value here will be to inherit the value from the parent. If you would like to change this value, you can always enable the Use custom value option.

39. Click here.

Congratulations, you have just configured a property to be inherited based on the subject composition. We hope this gives you new ideas and insights with regard to how you can use this powerful feature!