-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into dependabot/npm_and_yarn/buildingmotif-app/lo…
…ader-utils-2.0.4
- Loading branch information
Showing
126 changed files
with
12,562 additions
and
2,735 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: build-deploy-docs | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
# If your git repository has the Jupyter Book within some-subfolder next to | ||
# unrelated files, you can make this run only if a file within that specific | ||
# folder has been modified. | ||
# | ||
# paths: | ||
# - some-subfolder/** | ||
|
||
# This job installs dependencies, builds the book, and pushes it to `gh-pages` | ||
jobs: | ||
build-deploy-docs: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Python 3.10 | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: 3.10.4 | ||
|
||
- name: install dependencies | ||
run: | | ||
pip install poetry | ||
poetry install | ||
- name: install project | ||
run: pip install . | ||
|
||
- name: install jupyter book | ||
run: pip install -U jupyter-book | ||
|
||
- name: build jupyter book | ||
working-directory: ${{runner.workspace}}/BuildingMOTIF/docs/ | ||
run: jupyter-book build . | ||
|
||
# TODO can we use an official GitHub Action? https://github.com/actions/deploy-pages | ||
- name: GitHub Pages action | ||
uses: peaceiris/actions-gh-pages@v3.6.1 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: ./docs/_build/html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
BSD 3-Clause License | ||
|
||
Copyright (c) 2022, Alliance for Sustainable Energy, LLC. | ||
All rights reserved. | ||
|
||
NOTICE: This Software was developed under funding from the U.S. Department of | ||
Energy and the U.S. Government consequently retains certain rights. As such, | ||
the U.S. Government has been granted for itself and others acting on its | ||
behalf a paid-up, nonexclusive, irrevocable, worldwide license in the Software | ||
to reproduce, distribute copies to the public, prepare derivative works, and | ||
perform publicly and display publicly, and to permit others to do so. | ||
|
||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions are met: | ||
|
||
1. Redistributions of source code must retain the above copyright notice, this | ||
list of conditions and the following disclaimer. | ||
|
||
2. Redistributions in binary form must reproduce the above copyright notice, | ||
this list of conditions and the following disclaimer in the documentation | ||
and/or other materials provided with the distribution. | ||
|
||
3. Neither the name of the copyright holder nor the names of its | ||
contributors may be used to endorse or promote products derived from | ||
this software without specific prior written permission. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | ||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | ||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | ||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | ||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,87 +1,41 @@ | ||
# BuildingMOTIF | ||
[![Documentation Status](https://readthedocs.org/projects/buildingmotif/badge/?version=latest)](https://buildingmotif.readthedocs.io/en/latest/?badge=latest) | ||
# BuildingMOTIF | ||
|
||
[![codecov](https://codecov.io/gh/NREL/BuildingMOTIF/branch/main/graph/badge.svg?token=HAFSYH45NX)](https://codecov.io/gh/NREL/BuildingMOTIF) | ||
[![Jupyter Book Badge](https://jupyterbook.org/badge.svg)](https://nrel.github.io/BuildingMOTIF/) | ||
|
||
> *Enabling the enabling technology of semantic interoperability.* | ||
Semantic Interoperability in buildings through standardized semantic metadata is crucial to unlocking the value of the abundant and diverse networked data in buildings, avoiding subsequent data incompatibility/interoperability issues, and paving the way for advanced building technologies like Automated Fault Detection and Diagnostics (AFDD), real-time energy optimization, other energy management information systems ([EMIS](https://www.energy.gov/eere/femp/what-are-energy-management-information-systems)), improved HVAC controls, and grid-interactive energy efficient building ([GEB](https://www.energy.gov/eere/buildings/grid-interactive-efficient-buildings)) technologies, all of which are needed to fully de-carbonize buildings. Utilizing the capabilities of [Semantic Web](https://www.w3.org/standards/semanticweb/), it is possible to standardize building metadata in structured, expressive, and machine-readable ways, but at the same time it is very important to make it easier to implement for field practitioners without advanced knowledge in computer science. | ||
|
||
***Building Metadata OnTology Interoperability Framework (BuildingMOTIF)*** bridges that gap between theory and practice, by offering a toolset for building metadata creation, storage, visualization, and validation. It is offered in the form of an SDK with easy-to-use APIs that abstract the underlying complexities of [RDF](https://www.w3.org/RDF/) graphs, database management, [SHACL](https://www.w3.org/TR/shacl/) validation, and interoperability between different metadata schemas/ontologies. It also supports connectors for easier integration with existing metadata sources (e.g., Building Automation System data, design models, existing metadata models, etc.), which are available at different phases of the building life-cycle. | ||
|
||
The objectives of the ***BuildingMOTIF*** toolset are the following: | ||
1. lower costs, reduce installation time, and improve delivered quality of building controls and services for building owners and occupants | ||
2. enable a simpler and more easily verifiable procurement process for products and services for building managers | ||
3. open new business opportunities for service providers, by removing knowledge barriers for parties implementing building controls and services | ||
|
||
Currently, ***BuildingMOTIF*** is planned to support the [Brick Schema](https://brickschema.org/), [Project Haystack](https://project-haystack.org/), and the proposed [ASHRAE Standard 223P](https://www.ashrae.org/about/news/2018/ashrae-s-bacnet-committee-project-haystack-and-brick-schema-collaborating-to-provide-unified-data-semantic-modeling-solution), and to offer both a UI and underlying SDK with tutorials and reference documentation to be useful for different levels of expertise of users for maximum adoption. | ||
|
||
# Documentation | ||
|
||
The documentation uses [Diataxis](https://diataxis.fr/) as a framework for its structure, which is organized into the following sections. | ||
|
||
## Tutorials | ||
|
||
- [Model Creation](https://nrel.github.io/BuildingMOTIF/tutorials/model_creation.html) | ||
- [Model Validation](https://nrel.github.io/BuildingMOTIF/tutorials/model_validation.html) | ||
- [Model Correction](https://nrel.github.io/BuildingMOTIF/tutorials/model_correction.html) | ||
- [Template Writing](https://nrel.github.io/BuildingMOTIF/tutorials/template_writing.html) | ||
|
||
## How-to Guides | ||
|
||
🏗️ under construction | ||
|
||
## Reference | ||
|
||
- [Code Documentation](https://nrel.github.io/BuildingMOTIF/reference/apidoc/index.html) | ||
- [Developer Documentation](https://nrel.github.io/BuildingMOTIF/reference/developer_documentation.html) | ||
|
||
## Explanation | ||
|
||
The Building Metadata OnTology Interoperability Framework (BuildingMOTIF) is a tool for working with the following semantic data models. | ||
|
||
- [ASHRAE 223P](https://www.ashrae.org/about/news/2018/ashrae-s-bacnet-committee-project-haystack-and-brick-schema-collaborating-to-provide-unified-data-semantic-modeling-solution) | ||
- [Brick](https://brickschema.org/) | ||
- [Project Haystack](https://project-haystack.org/) | ||
|
||
# Installing | ||
Install [Python >= 3.8.0](https://www.python.org/downloads/). | ||
``` | ||
pip install buildingmotif | ||
``` | ||
|
||
# Using | ||
See the `notebooks` directory. | ||
|
||
# Developing | ||
1. Install [Python >= 3.8.0](https://www.python.org/downloads/). | ||
2. Install [Poetry](https://python-poetry.org/docs/#installation). | ||
3. Clone, download, or fork this repository. | ||
4. Install dependenices with poetry. | ||
``` | ||
poetry install | ||
poetry run pre-commit install | ||
``` | ||
5. To initialize your database, create your local configs file, enter your db uri, and run the migrations. | ||
``` | ||
cp configs.py.dist configs.py | ||
echo "DB_URI = 'sqlite:////path/to/db.db'" > configs.py | ||
poetry run alembic upgrade head | ||
``` | ||
## Uping the API | ||
``` | ||
poetry run python buildingmotif/api/app.py | ||
``` | ||
API will run on localhost:5000 | ||
## Testing | ||
``` | ||
poetry run pytest | ||
``` | ||
To run tests with DEBUG prints add the `-o log_cli=true` argument to the command | ||
## Formatting | ||
``` | ||
poetry run black . | ||
poetry run isort . | ||
poetry run pylama | ||
``` | ||
## Migrating | ||
After making changes to the tables, you must make a new db migration. | ||
``` | ||
poetry run alembic revision -m "Description of Changes." --autogenerate | ||
``` | ||
Additional changes may need to be made to the migration, so be sure to check it. [Read here](https://alembic.sqlalchemy.org/en/latest/autogenerate.html#auto-generating-migrations) for more information on alembic autogenerate migrations. | ||
## Documenting | ||
Documentation can be built locally with the following command, which will make the HTML files in the `docs/build/html/` directory. | ||
``` | ||
cd docs | ||
poetry run make html | ||
``` | ||
## Building and Publishing | ||
``` | ||
# build and publish test | ||
poetry publish --build --dry-run | ||
|
||
# build and publish | ||
poetry publish --build | ||
``` | ||
## Web App | ||
1. [Download Node.js](https://nodejs.org/en/download/) | ||
2. [Install Angular](https://angular.io/guide/setup-local) | ||
3. See [buildingmotif-app/README.md](buildingmotif-app/README.md) | ||
# Visualizing | ||
![repo-vis](./diagram.svg) | ||
🏗️ under construction |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
buildingmotif-app/src/app/model-new/model-new.component.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
.container { | ||
padding: 3rem; | ||
} | ||
|
||
.new-model-form{ | ||
padding: 3rem; | ||
width: 30rem; | ||
display: flex; | ||
flex-direction: column; | ||
} |
24 changes: 24 additions & 0 deletions
24
buildingmotif-app/src/app/model-new/model-new.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<div class="container"> | ||
<div> New Model </div> | ||
<form class="new-model-form" [formGroup]="newModelForm"> | ||
<mat-form-field appearance="outline" floatLabel="never"> | ||
<input type="text" | ||
aria-label="model name" | ||
placeholder="model name" | ||
matInput | ||
formControlName="nameControl"> | ||
<mat-error *ngIf="newModelForm.get('nameControl')?.hasError('invalidCharacter')"> | ||
cannot contain <, >, ", ^, {, }, |, \, ^, or spaces | ||
</mat-error> | ||
</mat-form-field> | ||
<mat-form-field appearance="outline" floatLabel="never"> | ||
<textarea type="text" | ||
aria-label="model description" | ||
placeholder="model description" | ||
matInput | ||
formControlName="descriptionControl"> | ||
</textarea> | ||
</mat-form-field> | ||
</form> | ||
<button mat-raised-button color="primary" (click)="createModel()" [disabled]="newModelForm.invalid"> New Model </button> | ||
</div> |
Oops, something went wrong.