Hasty 
A web app to create and edit semantic metadata models of buildings with the following schemas.
- Brick
- Project Haystack
- ASHRAE Standard 223P (future)
Installing
With Docker
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 upfor first time startup
Run Server
- Start
docker compose start - Stop
docker compose stop - Tests
docker compose run web pytest
Reset Procedure
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
Containers
hasty-web
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.
hasty-db
Postgres database container. Data is stored in hasty_pg_data volume.
Running
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
pointProtoswebpage) - 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 makemigrationspython manage.py migrate --run-syncdb
Now the server can be run:
python manage.py runserver
TODO:
- Create migrations for mappings between Brick Classes <-> Haystack Point Tagsets
- Create migrations for equipment templates
- Create migrations for fault templates
Understanding Mappings
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
Third-Party Licenses
This project utilizes code written by Patrick Coffey under an MIT license.