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.
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
.
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.
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.
In order to use our development tooling, for example, to format code and to run tests, follow the instructions below.
- Open your
favorite shell,
for example, good old
Bourne Again SHell, aka,
bash
, the somewhat newer Z shell, aka,zsh
, or shiny newfish
. - Install Git by running
on Debian-based distributions like Ubuntu, or
sudo apt install git-all
on Fedora and closely-related RPM-Package-Manager-based distributions like CentOS. For further information see Installing Git.sudo dnf install git
- Clone the source code by running
and navigate into the new directory
git clone [email protected]:ise621/building-envelope-data.git
building-envelope-data
by runningcd building-envelope-data
- Install Docker Desktop, and GNU Make.
- List all GNU Make targets by running
The targets
make help
name
,tag
,build
,remove
,run
,shell
,remove-containers
,remove-volumes
, andserve
can be used to interface with Docker. The other ones can be used withinbash
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, andupdate-tools
updates development tools to the latest compatible minor versions.
- 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 runningIf necessary, the Docker image is (re)built automatically, which takes a while the first time.make shell
- Do something with the project like validating the schemas by running
make compile
- Drop out of the container by running
or pressing
exit
Ctrl-D
.
- Install GNU Bash, GNU Make, and npm.
- Install the development tools in
package.json
by runningwhich in particular installs the command-line interface for Another JSON Schema Validator (AJV), namelymake install-tools
ajv-cli
as Node package to be executed throughnpx
, for example,npx ajv --help
- Drop into
bash
. - 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
Our Code of Conduct is the guideline of our collaboration.
If you are interested to contribute by questions, reporting bugs or suggesting enhancements, please see CONTRIBUTING.md for further details.