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”.
This example Building 1 model 2 is provided by Pacific Northwest National Laboratory. See also Building 1 model 1 for a different modeling approach for the same building.
Schematic view#
Contents#
The 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#
Model instance data have a prefix that is resolvable to a Speckle URL.
@prefix bdg1-2: <http://speckle.xyz/streams/1fed8e620e/objects/>
For example, the following luminaire resolves to https://speckle.xyz/streams/1fed8e620e/objects/05749166d93671bedf16efb52636ce38.
bdg1:05749166d93671bedf16efb52636ce38 a s223:Luminaire
Downloads#
Queries#
Model Components#
Parent Class |
Class |
Instances |
---|---|---|
12 |
||
6 |
||
2 |
||
14 |
||
26 |
||
26 |
||
12 |
||
8 |
||
24 |
||
6 |
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:bdg1-2")
model.graph.parse("https://models.open223.info/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 ns2: <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 <urn:anon:uuid:0644c6bf-f126-47c8-927b-cb017a1044ab> ;
sh:resultMessage "s223: An ElectricWire must be associated with exactly one Constituent-Electricity using the relation hasMedium." ;
sh:resultPath ns2:hasMedium ;
sh:resultSeverity sh:Violation ;
sh:sourceConstraintComponent sh:ClassConstraintComponent ;
sh:sourceShape <urn:well-known/133cdebf> ;
sh:value ns2:Medium-Electricity ],
[ a sh:ValidationResult ;
sh:focusNode <urn:anon:uuid:387e2a78-1798-4d67-81e2-338d09097a2c> ;
sh:resultMessage "s223: An ElectricWire must be associated with exactly one Constituent-Electricity using the relation hasMedium." ;
sh:r
urn:anon:uuid:6ca5838d-23f6-49d0-bff7-bea099bef2ae
- urn:anon:uuid:6ca5838d-23f6-49d0-bff7-bea099bef2ae needs to be a http://data.ashrae.org/standard223#Substance-Medium
- urn:anon:uuid:6ca5838d-23f6-49d0-bff7-bea099bef2ae needs to be a http://data.ashrae.org/standard223#Constituent-Electricity
urn:anon:uuid:56bd4b6d-6653-4482-9eeb-6c7e06d91904
- urn:anon:uuid:56bd4b6d-6653-4482-9eeb-6c7e06d91904 needs to be a http://data.ashrae.org/standard223#Substance-Medium
urn:anon:uuid:387e2a78-1798-4d67-81e2-338d09097a2c
- urn:anon:uuid:387e2a78-1798-4d67-81e2-338d09097a2c needs to be a http://data.ashrae.org/standard223#Constituent-Electricity
- urn:anon:uuid:387e2a78-1798-4d67-81e2-338d09097a2c needs to be a http://data.ashrae.org/standard223#Substance-Medium
urn:anon:uuid:990f90c6-44a2-40eb-bcd3-1e0015a7e6a5
- urn:anon:uuid:990f90c6-44a2-40eb-bcd3-1e0015a7e6a5 needs to be a http://data.ashrae.org/standard223#Substance-Medium
- urn:anon:uuid:990f90c6-44a2-40eb-bcd3-1e0015a7e6a5 needs to be a http://data.ashrae.org/standard223#Constituent-Electricity
urn:anon:uuid:54ed52b1-7dd3-4caf-82df-19cff3f45e6e
- urn:anon:uuid:54ed52b1-7dd3-4caf-82df-19cff3f45e6e needs to be a http://data.ashrae.org/standard223#Substance-Medium
- urn:anon:uuid:54ed52b1-7dd3-4caf-82df-19cff3f45e6e needs to be a http://data.ashrae.org/standard223#Constituent-Electricity
urn:anon:uuid:4c251bac-c1a3-4cb1-a117-449921cfacba
- urn:anon:uuid:4c251bac-c1a3-4cb1-a117-449921cfacba needs to be a http://data.ashrae.org/standard223#Constituent-Electricity
- urn:anon:uuid:4c251bac-c1a3-4cb1-a117-449921cfacba needs to be a http://data.ashrae.org/standard223#Substance-Medium
urn:anon:uuid:e4ba2421-39ed-4aed-b1e9-e2384a7b30a0
- urn:anon:uuid:e4ba2421-39ed-4aed-b1e9-e2384a7b30a0 needs to be a http://data.ashrae.org/standard223#Substance-Medium
- urn:anon:uuid:e4ba2421-39ed-4aed-b1e9-e2384a7b30a0 needs to be a http://data.ashrae.org/standard223#Constituent-Electricity
urn:anon:uuid:7d8ae7be-cb25-499b-9931-f030a23d9963
- urn:anon:uuid:7d8ae7be-cb25-499b-9931-f030a23d9963 needs to be a http://data.ashrae.org/standard223#Substance-Medium
- urn:anon:uuid:7d8ae7be-cb25-499b-9931-f030a23d9963 needs to be a http://data.ashrae.org/standard223#Constituent-Electricity
urn:anon:uuid:0644c6bf-f126-47c8-927b-cb017a1044ab
- urn:anon:uuid:0644c6bf-f126-47c8-927b-cb017a1044ab needs to be a http://data.ashrae.org/standard223#Substance-Medium
- urn:anon:uuid:0644c6bf-f126-47c8-927b-cb017a1044ab needs to be a http://data.ashrae.org/standard223#Constituent-Electricity
urn:anon:uuid:175c95b7-d680-4c20-8247-ba3acfe47f7c
- urn:anon:uuid:175c95b7-d680-4c20-8247-ba3acfe47f7c needs to be a http://data.ashrae.org/standard223#Substance-Medium
- urn:anon:uuid:175c95b7-d680-4c20-8247-ba3acfe47f7c needs to be a http://data.ashrae.org/standard223#Constituent-Electricity
urn:anon:uuid:e6ba7afb-2017-483f-842f-4659d9d9cd13
- urn:anon:uuid:e6ba7afb-2017-483f-842f-4659d9d9cd13 needs to be a http://data.ashrae.org/standard223#Constituent-Electricity
- urn:anon:uuid:e6ba7afb-2017-483f-842f-4659d9d9cd13 needs to be a http://data.ashrae.org/standard223#Substance-Medium
urn:anon:uuid:f215cc32-796a-4f51-9ef9-9db344cbb0c6
- urn:anon:uuid:f215cc32-796a-4f51-9ef9-9db344cbb0c6 needs to be a http://data.ashrae.org/standard223#Constituent-Electricity
- urn:anon:uuid:f215cc32-796a-4f51-9ef9-9db344cbb0c6 needs to be a http://data.ashrae.org/standard223#Substance-Medium
urn:anon:uuid:d72b7939-889c-48bf-a1d1-26d940b390ec
- urn:anon:uuid:d72b7939-889c-48bf-a1d1-26d940b390ec needs to be a http://data.ashrae.org/standard223#Constituent-Electricity
- urn:anon:uuid:d72b7939-889c-48bf-a1d1-26d940b390ec needs to be a http://data.ashrae.org/standard223#Substance-Medium
urn:anon:uuid:385f4da7-af2d-4e4c-9457-e12939ce685e
- urn:anon:uuid:385f4da7-af2d-4e4c-9457-e12939ce685e needs to be a http://data.ashrae.org/standard223#Substance-Medium
- urn:anon:uuid:385f4da7-af2d-4e4c-9457-e12939ce685e needs to be a http://data.ashrae.org/standard223#Constituent-Electricity
urn:anon:uuid:7fb62c19-b090-480e-96db-459952c6b32f
- urn:anon:uuid:7fb62c19-b090-480e-96db-459952c6b32f needs to be a http://data.ashrae.org/standard223#Constituent-Electricity
- urn:anon:uuid:7fb62c19-b090-480e-96db-459952c6b32f needs to be a http://data.ashrae.org/standard223#Substance-Medium
urn:anon:uuid:bb63ef48-2005-46f6-aeb9-13129539a8e1
- urn:anon:uuid:bb63ef48-2005-46f6-aeb9-13129539a8e1 needs to be a http://data.ashrae.org/standard223#Substance-Medium