Intelligent Buildings Agents Laboratory (IBAL)#
The IBAL is a mixed system lab at NIST that is able to test commercial equipment under simulated conditions. For more information, vist the IBAL Database.
Schematic view#
Downloads#
Queries#
Description |
Query URL |
---|---|
Zone/room temperature sensors |
|
Search for all the sensors along the connections and the associated property they’re observing. |
|
Sensors in AHU1 and what units the properties are measured in |
Model Components#
Parent Class |
Class |
Instances |
---|---|---|
90 |
||
57 |
||
28 |
||
21 |
||
19 |
||
19 |
||
12 |
||
12 |
||
10 |
||
9 |
||
9 |
||
7 |
||
7 |
||
5 |
||
5 |
||
4 |
||
3 |
||
3 |
||
2 |
||
2 |
||
1 |
||
1 |
||
226 |
||
221 |
||
66 |
||
4 |
||
6 |
||
151 |
||
99 |
||
10 |
Load and Validate Model#
This code uses the BuildingMOTIF library to load the 223P ontology and the model file into a temporary in-memory instance. It then validates the model against the ontology. If the model is invalid, it will print the validation report.
To run this code, you need to have Java installed on your system. If you do not have Java installed, you can remove the shacl_engine='topquadrant'
parameter from the BuildingMOTIF
constructor.
Be warned that without the shacl_engine='topquadrant'
parameter, the validation process will be slower.
Note
BuildingMOTIF installation
To install the buildingmotif
library, you can use the following command:
pip install 'buildingmotif[topquadrant] @ git+https://github.com/NREL/buildingmotif.git@develop'
If you do not have Java installed, you can use the following command to install the library:
pip install 'buildingmotif @ git+https://github.com/NREL/buildingmotif.git@develop'
from buildingmotif import BuildingMOTIF
from buildingmotif.dataclasses import Library, Model
import logging
# Create a BuildingMOTIF object. If you do not have Java installed, remove the "shacl_engine" parameter
bm = BuildingMOTIF('sqlite://', shacl_engine='topquadrant', log_level=logging.ERROR)
# load 223P library. We will load a recent copy from the models.open223.info
# git repository; later, we will load this from the location of the actual standard
s223 = Library.load(ontology_graph="https://github.com/open223/models.open223.info/raw/main/ontologies/223p.ttl")
# load the model into the BuildingMOTIF instance
model = Model.create("urn:NIST-IBAL")
model.graph.parse("https://models.open223.info/NIST-IBAL.ttl")
# validate the model against 223P ontology
ctx = model.validate([s223.get_shape_collection()], error_on_missing_imports=False)
# print the validation result
print(f"Model is valid: {ctx.valid}")
# if the model is invalid, print the validation report
if not ctx.valid:
print(ctx.report_string[:1000]) # first 1000 characters of the report
# BuildingMOTIF can also interpret the report to provide recommendations on fixes
for focus_node, diffs in ctx.get_reasons_with_severity("Violation").items():
if len(diffs) == 0:
continue
print(focus_node)
for diff in diffs:
print(" - " + diff.reason())
Model is valid: True