Model Inference#
Note
The purpose of this tutorial is to show how SHACL inference applied to a 223 model can make models easier to write and query. Specifically, this tutorial will teach the following:
How to load SHACL inference rules defined in the 223 ontology into memory
How to apply SHACL inference rules to a 223 model to add all “implied” triples
For this tutorial, we’ll use an existing equipment model of a variable air volume (VAV) terminal unit with cooling only from section 4.1 of ASHRAE Guideline 36-2021. This and other example models are available from Open223 Models.
What are SHACL Rules?#
SHACL rules add implied information to graphs if certain conditions are met, i.e. if certain triples exist in the source graph. The process of applying rules to an input model to generate new information (triples) is called inference. Inference makes models easier to write because the model author does not have to manually include all the triples necessary to support the desired queries; instead, some of those useful triples can be added “automatically” to the model through the use of inferencing. One way to think of inference is a way of normalizing a 223 model. Inference assures that the expected properties, types, and other annotations are present so that consumers of the model can make assumptions about what information will be contained within the graph.
Model Parsing#
First, we’ll create a new empty graph then parse (load) an existing graph into it using the Python RDFLib library.
from rdflib import Graph
# Create a Graph
model = Graph()
# Parse in an RDF file hosted on the Internet
model.parse("https://models.open223.info/guideline36-2021-A-1.ttl", format="ttl")
print(f"The model contains {len(model)} triples")
The model contains 102 triples
Turtle representation of the model (pre-inference)
print(model.serialize())
@prefix g36: <http://data.ashrae.org/standard223/1.0/extensions/g36#> .
@prefix mysystem: <http://data.ashrae.org/standard223/1.0/data/guideline36-2021-A-1#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix qudt: <http://qudt.org/schema/qudt/> .
@prefix qudtqk: <http://qudt.org/vocab/quantitykind/> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix s223: <http://data.ashrae.org/standard223#> .
@prefix unit: <http://qudt.org/vocab/unit/> .
mysystem: a owl:Ontology ;
rdfs:label "" ;
owl:imports <http://data.ashrae.org/standard223/1.0/model/all> .
mysystem:PhysicalSpace a s223:PhysicalSpace ;
rdfs:label "Physicalspace" ;
s223:encloses mysystem:PhysicalSpace-hvac-domain .
mysystem:VAVCoolingOnly a s223:SingleDuctTerminal,
g36:VAV ;
rdfs:label "Vavcoolingonly" ;
s223:cnx mysystem:VAVCoolingOnly-in,
mysystem:VAVCoolingOnly-out ;
s223:contains mysystem:VAVCoolingOnly-damper .
mysystem:VAVCoolingOnly-damper-actuator a s223:Actuator ;
rdfs:label "Vavcoolingonly Damper Actuator" ;
s223:actuatedByProperty mysystem:VAVCoolingOnly-damper-command ;
s223:actuates mysystem:VAVCoolingOnly-damper .
mysystem:VAVCoolingOnly-discharge-air-flow-sensor a s223:Sensor ;
rdfs:label "Vavcoolingonly Discharge Air Flow Sensor" ;
s223:hasObservationLocation mysystem:VAVCoolingOnly-out ;
s223:observes mysystem:VAVCoolingOnly-discharge-air-flow .
mysystem:VAVCoolingOnly-duct-after-damper a s223:Connection,
s223:Duct ;
rdfs:label "Vavcoolingonly Duct After Damper" ;
s223:hasMedium s223:Fluid-Air .
mysystem:VAVCoolingOnly-duct-before-damper a s223:Connection,
s223:Duct ;
rdfs:label "Vavcoolingonly Duct Before Damper" ;
s223:hasMedium s223:Fluid-Air .
mysystem:zone a s223:Zone,
g36:Zone ;
rdfs:label "Zone" ;
s223:hasDomain s223:Domain-HVAC ;
s223:hasDomainSpace mysystem:PhysicalSpace-hvac-domain ;
s223:hasProperty mysystem:zone-co2-concentration,
mysystem:zone-temp .
mysystem:PhysicalSpace-hvac-domain-in a s223:InletConnectionPoint ;
rdfs:label "Physicalspace Hvac Domain In" ;
s223:cnx mysystem:vav-supply-to-room-connection ;
s223:hasMedium s223:Fluid-Air .
mysystem:PhysicalSpace-hvac-domain-out a s223:OutletConnectionPoint ;
rdfs:label "Physicalspace Hvac Domain Out" ;
s223:cnx mysystem:room-return-to-vav-connection ;
s223:hasMedium s223:Fluid-Air .
mysystem:VAVCoolingOnly-damper-in a s223:InletConnectionPoint ;
rdfs:label "Vavcoolingonly Damper In" ;
s223:hasMedium s223:Fluid-Air ;
s223:mapsTo mysystem:VAVCoolingOnly-in .
mysystem:VAVCoolingOnly-damper-out a s223:OutletConnectionPoint ;
rdfs:label "Vavcoolingonly Damper Out" ;
s223:hasMedium s223:Fluid-Air ;
s223:mapsTo mysystem:VAVCoolingOnly-out .
mysystem:VAVCoolingOnly-damper-position a s223:QuantifiableObservableProperty ;
rdfs:label "Vavcoolingonly Damper Position" ;
qudt:hasQuantityKind qudtqk:DimensionlessRatio ;
qudt:hasUnit unit:PERCENT .
mysystem:zone-co2-concentration a s223:QuantifiableObservableProperty ;
rdfs:label "Zone Co2 Concentration" ;
s223:ofMedium s223:Fluid-Air ;
s223:ofSubstance s223:Constituent-CO2 ;
qudt:hasQuantityKind qudtqk:MoleFraction ;
qudt:hasUnit unit:PPM .
mysystem:zone-temp a s223:QuantifiableObservableProperty ;
rdfs:label "Zone Temp" ;
qudt:hasQuantityKind qudtqk:Temperature ;
qudt:hasUnit unit:DEG_C .
mysystem:PhysicalSpace-hvac-domain a s223:DomainSpace ;
rdfs:label "Physicalspace Hvac Domain" ;
s223:cnx mysystem:PhysicalSpace-hvac-domain-in,
mysystem:PhysicalSpace-hvac-domain-out ;
s223:hasDomain s223:Domain-HVAC .
mysystem:VAVCoolingOnly-damper a s223:Damper,
g36:Damper ;
rdfs:label "Vavcoolingonly Damper" ;
s223:cnx mysystem:VAVCoolingOnly-damper-in,
mysystem:VAVCoolingOnly-damper-out ;
s223:hasProperty mysystem:VAVCoolingOnly-damper-command,
mysystem:VAVCoolingOnly-damper-position .
mysystem:VAVCoolingOnly-damper-command a s223:QuantifiableActuatableProperty ;
rdfs:label "Vavcoolingonly Damper Command" ;
s223:hasAspect s223:Binary-Position ;
qudt:hasQuantityKind qudtqk:DimensionlessRatio ;
qudt:hasUnit unit:PERCENT .
mysystem:VAVCoolingOnly-discharge-air-flow a s223:QuantifiableObservableProperty ;
rdfs:label "Vavcoolingonly Discharge Air Flow" ;
s223:hasAspect s223:Role-Discharge ;
qudt:hasQuantityKind qudtqk:VolumeFlowRate ;
qudt:hasUnit unit:FT3-PER-MIN .
mysystem:VAVCoolingOnly-in a s223:InletConnectionPoint ;
rdfs:label "Vavcoolingonly In" ;
s223:cnx mysystem:room-return-to-vav-connection ;
s223:hasMedium s223:Fluid-Air .
mysystem:room-return-to-vav-connection a s223:Connection ;
rdfs:label "Room Return To Vav Connection" ;
s223:hasMedium s223:Fluid-Air .
mysystem:vav-supply-to-room-connection a s223:Connection ;
rdfs:label "Vav Supply To Room Connection" ;
s223:hasMedium s223:Fluid-Air .
mysystem:VAVCoolingOnly-out a s223:OutletConnectionPoint ;
rdfs:label "Vavcoolingonly Out" ;
s223:cnx mysystem:vav-supply-to-room-connection ;
s223:hasMedium s223:Fluid-Air ;
s223:hasProperty mysystem:VAVCoolingOnly-discharge-air-flow .
Testing the Model (Failed Query)#
Below, we try to run a simple query on our model which asks what the terminal unit is connected to.
The s223:connected
relationship does not exist in the pre-inference model, so this query will not return results.
parts_query = """
PREFIX bldg: <http://data.ashrae.org/standard223/1.0/data/guideline36-2021-A-1#>
PREFIX s223: <http://data.ashrae.org/standard223#>
SELECT ?physical_space WHERE {
bldg:VAVCoolingOnly s223:connected ?physical_space .
}"""
for row in model.query(parts_query):
print('\t'.join(row))
Loading the 223 Ontology#
The 223 ontology contains the rules we will use for inference. We will load the 223 ontology into a separate graph from the model. This is mostly for maintenance: it is easy enough to merge two graphs together into one, but it is much harder to factor them out again. By keeping the ontology graph separate from the model graph, we can more easily maintain and version those graphs individually.
from rdflib import Graph
# Create a Graph
s223 = Graph()
# Parse in a recent copy of the 223 ontology
s223.parse("https://query.open223.info/ontologies/223p.ttl")
<Graph identifier=Nfcfc36bc5e5c4348bb5fa8cf6193452c (<class 'rdflib.graph.Graph'>)>
Applying Inference Rules#
To apply inference rules, we need an inference engine. This is a piece of software which knows how to properly interpret and apply the SHACL rules defined in an ontology. There are multiple closed-source and open-source implementations of SHACL available; some of these are listed on this page Below, we will be using the open-source PySHACL library.
We import the PySHACL library and then invoke the validate
function on our model graph (data graph in PySHACL parlance)
and our 223 graph (shape graph in PySHACL parlance).
We run this several times to ensure that all the rules are applied.
import pyshacl
combined = model+s223
for _ in range(3):
pyshacl.validate(combined,
allow_infos=True, # don't fail if we get an INFO message
allow_warnings=True, # don't fail if we get a WARNING message
abort_on_first=False, # allow errors to happen during execution
advanced=True, # allow SHACL rules to execute
iterate_rules=True, # allow rules to be applied multiple times
inplace=True # update the 'model' object with the inferred triples
)
# remove the s223 graph from the model
model = combined - s223
print(f"The model now contains {len(model)} triples")
The model now contains 146 triples
This may take a few minutes to run, depending on the size of your model. If the PySHACL library is too slow, we recommend looking at alternate open-source implementations like TopQuadrant’s Java-based implementation.
We can see from the print statement that several triples have been added to the model.
Note
The pyshacl.validate
function actually returns a SHACL validation report which can be used to fix
the model and make it compatible with the 223 ontology. See the Model Validation
tutorial for how to access and interpret this report.
Turtle representation of the model (post-inference)
print(model.serialize())
@prefix ns1: <http://data.ashrae.org/standard223#> .
@prefix ns2: <http://qudt.org/schema/qudt/> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
<http://data.ashrae.org/standard223/1.0/data/guideline36-2021-A-1#> a owl:Ontology ;
rdfs:label "" ;
owl:imports <http://data.ashrae.org/standard223/1.0/model/all> .
<http://data.ashrae.org/standard223/1.0/data/guideline36-2021-A-1#PhysicalSpace> a ns1:PhysicalSpace ;
rdfs:label "Physicalspace" ;
ns1:encloses <http://data.ashrae.org/standard223/1.0/data/guideline36-2021-A-1#PhysicalSpace-hvac-domain> .
<http://data.ashrae.org/standard223/1.0/data/guideline36-2021-A-1#VAVCoolingOnly-damper-actuator> a ns1:Actuator ;
rdfs:label "Vavcoolingonly Damper Actuator" ;
ns1:actuatedByProperty <http://data.ashrae.org/standard223/1.0/data/guideline36-2021-A-1#VAVCoolingOnly-damper-command> ;
ns1:actuates <http://data.ashrae.org/standard223/1.0/data/guideline36-2021-A-1#VAVCoolingOnly-damper> .
<http://data.ashrae.org/standard223/1.0/data/guideline36-2021-A-1#VAVCoolingOnly-discharge-air-flow-sensor> a ns1:Sensor ;
rdfs:label "Vavcoolingonly Discharge Air Flow Sensor" ;
ns1:hasObservationLocation <http://data.ashrae.org/standard223/1.0/data/guideline36-2021-A-1#VAVCoolingOnly-out> ;
ns1:observes <http://data.ashrae.org/standard223/1.0/data/guideline36-2021-A-1#VAVCoolingOnly-discharge-air-flow> .
<http://data.ashrae.org/standard223/1.0/data/guideline36-2021-A-1#VAVCoolingOnly-duct-after-damper> a ns1:Connection,
ns1:Duct ;
rdfs:label "Vavcoolingonly Duct After Damper" ;
ns1:hasMedium ns1:Fluid-Air .
<http://data.ashrae.org/standard223/1.0/data/guideline36-2021-A-1#VAVCoolingOnly-duct-before-damper> a ns1:Connection,
ns1:Duct ;
rdfs:label "Vavcoolingonly Duct Before Damper" ;
ns1:hasMedium ns1:Fluid-Air .
<http://data.ashrae.org/standard223/1.0/data/guideline36-2021-A-1#zone> a ns1:Zone,
<http://data.ashrae.org/standard223/1.0/extensions/g36#Zone> ;
rdfs:label "Zone" ;
ns1:hasDomain ns1:Domain-HVAC ;
ns1:hasDomainSpace <http://data.ashrae.org/standard223/1.0/data/guideline36-2021-A-1#PhysicalSpace-hvac-domain> ;
ns1:hasProperty <http://data.ashrae.org/standard223/1.0/data/guideline36-2021-A-1#zone-co2-concentration>,
<http://data.ashrae.org/standard223/1.0/data/guideline36-2021-A-1#zone-temp> .
<http://data.ashrae.org/standard223/1.0/data/guideline36-2021-A-1#VAVCoolingOnly-damper-position> a ns1:QuantifiableObservableProperty ;
rdfs:label "Vavcoolingonly Damper Position" ;
ns2:hasQuantityKind <http://qudt.org/vocab/quantitykind/DimensionlessRatio> ;
ns2:hasUnit <http://qudt.org/vocab/unit/PERCENT> .
<http://data.ashrae.org/standard223/1.0/data/guideline36-2021-A-1#zone-co2-concentration> a ns1:QuantifiableObservableProperty ;
rdfs:label "Zone Co2 Concentration" ;
ns1:ofMedium ns1:Fluid-Air ;
ns1:ofSubstance ns1:Constituent-CO2 ;
ns2:hasQuantityKind <http://qudt.org/vocab/quantitykind/MoleFraction> ;
ns2:hasUnit <http://qudt.org/vocab/unit/PPM> .
<http://data.ashrae.org/standard223/1.0/data/guideline36-2021-A-1#zone-temp> a ns1:QuantifiableObservableProperty ;
rdfs:label "Zone Temp" ;
ns2:hasQuantityKind <http://qudt.org/vocab/quantitykind/Temperature> ;
ns2:hasUnit <http://qudt.org/vocab/unit/DEG_C> .
<http://data.ashrae.org/standard223/1.0/data/guideline36-2021-A-1#VAVCoolingOnly-damper-command> a ns1:QuantifiableActuatableProperty ;
rdfs:label "Vavcoolingonly Damper Command" ;
ns1:hasAspect ns1:Binary-Position ;
ns2:hasQuantityKind <http://qudt.org/vocab/quantitykind/DimensionlessRatio> ;
ns2:hasUnit <http://qudt.org/vocab/unit/PERCENT> .
<http://data.ashrae.org/standard223/1.0/data/guideline36-2021-A-1#VAVCoolingOnly-damper-in> a ns1:InletConnectionPoint ;
rdfs:label "Vavcoolingonly Damper In" ;
ns1:cnx <http://data.ashrae.org/standard223/1.0/data/guideline36-2021-A-1#VAVCoolingOnly-damper> ;
ns1:hasMedium ns1:Fluid-Air ;
ns1:isConnectionPointOf <http://data.ashrae.org/standard223/1.0/data/guideline36-2021-A-1#VAVCoolingOnly-damper> ;
ns1:mapsTo <http://data.ashrae.org/standard223/1.0/data/guideline36-2021-A-1#VAVCoolingOnly-in> .
<http://data.ashrae.org/standard223/1.0/data/guideline36-2021-A-1#VAVCoolingOnly-damper-out> a ns1:OutletConnectionPoint ;
rdfs:label "Vavcoolingonly Damper Out" ;
ns1:cnx <http://data.ashrae.org/standard223/1.0/data/guideline36-2021-A-1#VAVCoolingOnly-damper> ;
ns1:hasMedium ns1:Fluid-Air ;
ns1:isConnectionPointOf <http://data.ashrae.org/standard223/1.0/data/guideline36-2021-A-1#VAVCoolingOnly-damper> ;
ns1:mapsTo <http://data.ashrae.org/standard223/1.0/data/guideline36-2021-A-1#VAVCoolingOnly-out> .
<http://data.ashrae.org/standard223/1.0/data/guideline36-2021-A-1#VAVCoolingOnly-discharge-air-flow> a ns1:QuantifiableObservableProperty ;
rdfs:label "Vavcoolingonly Discharge Air Flow" ;
ns1:hasAspect ns1:Role-Discharge ;
ns2:hasQuantityKind <http://qudt.org/vocab/quantitykind/VolumeFlowRate> ;
ns2:hasUnit <http://qudt.org/vocab/unit/FT3-PER-MIN> .
<http://data.ashrae.org/standard223/1.0/data/guideline36-2021-A-1#PhysicalSpace-hvac-domain-in> a ns1:InletConnectionPoint ;
rdfs:label "Physicalspace Hvac Domain In" ;
ns1:cnx <http://data.ashrae.org/standard223/1.0/data/guideline36-2021-A-1#PhysicalSpace-hvac-domain>,
<http://data.ashrae.org/standard223/1.0/data/guideline36-2021-A-1#vav-supply-to-room-connection> ;
ns1:connectsThrough <http://data.ashrae.org/standard223/1.0/data/guideline36-2021-A-1#vav-supply-to-room-connection> ;
ns1:hasMedium ns1:Fluid-Air ;
ns1:isConnectionPointOf <http://data.ashrae.org/standard223/1.0/data/guideline36-2021-A-1#PhysicalSpace-hvac-domain> .
<http://data.ashrae.org/standard223/1.0/data/guideline36-2021-A-1#PhysicalSpace-hvac-domain-out> a ns1:OutletConnectionPoint ;
rdfs:label "Physicalspace Hvac Domain Out" ;
ns1:cnx <http://data.ashrae.org/standard223/1.0/data/guideline36-2021-A-1#PhysicalSpace-hvac-domain>,
<http://data.ashrae.org/standard223/1.0/data/guideline36-2021-A-1#room-return-to-vav-connection> ;
ns1:connectsThrough <http://data.ashrae.org/standard223/1.0/data/guideline36-2021-A-1#room-return-to-vav-connection> ;
ns1:hasMedium ns1:Fluid-Air ;
ns1:isConnectionPointOf <http://data.ashrae.org/standard223/1.0/data/guideline36-2021-A-1#PhysicalSpace-hvac-domain> .
<http://data.ashrae.org/standard223/1.0/data/guideline36-2021-A-1#VAVCoolingOnly-in> a ns1:InletConnectionPoint ;
rdfs:label "Vavcoolingonly In" ;
ns1:cnx <http://data.ashrae.org/standard223/1.0/data/guideline36-2021-A-1#VAVCoolingOnly>,
<http://data.ashrae.org/standard223/1.0/data/guideline36-2021-A-1#room-return-to-vav-connection> ;
ns1:connectsThrough <http://data.ashrae.org/standard223/1.0/data/guideline36-2021-A-1#room-return-to-vav-connection> ;
ns1:hasMedium ns1:Fluid-Air ;
ns1:isConnectionPointOf <http://data.ashrae.org/standard223/1.0/data/guideline36-2021-A-1#VAVCoolingOnly> .
<http://data.ashrae.org/standard223/1.0/data/guideline36-2021-A-1#VAVCoolingOnly-damper> a ns1:Damper,
<http://data.ashrae.org/standard223/1.0/extensions/g36#Damper> ;
rdfs:label "Vavcoolingonly Damper" ;
ns1:cnx <http://data.ashrae.org/standard223/1.0/data/guideline36-2021-A-1#VAVCoolingOnly-damper-in>,
<http://data.ashrae.org/standard223/1.0/data/guideline36-2021-A-1#VAVCoolingOnly-damper-out> ;
ns1:hasConnectionPoint <http://data.ashrae.org/standard223/1.0/data/guideline36-2021-A-1#VAVCoolingOnly-damper-in>,
<http://data.ashrae.org/standard223/1.0/data/guideline36-2021-A-1#VAVCoolingOnly-damper-out> ;
ns1:hasProperty <http://data.ashrae.org/standard223/1.0/data/guideline36-2021-A-1#VAVCoolingOnly-damper-command>,
<http://data.ashrae.org/standard223/1.0/data/guideline36-2021-A-1#VAVCoolingOnly-damper-position> .
<http://data.ashrae.org/standard223/1.0/data/guideline36-2021-A-1#VAVCoolingOnly-out> a ns1:OutletConnectionPoint ;
rdfs:label "Vavcoolingonly Out" ;
ns1:cnx <http://data.ashrae.org/standard223/1.0/data/guideline36-2021-A-1#VAVCoolingOnly>,
<http://data.ashrae.org/standard223/1.0/data/guideline36-2021-A-1#vav-supply-to-room-connection> ;
ns1:connectsThrough <http://data.ashrae.org/standard223/1.0/data/guideline36-2021-A-1#vav-supply-to-room-connection> ;
ns1:hasMedium ns1:Fluid-Air ;
ns1:hasProperty <http://data.ashrae.org/standard223/1.0/data/guideline36-2021-A-1#VAVCoolingOnly-discharge-air-flow> ;
ns1:isConnectionPointOf <http://data.ashrae.org/standard223/1.0/data/guideline36-2021-A-1#VAVCoolingOnly> .
<http://data.ashrae.org/standard223/1.0/data/guideline36-2021-A-1#room-return-to-vav-connection> a ns1:Connection ;
rdfs:label "Room Return To Vav Connection" ;
ns1:cnx <http://data.ashrae.org/standard223/1.0/data/guideline36-2021-A-1#PhysicalSpace-hvac-domain-out>,
<http://data.ashrae.org/standard223/1.0/data/guideline36-2021-A-1#VAVCoolingOnly-in> ;
ns1:connectsAt <http://data.ashrae.org/standard223/1.0/data/guideline36-2021-A-1#PhysicalSpace-hvac-domain-out>,
<http://data.ashrae.org/standard223/1.0/data/guideline36-2021-A-1#VAVCoolingOnly-in> ;
ns1:connectsFrom <http://data.ashrae.org/standard223/1.0/data/guideline36-2021-A-1#PhysicalSpace-hvac-domain> ;
ns1:connectsTo <http://data.ashrae.org/standard223/1.0/data/guideline36-2021-A-1#VAVCoolingOnly> ;
ns1:hasMedium ns1:Fluid-Air .
<http://data.ashrae.org/standard223/1.0/data/guideline36-2021-A-1#vav-supply-to-room-connection> a ns1:Connection ;
rdfs:label "Vav Supply To Room Connection" ;
ns1:cnx <http://data.ashrae.org/standard223/1.0/data/guideline36-2021-A-1#PhysicalSpace-hvac-domain-in>,
<http://data.ashrae.org/standard223/1.0/data/guideline36-2021-A-1#VAVCoolingOnly-out> ;
ns1:connectsAt <http://data.ashrae.org/standard223/1.0/data/guideline36-2021-A-1#PhysicalSpace-hvac-domain-in>,
<http://data.ashrae.org/standard223/1.0/data/guideline36-2021-A-1#VAVCoolingOnly-out> ;
ns1:connectsFrom <http://data.ashrae.org/standard223/1.0/data/guideline36-2021-A-1#VAVCoolingOnly> ;
ns1:connectsTo <http://data.ashrae.org/standard223/1.0/data/guideline36-2021-A-1#PhysicalSpace-hvac-domain> ;
ns1:hasMedium ns1:Fluid-Air .
<http://data.ashrae.org/standard223/1.0/data/guideline36-2021-A-1#VAVCoolingOnly> a ns1:SingleDuctTerminal,
<http://data.ashrae.org/standard223/1.0/extensions/g36#VAV> ;
rdfs:label "Vavcoolingonly" ;
ns1:cnx <http://data.ashrae.org/standard223/1.0/data/guideline36-2021-A-1#VAVCoolingOnly-in>,
<http://data.ashrae.org/standard223/1.0/data/guideline36-2021-A-1#VAVCoolingOnly-out> ;
ns1:connected <http://data.ashrae.org/standard223/1.0/data/guideline36-2021-A-1#PhysicalSpace-hvac-domain> ;
ns1:connectedFrom <http://data.ashrae.org/standard223/1.0/data/guideline36-2021-A-1#PhysicalSpace-hvac-domain> ;
ns1:connectedThrough <http://data.ashrae.org/standard223/1.0/data/guideline36-2021-A-1#room-return-to-vav-connection>,
<http://data.ashrae.org/standard223/1.0/data/guideline36-2021-A-1#vav-supply-to-room-connection> ;
ns1:connectedTo <http://data.ashrae.org/standard223/1.0/data/guideline36-2021-A-1#PhysicalSpace-hvac-domain> ;
ns1:contains <http://data.ashrae.org/standard223/1.0/data/guideline36-2021-A-1#VAVCoolingOnly-damper> ;
ns1:hasConnectionPoint <http://data.ashrae.org/standard223/1.0/data/guideline36-2021-A-1#VAVCoolingOnly-in>,
<http://data.ashrae.org/standard223/1.0/data/guideline36-2021-A-1#VAVCoolingOnly-out> .
<http://data.ashrae.org/standard223/1.0/data/guideline36-2021-A-1#PhysicalSpace-hvac-domain> a ns1:DomainSpace ;
rdfs:label "Physicalspace Hvac Domain" ;
ns1:cnx <http://data.ashrae.org/standard223/1.0/data/guideline36-2021-A-1#PhysicalSpace-hvac-domain-in>,
<http://data.ashrae.org/standard223/1.0/data/guideline36-2021-A-1#PhysicalSpace-hvac-domain-out> ;
ns1:connected <http://data.ashrae.org/standard223/1.0/data/guideline36-2021-A-1#VAVCoolingOnly> ;
ns1:connectedFrom <http://data.ashrae.org/standard223/1.0/data/guideline36-2021-A-1#VAVCoolingOnly> ;
ns1:connectedThrough <http://data.ashrae.org/standard223/1.0/data/guideline36-2021-A-1#room-return-to-vav-connection>,
<http://data.ashrae.org/standard223/1.0/data/guideline36-2021-A-1#vav-supply-to-room-connection> ;
ns1:connectedTo <http://data.ashrae.org/standard223/1.0/data/guideline36-2021-A-1#VAVCoolingOnly> ;
ns1:hasConnectionPoint <http://data.ashrae.org/standard223/1.0/data/guideline36-2021-A-1#PhysicalSpace-hvac-domain-in>,
<http://data.ashrae.org/standard223/1.0/data/guideline36-2021-A-1#PhysicalSpace-hvac-domain-out> ;
ns1:hasDomain ns1:Domain-HVAC .
Using the New Model#
To demonstrate that the model contains new triples, we can try re-running the query from before. We can see that the query returns results this time.
query = """
PREFIX bldg: <http://data.ashrae.org/standard223/1.0/data/guideline36-2021-A-1#>
PREFIX s223: <http://data.ashrae.org/standard223#>
SELECT ?physical_space WHERE {
bldg:VAVCoolingOnly s223:connected ?physical_space .
}"""
for row in model.query(query):
print('\t'.join(row))
http://data.ashrae.org/standard223/1.0/data/guideline36-2021-A-1#PhysicalSpace-hvac-domain