Skip to content

Commit

Permalink
deploy: 24abd43
Browse files Browse the repository at this point in the history
  • Loading branch information
gtfierro committed Aug 6, 2024
1 parent 73ad733 commit 4ab5c8f
Show file tree
Hide file tree
Showing 77 changed files with 271,368 additions and 268,601 deletions.
11 changes: 11 additions & 0 deletions _sources/examples/NREL-example.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
---
jupytext:
formats: md:myst
text_representation:
extension: .md
format_name: myst
kernelspec:
display_name: Python 3
language: python
name: python3
---
# NREL Example Building

This is an example building provided by the National Renewable Energy Laboratory, built with the [BuildingMOTIF](https://github.com/NREL/BuildingMOTIF) tool.
Expand Down
58 changes: 58 additions & 0 deletions _sources/examples/bdg1-1.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
---
jupytext:
formats: md:myst
text_representation:
extension: .md
format_name: myst
kernelspec:
display_name: Python 3
language: python
name: python3
---
# Example Building 1 model 1

Example Building 1 is a simplistic, reference tiny office building consisting of a single story with 5 rooms spanning 5 space types.
Expand Down Expand Up @@ -69,3 +80,50 @@ The model was created using [TopQuadrant](https://www.topquadrant.com/) TopBraid
| [Property](https://explore.open223.info/s223/Property.html) | [EnumeratedActuatableProperty](https://explore.open223.info/s223/EnumeratedActuatableProperty.html) | 5 |
| [Property](https://explore.open223.info/s223/Property.html) | [EnumeratedObservableProperty](https://explore.open223.info/s223/EnumeratedObservableProperty.html) | 4 |


## Load and Validate Model

This code uses the [BuildingMOTIF](https://github.com/NREL/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
:class: dropdown
To install the `buildingmotif` library, you can use the following command:
```shell
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:
```shell
pip install 'buildingmotif @ git+https://github.com/NREL/buildingmotif.git@develop'
```
````


```{code-cell} ipython3
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-1")
model.graph.parse("https://models.open223.info/compiled/bdg1-1.ttl")
# validate the model against 223P ontology
ctx = model.validate([s223.get_shape_collection()], error_on_missing_imports=False)
if not ctx.valid:
print(ctx.report_string)
```
58 changes: 58 additions & 0 deletions _sources/examples/bdg1-2.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
---
jupytext:
formats: md:myst
text_representation:
extension: .md
format_name: myst
kernelspec:
display_name: Python 3
language: python
name: python3
---
# 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.
Expand Down Expand Up @@ -60,3 +71,50 @@ bdg1:05749166d93671bedf16efb52636ce38 a s223:Luminaire
| [Property](https://explore.open223.info/s223/Property.html) | [QuantifiableProperty](https://explore.open223.info/s223/QuantifiableProperty.html) | 24 |
| [Property](https://explore.open223.info/s223/Property.html) | [EnumeratedObservableProperty](https://explore.open223.info/s223/EnumeratedObservableProperty.html) | 6 |


## Load and Validate Model

This code uses the [BuildingMOTIF](https://github.com/NREL/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
:class: dropdown
To install the `buildingmotif` library, you can use the following command:
```shell
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:
```shell
pip install 'buildingmotif @ git+https://github.com/NREL/buildingmotif.git@develop'
```
````


```{code-cell} ipython3
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/compiled/bdg1-2.ttl")
# validate the model against 223P ontology
ctx = model.validate([s223.get_shape_collection()], error_on_missing_imports=False)
if not ctx.valid:
print(ctx.report_string)
```
58 changes: 58 additions & 0 deletions _sources/examples/design-patterns.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
---
jupytext:
formats: md:myst
text_representation:
extension: .md
format_name: myst
kernelspec:
display_name: Python 3
language: python
name: python3
---
# Design Patterns

This file contains the Turtle code supporting the set of design patterns presented in the User Documentation site, in the section titled ["Modeling Design Patterns"](https://docs.open223.info/guides/design-patterns.html#)
Expand Down Expand Up @@ -31,3 +42,50 @@ The model was created using [TopQuadrant](https://www.topquadrant.com/) TopBraid
| [Property](https://explore.open223.info/s223/Property.html) | [EnumeratedObservableProperty](https://explore.open223.info/s223/EnumeratedObservableProperty.html) | 4 |
| [Property](https://explore.open223.info/s223/Property.html) | [EnumerableProperty](https://explore.open223.info/s223/EnumerableProperty.html) | 3 |


## Load and Validate Model

This code uses the [BuildingMOTIF](https://github.com/NREL/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
:class: dropdown
To install the `buildingmotif` library, you can use the following command:
```shell
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:
```shell
pip install 'buildingmotif @ git+https://github.com/NREL/buildingmotif.git@develop'
```
````


```{code-cell} ipython3
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:design-patterns")
model.graph.parse("https://models.open223.info/compiled/design-patterns.ttl")
# validate the model against 223P ontology
ctx = model.validate([s223.get_shape_collection()], error_on_missing_imports=False)
if not ctx.valid:
print(ctx.report_string)
```
58 changes: 58 additions & 0 deletions _sources/examples/guideline36-2021-A-1.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
---
jupytext:
formats: md:myst
text_representation:
extension: .md
format_name: myst
kernelspec:
display_name: Python 3
language: python
name: python3
---
# ASHRAE Guideline 36-2021 A-1 VAV Terminal Unit, Cooling Only

This component model is an example of the variable air volume (VAV) terminal unit with cooling only from Guideline 36-2021, Appendix A, Figure A-1.
Expand All @@ -21,3 +32,50 @@ This component model is an example of the variable air volume (VAV) terminal uni
| [Property](https://explore.open223.info/s223/Property.html) | [QuantifiableObservableProperty](https://explore.open223.info/s223/QuantifiableObservableProperty.html) | 2 |
| [Property](https://explore.open223.info/s223/Property.html) | [QuantifiableActuatableProperty](https://explore.open223.info/s223/QuantifiableActuatableProperty.html) | 1 |


## Load and Validate Model

This code uses the [BuildingMOTIF](https://github.com/NREL/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
:class: dropdown
To install the `buildingmotif` library, you can use the following command:
```shell
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:
```shell
pip install 'buildingmotif @ git+https://github.com/NREL/buildingmotif.git@develop'
```
````


```{code-cell} ipython3
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:guideline36-2021-A-1")
model.graph.parse("https://models.open223.info/compiled/guideline36-2021-A-1.ttl")
# validate the model against 223P ontology
ctx = model.validate([s223.get_shape_collection()], error_on_missing_imports=False)
if not ctx.valid:
print(ctx.report_string)
```
58 changes: 58 additions & 0 deletions _sources/examples/guideline36-2021-A-2.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
---
jupytext:
formats: md:myst
text_representation:
extension: .md
format_name: myst
kernelspec:
display_name: Python 3
language: python
name: python3
---
# ASHRAE Guideline 36-2021 A-2 VAV Terminal Unit with Reheat

This component model is an example of the variable air volume (VAV) terminal unit with reheat from Guideline 36-2021, Appendix A, Figure A-2.
Expand Down Expand Up @@ -27,3 +38,50 @@ This component model is an example of the variable air volume (VAV) terminal uni
| [Property](https://explore.open223.info/s223/Property.html) | [QuantifiableObservableProperty](https://explore.open223.info/s223/QuantifiableObservableProperty.html) | 4 |
| [Property](https://explore.open223.info/s223/Property.html) | [QuantifiableActuatableProperty](https://explore.open223.info/s223/QuantifiableActuatableProperty.html) | 2 |


## Load and Validate Model

This code uses the [BuildingMOTIF](https://github.com/NREL/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
:class: dropdown
To install the `buildingmotif` library, you can use the following command:
```shell
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:
```shell
pip install 'buildingmotif @ git+https://github.com/NREL/buildingmotif.git@develop'
```
````


```{code-cell} ipython3
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:guideline36-2021-A-2")
model.graph.parse("https://models.open223.info/compiled/guideline36-2021-A-2.ttl")
# validate the model against 223P ontology
ctx = model.validate([s223.get_shape_collection()], error_on_missing_imports=False)
if not ctx.valid:
print(ctx.report_string)
```
Loading

0 comments on commit 4ab5c8f

Please sign in to comment.