A web app to create and edit semantic metadata models of buildings with the following schemas.
- Brick
- Project Haystack
- ASHRAE Standard 223P (future)
The following dependencies are required:
Project Setup:
- Navigate to project root
- Set postgres name, username, and password in
.env
- Build Docker images
docker compose build
- Create and run containers
docker compose up
for first time startup
- Start
docker compose start
- Stop
docker compose stop
- Tests
docker compose run web pytest
If the environment gets messed up this is what you need to start from scratch again.
- Stop and remove containers and volumes
docker compose down -v
Django server container responsible for serving webpages and managing app. This container reads code from the working directory of the repo and will auto update on changes.
Postgres database container. Data is stored in hasty_pg_data
volume.
After installation is complete, the web app can be run. We have committed migrations in order to populate the following:
- Versions: Only Haystack 3.9.9 and Brick 1.1 are supported at this time
- Haystack marker tags:
q = "SELECT ?m WHERE { ?m rdfs:subClassOf* ph:marker}"
- Brick tags
- Haystack Point tagsets: (generated using Haystack's
pointProtos
webpage) - Brick Point classes:
q = "SELECT ?p WHERE { ?p rdfs:subClassOf* brick:Point}"
- Haystack Equipment types:
q = "SELECT ?m WHERE { ?m rdfs:subClassOf* phIoT:equip }"
Before starting the server, make sure to do the following:
python manage.py makemigrations
python manage.py migrate --run-syncdb
Now the server can be run:
python manage.py runserver
- Create migrations for mappings between Brick Classes <-> Haystack Point Tagsets
- Create migrations for equipment templates
- Create migrations for fault templates
Point protos in Project Haystack are mapped to Brick Classes at different release versions. The mapping happens via use of the py-brickschema package, which means that there are three 'versions' to consider when a mapping is made:
- Haystack Version
- Brick Version (although this is currently embedded as part of the py-brickschema package)
- py-brickschema Version
This project utilizes code written by Patrick Coffey under an MIT license.