Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions bricksrc/definitions.csv
Original file line number Diff line number Diff line change
Expand Up @@ -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,,
Expand Down Expand Up @@ -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,,
Expand Down Expand Up @@ -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.",
Expand Down Expand Up @@ -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,
Expand Down
86 changes: 78 additions & 8 deletions bricksrc/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -1924,7 +1924,7 @@
TAG.Sensor,
],
},
}
},
},
"Domestic_Hot_Water_Temperature_Sensor": {
"tags": [
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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,
},
},
},
Expand Down Expand Up @@ -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,
Expand Down
14 changes: 14 additions & 0 deletions bricksrc/substances.py
Original file line number Diff line number Diff line change
Expand Up @@ -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": {},
Expand All @@ -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": {},
Expand Down
47 changes: 47 additions & 0 deletions examples/chiller-system/chiller-plant-haystack.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# modeling the system in https://project-haystack.org/doc/docHaystack/chilled-water-plant.svg
@prefix : <http://example.com/chiller-plant-haystack#> .
@prefix brick: <https://brickschema.org/schema/Brick#> .
@prefix unit: <http://qudt.org/vocab/unit/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .

<http://example.com/chiller-plant-haystack> a owl:Ontology ;
owl:imports <https://brickschema.org/schema/1.4/Brick> .

:plant a brick:Chilled_Water_System ;
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 .
: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-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 .
: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 .
32 changes: 30 additions & 2 deletions tests/test_matching_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"] = []
Expand Down Expand Up @@ -101,7 +113,7 @@ def matchOccupiedUnoccupied(d):
)


def matchSupplyDischarge(d, e):
def matchSupplyDischarge(d, e, allowed=None):
ds = {}
ds["MissingMatchingDischarge"] = []
ds["MissingMatchingSupply"] = []
Expand All @@ -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:
Expand All @@ -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:
Expand Down Expand Up @@ -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)