PNNL Example Building 1 Model 2#

Example Building 1 is a simplistic, reference tiny office building consisting of a single story with 5 rooms spanning 5 space types.

This reference building was developed for and first described in the journal article “Metadata Schemas and Ontologies for Building Energy Applications: A Critical Review and Use Case Analysis”.

Example Building 1 Model 2 is provided by Pacific Northwest National Laboratory. See NIST Example Building 1 Model 1 for a different modeling approach for the same building.

Schematic view#

image

Contents#

This model contains a representation of the building architecture and electrical/lighting system.

In addition to the s223 ontology, the model uses the Real Estate Core ontology to describe space types. The Real Estate Core ontology is extended by defining 2 subclasses for rec:Office.

recx:OpenOffice rdfs:subClassOf rec:Office;
  rdfs:label "Open Office".
recx:PrivateOffice rdfs:subClassOf rec:Office;
  rdfs:label "Private Office".

Source#

The model was created from source data consisting of a building information model (BIM) created using Autodesk Revit, and exported via a Speckle interface.

Speckle view of rooms and lighting fixtures#

image

Model instance data have a prefix that is resolvable to a Speckle URL.

@prefix bdg1: <http://speckle.xyz/streams/59e5e3c6a8/objects/>

For example, the following luminaire resolves to http://speckle.xyz/streams/59e5e3c6a8/objects/e2164e3d14db5fcb6915a4a2c8474579 :

bdg1:e2164e3d14db5fcb6915a4a2c8474579 a s223:Luminaire

Downloads#

Queries#

