Skip to content

Latest commit

 

History

History
173 lines (139 loc) · 9.39 KB

README.md

File metadata and controls

173 lines (139 loc) · 9.39 KB

Building Envelopes Data

This specification of an Application Programming Interface (API) is designed to facilitate the exchange of data about building envelopes. It consists of GraphQL schemas to specify a GraphQL endpoint and JSON Schemas to specify the format of the responses. GraphQL schemas are in the directory ./apis and example GraphQL queries in the directory ./queries. JSON schemas are in the directory ./schemas and example JSON files in the directory ./examples. The directory ./tests/valid provides test JSON files that are supposed to be valid and the directory ./tests/invalid JSON files that are supposed to be invalid.

The following introduction explains the structure for new users and the section "On your Linux machine" explains how you can work with the API specification.

Table Of Contents

I don't want to read this whole thing, I just have a question!!!

Introduction

How to use this repository

Code of Conduct

How to contribute

I don't want to read this whole thing, I just have a question!!!

Please read this README.md and search our wiki and the existing issues for the answer.

If you don't find the answer there, please raise a new issue and add the tag question.

Introduction

The example JSON files ./examples present examples of data formatted according to the JSON schemas and could be part of the response of a GraphQL endpoint. For example, nearnormalHemisphericalSolarReflectanceAccordingToStandard.json is an example of data about a component with an identifier and an optical data set.

Like all data about components, the example is valid against the schema component.json which references optical.json, calorimetric.json and more. In this way, metadata about one component can be exchanged as well as optical data, calorimetric data and more about this component.

An optical data set can include metadata like the standard according to which the optical data was determined. The pure optical data is formatted according to opticalData.json, because optical.json references opticalData.json.

Similarly, calorimetric.json defines the metadata about a calorimetric data set and refers to calorimetricData.json for the pure calorimetric data which is illustrated by the example bistMeasurement.json.

How to use this repository

For beginners

With you web browser, you can search our wiki, the issues and pull requests and contribute to them.

In order to browse the code conveniently, you should first clone the repository and then use a text editor, for example Visual Studio Code.

On your Linux machine

In order to use our development tooling, for example, to format code and to run tests, follow the instructions below.

  1. Open your favorite shell, for example, good old Bourne Again SHell, aka, bash, the somewhat newer Z shell, aka, zsh, or shiny new fish.
  2. Install Git by running
    sudo apt install git-all
    on Debian-based distributions like Ubuntu, or
    sudo dnf install git
    on Fedora and closely-related RPM-Package-Manager-based distributions like CentOS. For further information see Installing Git.
  3. Clone the source code by running
    git clone [email protected]:ise621/building-envelope-data.git
    and navigate into the new directory building-envelope-data by running
    cd building-envelope-data

With Docker

  1. Install Docker Desktop, and GNU Make.
  2. List all GNU Make targets by running
    make help
    The targets name, tag, build, remove, run, shell, remove-containers, remove-volumes, and serve can be used to interface with Docker. The other ones can be used within bash inside a Docker container:
    • compile validates the JSON schemas against the JSON Schema meta-schemas and the GraphQL schemas against the GrahpQL specification,
    • test validates the tests against the schemas,
    • example validates the examples against the schemas,
    • format formats source files,
    • introspect introspects the GraphQL schemas,
    • dos2unix converts Windows-style to UNIX-style line endings,
    • install-tools installs development tools, and
    • update-tools updates development tools to the latest compatible minor versions.
  3. Drop into bash with the working directory /app, which is mounted to the host's working directory, inside a fresh Docker container based on Debian Linux everything installed by running
    make shell
    If necessary, the Docker image is (re)built automatically, which takes a while the first time.
  4. Do something with the project like validating the schemas by running
    make compile
  5. Drop out of the container by running
    exit
    or pressing Ctrl-D.

Without Docker

  1. Install GNU Bash, GNU Make, and npm.
  2. Install the development tools in package.json by running
    make install-tools
    
    which in particular installs the command-line interface for Another JSON Schema Validator (AJV), namely ajv-cli as Node package to be executed through npx, for example,
    npx ajv --help
    
  3. Drop into bash.
  4. Do something with the project as elaborated above.

Note that another POSIX-compatible shell than GNU Bash should also do. See also the POSIX specification and the POSIX FAQ.

Also note that GNU Make takes the shell from the variable SHELL or, if not set, the program /bin/sh. See Choosing the Shell

Code of Conduct

Our Code of Conduct is the guideline of our collaboration.

How to contribute

If you are interested to contribute by questions, reporting bugs or suggesting enhancements, please see CONTRIBUTING.md for further details.