Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

LBNL Example Building 3 Model 1

LBNL Example Building 3 Model 1

Example Building 3 is a real-world medium-sized office building. It is approximately 67,000 square feet in size, contains 2 floors, 27 space types, and 469 rooms. Labels have been anonymized, and are not interpretable. It uses an underfloor air distribution system with fan-powered terminal reheat coils for perimeter zones. Four roof-top units with VAV are located on the roof. The lighting system primariliy uses fluorescent luminaires and zone-based lighting controllers that communicate with user interface devices and wireless gatetways over DALI networks. The gateways collect occupancy and light sensor data over an ISM-band wireless network.

Example Building 3 Model 1 is provided by Lawrence Berkeley National Laboratory. See PNNL Example Building 3 model 2 for a different modeling approach for the same building.

Contents

This model contains a representation of the HVAC system.

Source

Downloads

What are these files?
  • Turtle file (original): This is the original source Turtle file that was provided to models.open223.info, usually as the output of some model creation tool.

  • Turtle file (compiled): This is the original Turtle file with all inferred relationships and values added through SHACL inference against the 223P ontology and other dependencies. You should use this file for any further processing. It does not contain any of the ontologies.

  • Turtle file (with all imports): This is the compiled Turtle file with all imports included in the file (223P ontology, QUDT ontology, and others). This is helpful when you do not want to deal with downloading and managing ontology dependencies. It is also much larger than the compiled file.

  • JSON-LD file (original): This is the original Turtle file converted to the JSON-LD format.

Turtle is a syntax for RDF (Resource Description Framework) that is easy to read and write. It is a popular format for representing linked data. Parsers and serializers are available in many programming languages. JSON-LD is a JSON-based format for linked data that is easy to use with JavaScript and other web technologies.

Queries

DescriptionQuery URL
Zone/room temperature sensorsQuery Link

Model Components

Parent ClassClassInstances
EquipmentFan116
EquipmentCoil58
EquipmentHeatingCoil54
EquipmentValve54
EquipmentTwoWayValve54
EquipmentSensor48
EquipmentDamper20
EquipmentTemperatureSensor20
EquipmentFilter8
EquipmentDifferentialSensor8
EquipmentAirHandlingUnit4
EquipmentCoolingCoil4
ConnectionPointInletConnectionPoint616
ConnectionPointOutletConnectionPoint500
ConnectionPointBidirectionalConnectionPoint28
DomainSpace58
Zone2
PropertyQuantifiableProperty506
PropertyObservableProperty368
PropertyQuantifiableObservableProperty368
PropertyActuatableProperty140
PropertyQuantifiableActuatableProperty132
PropertyEnumerableProperty8
PropertyEnumeratedActuatableProperty8

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.

from buildingmotif import BuildingMOTIF
from buildingmotif.dataclasses import Library, Model
import ontoenv
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://open223.info/223p.ttl", infer_templates=False, run_shacl_inference=False)
unit = Library.load(ontology_graph="http://qudt.org/3.1.1/vocab/unit", infer_templates=False, run_shacl_inference=False)
quantitykind = Library.load(ontology_graph="http://qudt.org/3.1.1/vocab/quantitykind", infer_templates=False, run_shacl_inference=False)

# load the model into the BuildingMOTIF instance
model = Model.create("urn:lbnl-bdg3-1")
model.graph.parse("https://models.open223.info/lbnl-bdg3-1.ttl")

# validate the model against 223P ontology
ctx = model.validate([s223.get_shape_collection(),
                      unit.get_shape_collection(),
                      quantitykind.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: 0
Validation Report
Conforms: False

Validation Results (1189):

--- Result 1 ---
Severity: sh:Info
Focus Node: ns5:00885
Message: s223: A `DomainSpace` must be enclosed by a `PhysicalSpace`.
Path: _:n022461fc7c2f42339be2c3c62cd5d7d2b3
Source Constraint: sh:MinCountConstraintComponent
Source Shape: <urn:well-known/89b820bb>

--- Result 2 ---
Severity: sh:Info
Focus Node: ns5:00882
Message: s223: A `DomainSpace` must be enclosed by a `PhysicalSpace`.
Path: _:n022461fc7c2f42339be2c3c62cd5d7d2b5
Source Constraint: sh:MinCountConstraintComponent
Source Shape: <urn:well-known/89b820bb>

--- Result 3 ---
Severity: sh:Info
Focus Node: ns5:00817
Message: s223: A `DomainSpace` must be enclosed by a `PhysicalSpace`.
Path: _:n022461fc7c2f42339be2c3c62cd5d7d2b7
Source Constraint: sh:MinCountConstraintComponent
Source Shape: <urn:well-known/89b820bb>

--- Result 4 ---
Severity: sh:Info
Focus Node: ns5:00820
Message: s223: A `DomainSpace` must be enclosed by a `PhysicalSpace`.
Path: _:n022461fc7c2f423
http://data.ashrae.org/standard223/data/lbnl-example-2#00420
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
Cell In[1], line 38
     36 print(focus_node)
     37 for diff in diffs:
---> 38     print("  - " + diff.reason())

File ~/work/models.open223.info/models.open223.info/.venv/lib/python3.12/site-packages/buildingmotif/dataclasses/validation.py:396, in RequiredPath.reason(self)
    394 def reason(self) -> str:
    395     """Human-readable explanation of this GraphDiff."""
--> 396     path = shacl_path_to_sparql_path(
    397         self.graph, self.path, prefixes=dict(self.graph.namespaces())
    398     )
    399     return self.format_count_error(self.maxc, self.minc, path)

File ~/work/models.open223.info/models.open223.info/.venv/lib/python3.12/site-packages/pyshacl/helper/path_helper.py:43, in shacl_path_to_sparql_path(shapes_graph, path_node, prefixes, recursion)
     41     raise ReportableRuntimeError("Path traversal depth is too much!")
     42 top_level = recursion == 0
---> 43 sequence_list = list(shapes_graph.graph.items(path_node))
     44 if len(sequence_list) > 0:
     45     all_collected = []

AttributeError: 'Graph' object has no attribute 'graph'