From a9dee615e5ea89c1005257193ea17cb4bb43a71c Mon Sep 17 00:00:00 2001 From: Gabe Fierro Date: Thu, 1 Jan 2026 15:13:49 -0700 Subject: [PATCH 1/4] returning return/supply entering/leaving temp --- bricksrc/definitions.csv | 6 ++- bricksrc/sensor.py | 86 ++++++++++++++++++++++++++++++++++++---- bricksrc/substances.py | 14 +++++++ 3 files changed, 96 insertions(+), 10 deletions(-) diff --git a/bricksrc/definitions.csv b/bricksrc/definitions.csv index 0ed996a5..47bc1376 100644 --- a/bricksrc/definitions.csv +++ b/bricksrc/definitions.csv @@ -399,7 +399,7 @@ https://brickschema.org/schema/Brick#Entering_Medium_Temperature_Hot_Water_Tempe https://brickschema.org/schema/Brick#Entering_Medium_Temperature_Hot_Water_Temperature_Load_Shed_Status,, https://brickschema.org/schema/Brick#Entering_Medium_Temperature_Hot_Water_Temperature_Low_Reset_Setpoint,, https://brickschema.org/schema/Brick#Entering_Medium_Temperature_Hot_Water_Temperature_Sensor,Measures the temperature of medium-temperature hot water entering a hot water system, -https://brickschema.org/schema/Brick#Entering_Water,Water that is entering a piece of equipment or system, +https://brickschema.org/schema/Brick#Entering_Water,Water that is entering a piece of equipment within a water system; contrasts with returning water which is specifically water coming back from the load side of the system., https://brickschema.org/schema/Brick#Entering_Water_Differential_Pressure_Deadband_Setpoint,Sets the size of a deadband of differential pressure of entering water, https://brickschema.org/schema/Brick#Entering_Water_Differential_Pressure_Integral_Time_Parameter,, https://brickschema.org/schema/Brick#Entering_Water_Differential_Pressure_Proportional_Band_Parameter,, @@ -665,7 +665,7 @@ https://brickschema.org/schema/Brick#Leaving_Medium_Temperature_Hot_Water_Temper https://brickschema.org/schema/Brick#Leaving_Medium_Temperature_Hot_Water_Temperature_Load_Shed_Status,, https://brickschema.org/schema/Brick#Leaving_Medium_Temperature_Hot_Water_Temperature_Low_Reset_Setpoint,, https://brickschema.org/schema/Brick#Leaving_Medium_Temperature_Hot_Water_Temperature_Sensor,Measures the temperature of medium-temperature hot water supplied by a hot water system, -https://brickschema.org/schema/Brick#Leaving_Water,Water that is leaving a piece of equipment or system, +https://brickschema.org/schema/Brick#Leaving_Water,Water that is leaving a piece of equipment within a water system; contrasts with supply water which is water being supplied to the load side of the system., https://brickschema.org/schema/Brick#Leaving_Water_Differential_Pressure_Deadband_Setpoint,Sets the size of a deadband of differential pressure of leaving water, https://brickschema.org/schema/Brick#Leaving_Water_Differential_Pressure_Integral_Time_Parameter,, https://brickschema.org/schema/Brick#Leaving_Water_Differential_Pressure_Proportional_Band_Parameter,, @@ -1032,6 +1032,7 @@ https://brickschema.org/schema/Brick#Return_Air_Temperature_Setpoint,"The target https://brickschema.org/schema/Brick#Return_Damper,A damper that modulates the flow of return air, https://brickschema.org/schema/Brick#Return_Fan,Fan moving return air -- air that is circulated from the building back into the HVAC system, https://brickschema.org/schema/Brick#Return_Heating_Valve,A valve installed on the return side of a heat exchanger, +https://brickschema.org/schema/Brick#Return_Water,Water returning from the load-side of a water system, https://brickschema.org/schema/Brick#Reversing_Valve,, https://brickschema.org/schema/Brick#Riser,"A vertical shaft indented for installing building infrastructure e.g., electrical wire, network communication wire, plumbing, etc", https://brickschema.org/schema/Brick#Rooftop_Unit,"Packaged air conditioner mounted on a roof, the conditioned air being discharged directly into the rooms below or through a duct system.", @@ -1157,6 +1158,7 @@ https://brickschema.org/schema/Brick#Supply_Air_Temperature_Setpoint_Limit,, https://brickschema.org/schema/Brick#Supply_Air_Temperature_Step_Parameter,, https://brickschema.org/schema/Brick#Supply_Air_Velocity_Pressure_Sensor,, https://brickschema.org/schema/Brick#Supply_Fan,Fan moving supply air -- air that is supplied from the HVAC system into the building, +https://brickschema.org/schema/Brick#Supply_Water,Water being supplied to the load-side of a water system, https://brickschema.org/schema/Brick#Surveillance_Camera,, https://brickschema.org/schema/Brick#Switch,A switch used to operate all or part of a lighting installation, https://brickschema.org/schema/Brick#Switch_Room,A telecommuncations room housing network switches, diff --git a/bricksrc/sensor.py b/bricksrc/sensor.py index 3bf166a6..0d94b9fb 100644 --- a/bricksrc/sensor.py +++ b/bricksrc/sensor.py @@ -1924,7 +1924,7 @@ TAG.Sensor, ], }, - } + }, }, "Domestic_Hot_Water_Temperature_Sensor": { "tags": [ @@ -2040,6 +2040,30 @@ }, }, }, + "Return_Hot_Water_Temperature_Sensor": { + "tags": [ + TAG.Point, + TAG.Sensor, + TAG.Temperature, + TAG.Water, + TAG.Hot, + TAG.Return, + ], + BRICK.hasQuantity: QUDTQK.Temperature, + BRICK.hasSubstance: BRICK.Return_Hot_Water, + }, + "Supply_Hot_Water_Temperature_Sensor": { + "tags": [ + TAG.Point, + TAG.Sensor, + TAG.Temperature, + TAG.Water, + TAG.Hot, + TAG.Supply, + ], + BRICK.hasQuantity: QUDTQK.Temperature, + BRICK.hasSubstance: BRICK.Supply_Hot_Water, + }, "Chilled_Water_Temperature_Sensor": { "tags": [ TAG.Point, @@ -2066,6 +2090,23 @@ BRICK.Water_Differential_Temperature_Sensor ], }, + "Differential_Entering_Leaving_Water_Temperature_Sensor": { + "tags": [ + TAG.Point, + TAG.Sensor, + TAG.Temperature, + TAG.Water, + TAG.Chilled, + TAG.Leaving, + TAG.Entering, + TAG.Differential, + ], + BRICK.hasSubstance: [ + BRICK.Leaving_Chilled_Water, + BRICK.Entering_Chilled_Water, + ], + BRICK.hasQuantity: QUDTQK.Temperature, + }, "Entering_Chilled_Water_Temperature_Sensor": { "tags": [ TAG.Point, @@ -2090,22 +2131,29 @@ BRICK.hasQuantity: QUDTQK.Temperature, BRICK.hasSubstance: BRICK.Leaving_Chilled_Water, }, - "Differential_Entering_Leaving_Water_Temperature_Sensor": { + "Return_Chilled_Water_Temperature_Sensor": { "tags": [ TAG.Point, TAG.Sensor, TAG.Temperature, TAG.Water, TAG.Chilled, - TAG.Leaving, - TAG.Entering, - TAG.Differential, + TAG.Return, ], - BRICK.hasSubstance: [ - BRICK.Leaving_Chilled_Water, - BRICK.Entering_Chilled_Water, + BRICK.hasQuantity: QUDTQK.Temperature, + BRICK.hasSubstance: BRICK.Return_Chilled_Water, + }, + "Supply_Chilled_Water_Temperature_Sensor": { + "tags": [ + TAG.Point, + TAG.Sensor, + TAG.Temperature, + TAG.Water, + TAG.Chilled, + TAG.Supply, ], BRICK.hasQuantity: QUDTQK.Temperature, + BRICK.hasSubstance: BRICK.Supply_Chilled_Water, }, }, }, @@ -2155,6 +2203,28 @@ }, }, }, + "Return_Water_Temperature_Sensor": { + "tags": [ + TAG.Point, + TAG.Sensor, + TAG.Temperature, + TAG.Water, + TAG.Return, + ], + BRICK.hasQuantity: QUDTQK.Temperature, + BRICK.hasSubstance: BRICK.Return_Water, + }, + "Supply_Water_Temperature_Sensor": { + "tags": [ + TAG.Point, + TAG.Sensor, + TAG.Temperature, + TAG.Water, + TAG.Supply, + ], + BRICK.hasQuantity: QUDTQK.Temperature, + BRICK.hasSubstance: BRICK.Supply_Water, + }, "Collection_Basin_Water_Temperature_Sensor": { BRICK.hasQuantity: QUDTQK.Temperature, BRICK.hasSubstance: BRICK.Collection_Basin_Water, diff --git a/bricksrc/substances.py b/bricksrc/substances.py index 0a5af83e..8d259a5d 100644 --- a/bricksrc/substances.py +++ b/bricksrc/substances.py @@ -53,6 +53,12 @@ "Leaving_Chilled_Water": { "parents": [BRICK.Leaving_Water], }, + "Return_Chilled_Water": { + "parents": [BRICK.Return_Water], + }, + "Supply_Chilled_Water": { + "parents": [BRICK.Supply_Water], + }, }, }, "Collection_Basin_Water": {}, @@ -72,15 +78,23 @@ }, "Potable_Water": {}, "Leaving_Water": {}, + "Return_Water": {}, + "Supply_Water": {}, "Entering_Water": {}, "Hot_Water": { SKOS.narrower: { "Entering_Hot_Water": { "parents": [BRICK.Entering_Water], }, + "Return_Hot_Water": { + "parents": [BRICK.Return_Water], + }, "Leaving_Hot_Water": { "parents": [BRICK.Leaving_Water], }, + "Supply_Hot_Water": { + "parents": [BRICK.Supply_Water], + }, }, }, "Makeup_Water": {}, From 4df120794286493ab28d4d4cb82e25f6bd0675cc Mon Sep 17 00:00:00 2001 From: Gabe Fierro Date: Thu, 1 Jan 2026 15:14:48 -0700 Subject: [PATCH 2/4] add example --- .../chiller-system/chiller-plant-haystack.ttl | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 examples/chiller-system/chiller-plant-haystack.ttl diff --git a/examples/chiller-system/chiller-plant-haystack.ttl b/examples/chiller-system/chiller-plant-haystack.ttl new file mode 100644 index 00000000..fd3a8a7e --- /dev/null +++ b/examples/chiller-system/chiller-plant-haystack.ttl @@ -0,0 +1,46 @@ +# modeling the system in https://project-haystack.org/doc/docHaystack/chilled-water-plant.svg +@prefix : . +@prefix brick: . +@prefix unit: . +@prefix xsd: . +@prefix rdf: . +@prefix rdfs: . +@prefix owl: . + + a owl:Ontology ; + owl:imports . + +:plant a brick:Chilled_Water_System ; + brick:hasPart :ct, :chiller ; + brick:hasPoint :plant-chilled-water-supply-temp, :plant-chilled-water-return-temp . +:plant-chilled-water-supply-temp a brick:Supply_Chilled_Water_Temperature_Sensor ; + rdfs:label "Plant's temp sensor for the leaving chilled water (supply to load)" ; + brick:hasUnit unit:DEG_C . +:plant-chilled-water-return-temp a brick:Return_Chilled_Water_Temperature_Sensor ; + rdfs:label "Plant's temp sensor for the entering chilled water (return from load)" ; + brick:hasUnit unit:DEG_C . + +:ct a brick:Cooling_Tower ; + brick:hasPoint :ct-cond-water-leave-temp, :ct-cond-water-enter-temp . +:ct-cond-water-leave-temp a brick:Leaving_Condenser_Water_Temperature_Sensor ; + rdfs:label "Condenser Water Leave Temp Sensor, measured at cooling tower's condenser" ; + brick:hasUnit unit:DEG_C . +:ct-cond-water-enter-temp a brick:Entering_Condenser_Water_Temperature_Sensor ; + rdfs:label "Condenser Water Enter Temp Sensor, measured at cooling tower's condenser" ; + brick:hasUnit unit:DEG_C . + +:chiller a brick:Chiller ; + brick:hasPoint :cond-water-return-temp, :cond-water-supply-temp, + :chilled-water-enter-temp, :chilled-water-leave-temp . +:chilled-water-return-temp a brick:Return_Chilled_Water_Temperature_Sensor ; + rdfs:label "Chilled Water Enter Temp Sensor (return from load)" ; + brick:hasUnit unit:DEG_C . +:chilled-water-supply-temp a brick:Supply_Chilled_Water_Temperature_Sensor ; + rdfs:label "Chilled Water Leave Temp Sensor (supply to load)" ; + brick:hasUnit unit:DEG_C . +:cond-water-enter-temp a brick:Entering_Condenser_Water_Temperature_Sensor ; + rdfs:label "Condenser Water Enter Temp Sensor, measured at chiller" ; + brick:hasUnit unit:DEG_C . +:cond-water-leave-temp a brick:Leaving_Condenser_Water_Temperature_Sensor ; + rdfs:label "Condenser Water Leave Temp Sensor, measured at chiller" ; + brick:hasUnit unit:DEG_C . From e373d63359c5cc85d7dcb7cdecfacaa937a750b8 Mon Sep 17 00:00:00 2001 From: Gabe Fierro Date: Thu, 1 Jan 2026 15:46:10 -0700 Subject: [PATCH 3/4] fixing example --- .../chiller-system/chiller-plant-haystack.ttl | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/examples/chiller-system/chiller-plant-haystack.ttl b/examples/chiller-system/chiller-plant-haystack.ttl index fd3a8a7e..f89285fe 100644 --- a/examples/chiller-system/chiller-plant-haystack.ttl +++ b/examples/chiller-system/chiller-plant-haystack.ttl @@ -11,14 +11,15 @@ owl:imports . :plant a brick:Chilled_Water_System ; - brick:hasPart :ct, :chiller ; - brick:hasPoint :plant-chilled-water-supply-temp, :plant-chilled-water-return-temp . -:plant-chilled-water-supply-temp a brick:Supply_Chilled_Water_Temperature_Sensor ; - rdfs:label "Plant's temp sensor for the leaving chilled water (supply to load)" ; - brick:hasUnit unit:DEG_C . -:plant-chilled-water-return-temp a brick:Return_Chilled_Water_Temperature_Sensor ; - rdfs:label "Plant's temp sensor for the entering chilled water (return from load)" ; - brick:hasUnit unit:DEG_C . + brick:hasPart :ct, :chiller . +# currently can't put points on the system itself in Brick +# brick:hasPoint :plant-chilled-water-supply-temp, :plant-chilled-water-return-temp . +# :plant-chilled-water-supply-temp a brick:Supply_Chilled_Water_Temperature_Sensor ; +# rdfs:label "Plant's temp sensor for the leaving chilled water (supply to load)" ; +# brick:hasUnit unit:DEG_C . +# :plant-chilled-water-return-temp a brick:Return_Chilled_Water_Temperature_Sensor ; +# rdfs:label "Plant's temp sensor for the entering chilled water (return from load)" ; +# brick:hasUnit unit:DEG_C . :ct a brick:Cooling_Tower ; brick:hasPoint :ct-cond-water-leave-temp, :ct-cond-water-enter-temp . @@ -30,8 +31,8 @@ brick:hasUnit unit:DEG_C . :chiller a brick:Chiller ; - brick:hasPoint :cond-water-return-temp, :cond-water-supply-temp, - :chilled-water-enter-temp, :chilled-water-leave-temp . + brick:hasPoint :cond-water-enter-temp, :cond-water-leave-temp, + :chilled-water-return-temp, :chilled-water-supply-temp . :chilled-water-return-temp a brick:Return_Chilled_Water_Temperature_Sensor ; rdfs:label "Chilled Water Enter Temp Sensor (return from load)" ; brick:hasUnit unit:DEG_C . From e846b8c5e1a29de7f5eda391ddca6ade78336df1 Mon Sep 17 00:00:00 2001 From: Gabe Fierro Date: Thu, 1 Jan 2026 16:22:28 -0700 Subject: [PATCH 4/4] fix test for supply/discharge --- tests/test_matching_classes.py | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/tests/test_matching_classes.py b/tests/test_matching_classes.py index d94afc6d..e801dd85 100644 --- a/tests/test_matching_classes.py +++ b/tests/test_matching_classes.py @@ -16,6 +16,18 @@ def getDict(g, q): return d +def getSet(g, q): + s = set() + + res = g.query(q) + + for row in res: + c1 = row.c.toPython().replace("https://brickschema.org/schema/Brick#", "") + s.add(c1) + + return s + + def matchMinMax(d): ds = {} ds["MissingMatchingMin"] = [] @@ -101,7 +113,7 @@ def matchOccupiedUnoccupied(d): ) -def matchSupplyDischarge(d, e): +def matchSupplyDischarge(d, e, allowed=None): ds = {} ds["MissingMatchingDischarge"] = [] ds["MissingMatchingSupply"] = [] @@ -112,6 +124,8 @@ def matchSupplyDischarge(d, e): countdbutnots = 0 countsbutnotd = 0 for c in d: + if allowed is not None and c not in allowed: + continue if "Discharge" in c: s = c.replace("Discharge", "Supply") if s in d: @@ -137,6 +151,8 @@ def matchSupplyDischarge(d, e): dislist.append(c) countdbutnots += 1 for c in d: + if allowed is not None and c not in allowed: + continue if "Supply" in c: dis = c.replace("Supply", "Discharge") if dis in dislist: @@ -196,5 +212,17 @@ def test_matching_classes(brick_with_imports): } """, ) + supply_discharge = getSet( + g, + """ + SELECT DISTINCT ?c + WHERE { + ?c (owl:equivalentClass|^owl:equivalentClass)* ?e . + ?e brick:hasSubstance ?s . + FILTER (?s IN (brick:Supply_Air, brick:Discharge_Air)) . + FILTER NOT EXISTS { ?c owl:deprecated true } . + } + """, + ) print("verifying supply discharge classes...") - matchSupplyDischarge(d, deq) + matchSupplyDischarge(d, deq, allowed=supply_discharge)