Skip to content
Open
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: 5 additions & 1 deletion bricksrc/collections.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .namespaces import TAG, OWL, BRICK
from .namespaces import TAG, REC, BRICK

system_subclasses = {
"Automatic_Tint_Window_Array": {
Expand Down Expand Up @@ -159,6 +159,10 @@
"tags": [TAG.Collection, TAG.Portfolio],
"constraints": {BRICK.hasPart: [BRICK.Site]},
},
"Point_Group": {
"tags": [TAG.Collection, TAG.Point_Group],
"constraints": {REC.includes: [BRICK.Point, BRICK.Point_Group]},
},
"System": {
"tags": [TAG.Collection, TAG.System],
"subclasses": system_subclasses,
Expand Down
1 change: 1 addition & 0 deletions bricksrc/equipment.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
},
"Controller": {
"tags": [TAG.Equipment, TAG.ICT, TAG.Controller],
BRICK.hosts: [BRICK.Point_Group],
"subclasses": {
"BACnet_Controller": {
"tags": [TAG.Equipment, TAG.BACnet, TAG.Controller],
Expand Down
6 changes: 1 addition & 5 deletions bricksrc/recpatches.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -1180,10 +1180,6 @@ brick:Collection
sh:property [
rdf:type sh:PropertyShape ;
sh:path rec:includes ;
sh:or (
[ sh:class brick:Equipment ]
[ sh:class brick:Collection ]
) ;
sh:minCount 1 ;
sh:name "includes" ;
sh:nodeKind sh:IRI ;
Expand Down Expand Up @@ -1833,4 +1829,4 @@ rec:AudioVisualEquipment
brick:deprecatedInVersion "1.4.0" ;
brick:deprecationMitigationMessage "REC ICT classes are being phased out in favor of Brick classes. For a replacement, consider brick:Audio_Visual_Equipment" ;
brick:isReplacedBy brick:Audio_Visual_Equipment ;
.
.
48 changes: 47 additions & 1 deletion bricksrc/relationships.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,48 @@
"domain": BRICK.Point,
RDFS.label: Literal("Has unit", lang="en"),
},
"controls": {
A: [OWL.ObjectProperty, OWL.AsymmetricProperty, OWL.IrreflexiveProperty],
OWL.inverseOf: BRICK["isControlledBy"],
"range": BRICK.Equipment,
"domain": BRICK.Controller,
RDFS.label: Literal("Controls", lang="en"),
},
"isControlledBy": {
A: [OWL.ObjectProperty, OWL.AsymmetricProperty, OWL.IrreflexiveProperty],
OWL.inverseOf: BRICK["controls"],
"range": BRICK.Controller,
"domain": BRICK.Equipment,
RDFS.label: Literal("Is controlled by", lang="en"),
},
"hosts": {
A: [OWL.ObjectProperty, OWL.AsymmetricProperty, OWL.IrreflexiveProperty],
OWL.inverseOf: BRICK["isHostedBy"],
"range": BRICK.Point_Group,
"domain": BRICK.Controller,
RDFS.label: Literal("Hosts", lang="en"),
},
"isHostedBy": {
A: [OWL.ObjectProperty, OWL.AsymmetricProperty, OWL.IrreflexiveProperty],
OWL.inverseOf: BRICK["hosts"],
"range": BRICK.Controller,
"domain": BRICK.Point_Group,
RDFS.label: Literal("Is hosted by", lang="en"),
},
"concerns": {
A: [OWL.ObjectProperty, OWL.AsymmetricProperty, OWL.IrreflexiveProperty],
OWL.inverseOf: BRICK["isConcernedBy"],
"range": REC.Zone,
"domain": BRICK.Controller,
RDFS.label: Literal("Concerns", lang="en"),
},
"isConcernedBy": {
A: [OWL.ObjectProperty, OWL.AsymmetricProperty, OWL.IrreflexiveProperty],
OWL.inverseOf: BRICK["concerns"],
"range": BRICK.Controller,
"domain": REC.Zone,
RDFS.label: Literal("Is concerned by", lang="en"),
},
"meters": {
A: [OWL.ObjectProperty, OWL.AsymmetricProperty, OWL.IrreflexiveProperty],
OWL.inverseOf: BRICK.isMeteredBy,
Expand Down Expand Up @@ -238,4 +280,8 @@
if row["datatype"]:
relationships[row["path"]][A] = [OWL.DatatypeProperty]
if row["nodeKind"]:
relationships[row["path"]][A] = [OWL.ObjectProperty, OWL.AsymmetricProperty, OWL.IrreflexiveProperty]
relationships[row["path"]][A] = [
OWL.ObjectProperty,
OWL.AsymmetricProperty,
OWL.IrreflexiveProperty,
]
20 changes: 20 additions & 0 deletions bricksrc/rules.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -556,3 +556,23 @@ bsh:InheritEVSEChargerDirection a sh:NodeShape ;
""" ;
] ;
.

# check that controllers host the points of the equipment they control
bsh:CheckControllerHostsPointGroups a sh:NodeShape ;
sh:targetClass brick:Controller ;
sh:sparql [
a sh:SPARQLConstraint ;
sh:message "Controllers should host the points of the equipment they control" ;
sh:prefixes <https://brickschema.org/schema/1.4/Brick> ;
sh:select """
SELECT $this ?pt ?eq WHERE {
$this brick:controls ?eq .
?eq brick:hasPoint ?pt .
FILTER NOT EXISTS {
$this brick:hosts ?pg .
?pg rec:includes ?pt .
}
}
""" ;
]
.
41 changes: 41 additions & 0 deletions examples/controller/controller.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
@prefix bldg: <http://example.com/controller#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix rec: <https://w3id.org/rec#> .
@prefix brick: <https://brickschema.org/schema/Brick#> .
@prefix bacnet: <http://data.ashrae.org/bacnet/2020#> .
@prefix unit: <http://qudt.org/vocab/unit/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix ref: <https://brickschema.org/schema/Brick/ref#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .

<http://example.com/controller> a owl:Ontology ;
owl:imports <https://brickschema.org/schema/1.4/Brick> .


bldg:Controller_1 a brick:Controller ;
rdfs:label "Main Building Controller" ;
brick:hosts bldg:VAV1PointGroup ;
brick:controls bldg:VAV1 ;
brick:concerns bldg:Zone1 ;
.

bldg:VAV1PointGroup a brick:Point_Group ;
rdfs:label "VAV1 Point Group" ;
rec:includes bldg:VAV1_Temperature_Sensor, bldg:VAV1_Occupancy_Sensor ;
.

bldg:VAV1_Temperature_Sensor a brick:Temperature_Sensor ;
rdfs:label "VAV1 Temperature Sensor" .

bldg:VAV1_Occupancy_Sensor a brick:Occupancy_Sensor ;
rdfs:label "VAV1 Occupancy Sensor" .

bldg:VAV1 a brick:Variable_Air_Volume_Box ;
rdfs:label "VAV1" ;
brick:hasPoint bldg:VAV1_Temperature_Sensor, bldg:VAV1_Occupancy_Sensor ;
brick:feeds bldg:Zone1 ;
.

bldg:Zone1 a rec:HVACZone ;
rdfs:label "Zone 1" ;
.