Model Components#

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 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:pnnl-bdg1-2")
model.graph.parse("https://models.open223.info/pnnl-bdg1-2.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: 0
@prefix ns3: <http://data.ashrae.org/standard223#> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

[] a sh:ValidationReport ;
    sh:conforms false ;
    sh:result [ a sh:ValidationResult ;
            sh:focusNode <http://speckle.xyz/streams/59e5e3c6a8/objects/d35dfa3a711c8827da4ebe2c6c4daeaf> ;
            sh:resultMessage "Value must be an instance of ns3:PhysicalSpace" ;
            sh:resultPath ns3:hasPhysicalLocation ;
            sh:resultSeverity sh:Violation ;
            sh:sourceConstraintComponent sh:ClassConstraintComponent ;
            sh:sourceShape <urn:well-known/c8efaadd> ;
            sh:value <http://speckle.xyz/streams/59e5e3c6a8/objects/1157c123ff14a75b9beadab2f8c0180f> ],
        [ a sh:ValidationResult ;
            sh:focusNode <http://speckle.xyz/streams/59e5e3c6a8/objects/82310afe7be18795e744d3829d8c5b02> ;
            sh:resultMessage "Value must be an instance of ns3:PhysicalSpace" ;
            sh:resultP
http://speckle.xyz/streams/59e5e3c6a8/objects/69a3c94b6051eef9648c4a51b61fef2d
  - http://speckle.xyz/streams/59e5e3c6a8/objects/69a3c94b6051eef9648c4a51b61fef2d needs to be a http://data.ashrae.org/standard223#PhysicalSpace
http://speckle.xyz/streams/59e5e3c6a8/objects/2369b84e845898237f185679a49455f3
  - http://speckle.xyz/streams/59e5e3c6a8/objects/2369b84e845898237f185679a49455f3 needs to be a http://data.ashrae.org/standard223#PhysicalSpace
http://speckle.xyz/streams/59e5e3c6a8/objects/623d78727293db6754a53c99d74131fb
  - http://speckle.xyz/streams/59e5e3c6a8/objects/623d78727293db6754a53c99d74131fb needs to be a http://data.ashrae.org/standard223#PhysicalSpace
http://speckle.xyz/streams/59e5e3c6a8/objects/e9d83bcd0340d3b2c702a83acd90a597
  - http://speckle.xyz/streams/59e5e3c6a8/objects/e9d83bcd0340d3b2c702a83acd90a597 needs to be a http://data.ashrae.org/standard223#PhysicalSpace
http://speckle.xyz/streams/59e5e3c6a8/objects/4ea70f2ce314f6256af73903cd711f94
  - http://speckle.xyz/streams/59e5e3c6a8/objects/4ea70f2ce314f6256af73903cd711f94 needs to be a http://data.ashrae.org/standard223#PhysicalSpace
http://speckle.xyz/streams/59e5e3c6a8/objects/bd58478e25040be5137eeed1f1e2f622
  - http://speckle.xyz/streams/59e5e3c6a8/objects/bd58478e25040be5137eeed1f1e2f622 needs to be a http://data.ashrae.org/standard223#PhysicalSpace
  - http://speckle.xyz/streams/59e5e3c6a8/objects/bd58478e25040be5137eeed1f1e2f622 needs to be a http://data.ashrae.org/standard223#PhysicalSpace
  - http://speckle.xyz/streams/59e5e3c6a8/objects/bd58478e25040be5137eeed1f1e2f622 needs to be a http://data.ashrae.org/standard223#PhysicalSpace
  - http://speckle.xyz/streams/59e5e3c6a8/objects/bd58478e25040be5137eeed1f1e2f622 needs to be a http://data.ashrae.org/standard223#PhysicalSpace
  - http://speckle.xyz/streams/59e5e3c6a8/objects/bd58478e25040be5137eeed1f1e2f622 needs to be a http://data.ashrae.org/standard223#PhysicalSpace
http://speckle.xyz/streams/59e5e3c6a8/objects/82310afe7be18795e744d3829d8c5b02
  - http://speckle.xyz/streams/59e5e3c6a8/objects/82310afe7be18795e744d3829d8c5b02 needs to be a http://data.ashrae.org/standard223#PhysicalSpace
http://speckle.xyz/streams/59e5e3c6a8/objects/d35dfa3a711c8827da4ebe2c6c4daeaf
  - http://speckle.xyz/streams/59e5e3c6a8/objects/d35dfa3a711c8827da4ebe2c6c4daeaf needs to be a http://data.ashrae.org/standard223#PhysicalSpace
http://speckle.xyz/streams/59e5e3c6a8/objects/0afb7c8e9477410024492f1cf1a1cbd4
  - http://speckle.xyz/streams/59e5e3c6a8/objects/0afb7c8e9477410024492f1cf1a1cbd4 needs to be a http://data.ashrae.org/standard223#PhysicalSpace
http://speckle.xyz/streams/59e5e3c6a8/objects/d0c443539805854ca2e06d22972810cb
  - http://speckle.xyz/streams/59e5e3c6a8/objects/d0c443539805854ca2e06d22972810cb needs to be a http://data.ashrae.org/standard223#PhysicalSpace
http://speckle.xyz/streams/59e5e3c6a8/objects/7ce038437255ca97816f40fafc85d5e5
  - http://speckle.xyz/streams/59e5e3c6a8/objects/7ce038437255ca97816f40fafc85d5e5 needs to be a http://data.ashrae.org/standard223#PhysicalSpace
http://speckle.xyz/streams/59e5e3c6a8/objects/27967fc224f4ffd94032c8a851862769
  - http://speckle.xyz/streams/59e5e3c6a8/objects/27967fc224f4ffd94032c8a851862769 needs to be a http://data.ashrae.org/standard223#PhysicalSpace
http://speckle.xyz/streams/59e5e3c6a8/objects/c01317fdfcfe26384d44f515b3dd2400
  - http://speckle.xyz/streams/59e5e3c6a8/objects/c01317fdfcfe26384d44f515b3dd2400 needs to be a http://data.ashrae.org/standard223#PhysicalSpace
http://speckle.xyz/streams/59e5e3c6a8/objects/83a72b8eb42e0a6295fcccd3b21ff40e
  - http://speckle.xyz/streams/59e5e3c6a8/objects/83a72b8eb42e0a6295fcccd3b21ff40e needs to be a http://data.ashrae.org/standard223#PhysicalSpace
http://speckle.xyz/streams/59e5e3c6a8/objects/989a49980114d3ad1b7cd8174b4fbb3e
  - http://speckle.xyz/streams/59e5e3c6a8/objects/989a49980114d3ad1b7cd8174b4fbb3e needs to be a http://data.ashrae.org/standard223#PhysicalSpace
http://speckle.xyz/streams/59e5e3c6a8/objects/9db8a11163a3cf15cdf724157a148128
  - http://speckle.xyz/streams/59e5e3c6a8/objects/9db8a11163a3cf15cdf724157a148128 needs to be a http://data.ashrae.org/standard223#PhysicalSpace
http://speckle.xyz/streams/59e5e3c6a8/objects/e2164e3d14db5fcb6915a4a2c8474579
  - http://speckle.xyz/streams/59e5e3c6a8/objects/e2164e3d14db5fcb6915a4a2c8474579 needs to be a http://data.ashrae.org/standard223#PhysicalSpace
http://speckle.xyz/streams/59e5e3c6a8/objects/98b4ba93290fb58ad5c44f8c47df60db
  - http://speckle.xyz/streams/59e5e3c6a8/objects/98b4ba93290fb58ad5c44f8c47df60db needs to be a http://data.ashrae.org/standard223#PhysicalSpace
http://speckle.xyz/streams/59e5e3c6a8/objects/87dfeb5fa9182df28ee465465f416594
  - http://speckle.xyz/streams/59e5e3c6a8/objects/87dfeb5fa9182df28ee465465f416594 needs to be a http://data.ashrae.org/standard223#PhysicalSpace
http://speckle.xyz/streams/59e5e3c6a8/objects/6b94d2f45496e556bbfe5020cd805a56
  - http://speckle.xyz/streams/59e5e3c6a8/objects/6b94d2f45496e556bbfe5020cd805a56 needs to be a http://data.ashrae.org/standard223#PhysicalSpace
http://speckle.xyz/streams/59e5e3c6a8/objects/e2684126ff114d569384c6d3a21f953b
  - http://speckle.xyz/streams/59e5e3c6a8/objects/e2684126ff114d569384c6d3a21f953b needs to be a http://data.ashrae.org/standard223#PhysicalSpace