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.

Heat Pump Laboratory (HPL)

Heat Pump Laboratory (HPL)

The HPL is a lab at NIST that consists of a bi-directional indoor and outdoor air system.

Schematic view

image

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
Find the downstream equipment for AHU1.Query Link

Model Components

Parent ClassClassInstances
EquipmentTemperatureSensor34
EquipmentPressureSensor8
EquipmentSensor3
EquipmentHumiditySensor3
EquipmentFan3
EquipmentValve3
EquipmentFlowSensor2
EquipmentHeatExchanger1
EquipmentCoil1
ConnectionPipe10
ConnectionDuct9
ConnectionPointBidirectionalConnectionPoint20
ConnectionPointOutletConnectionPoint15
ConnectionPointInletConnectionPoint15
DomainSpace1
PropertyQuantifiableObservableProperty52
PropertyQuantifiableProperty6

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:NIST-HPL")
model.graph.parse("https://models.open223.info/NIST-HPL.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 (14):

--- Result 1 ---
Severity: sh:Violation
Focus Node: <http://example.org/HPL#TemperatureSensor_30>
Message: s223: A `Sensor` shall be associated with exactly 1 of `Connectable`, `Connection`, or `ConnectionPoint` using the relation `hasObservationLocation`.
Value: <http://example.org/HPL#TemperatureSensor_30>
Source Constraint: sh:XoneConstraintComponent
Source Shape: ns2:SensorObservationLocationShape

--- Result 2 ---
Severity: sh:Violation
Focus Node: <http://example.org/HPL#PressureSensor_8>
Message: s223: A `Sensor` shall be associated with exactly 1 of `Connectable`, `Connection`, or `ConnectionPoint` using the relation `hasObservationLocation`.
Value: <http://example.org/HPL#PressureSensor_8>
Source Constraint: sh:XoneConstraintComponent
Source Shape: ns2:SensorObservationLocationShape

--- Result 3 ---
Severity: sh:Violation
Focus Node: <http://example.org/HPL#TemperatureSensor_15>
Message: s223: A `Sensor` shall be as
http://data.ashrae.org/standard223#NumberOfElectricalPhases-ThreePhase
  - http://qudt.org/vocab/quantitykind/NumberOfElectricalPhases on http://data.ashrae.org/standard223#NumberOfElectricalPhases-ThreePhase needs to be a http://qudt.org/schema/qudt/QuantityKind
http://example.org/HPL#FinnedHeatExchanger_R_CP_1
  - http://example.org/HPL#FinnedHeatExchanger_R_CP_1 expected 1 instance(s) of ns2:Connectable on path ns2:isConnectionPointOf
http://example.org/HPL#FinnedHeatExchanger_R_CP_2
  - http://example.org/HPL#FinnedHeatExchanger on http://example.org/HPL#FinnedHeatExchanger_R_CP_2 needs to be a http://data.ashrae.org/standard223#Connectable
http://data.ashrae.org/standard223#Numerical-NumberOfElectricalPhases
  - http://qudt.org/vocab/quantitykind/NumberOfElectricalPhases on http://data.ashrae.org/standard223#Numerical-NumberOfElectricalPhases needs to be a http://qudt.org/schema/qudt/QuantityKind
http://example.org/HPL#FinnedHeatExchanger_A_OCP
  - http://example.org/HPL#FinnedHeatExchanger_A_OCP expected 1 instance(s) of ns2:Connectable on path ns2:isConnectionPointOf
http://data.ashrae.org/standard223#NumberOfElectricalPhases-SinglePhase
  - http://qudt.org/vocab/quantitykind/NumberOfElectricalPhases on http://data.ashrae.org/standard223#NumberOfElectricalPhases-SinglePhase needs to be a http://qudt.org/schema/qudt/QuantityKind
http://example.org/HPL#FinnedHeatExchanger_A_ICP
  - http://example.org/HPL#FinnedHeatExchanger_A_ICP expected 1 instance(s) of ns2:Connectable on path ns2:isConnectionPointOf
http://example.org/HPL#OA_Unit
  - http://example.org/HPL#OA_Unit needs to match one of the following shapes: n81526742c849461eb769b0a147087780b1277, n81526742c849461eb769b0a147087780b1278