Steps to Render a Bioschemas Profile on the Bioschema Website
It is assumed that you have already made the edits to the profile (see this tutorial for details on how to edit a profile), stored it in the Bioschemas Specification repository, and that you are now ready to get it published on the Bioschemas website.
1. Manual Configuration in the Website Repository
For new profiles:
- Create a new branch in the Bioschemas website repository with a suitable name to identify the intended outcome of the work, e.g. for a new "example profile" we might have
draft-example-0.1
.
- In the
_data/profile_versions.yaml
file, add an entry for the new profile replicating the information in other draft profiles.
- In the
_data/metadata_mapping.csv
file add a row for your profile stating the profile name and working group name.
- Create a pull request from your branch to the master.
2 Automated Rendering (Github Action)
Once the pull request in the specifiaction repository is merged, a GitHub Action workflow is launched. It converts the JSON-LD representation of the Bioschemas profile from the specifications repository into the format needed for the Bioschemas website.
Workflow steps (shown in figure below):
- Clone the specification repository and retreive the last commit.
- Clone the website repository.
- Execute a python script that will update some config files:
- Get the profile versioning config file from the website repository and parse it
- Check if the profile exists in the file
- Update it's version
- Execute a python script that will generate the profile:
- Maps each field of the JSON-LD to properties in the profile
- Generates a YAML from this mapping
- Transforms the YAML into an HTML file
- Write the file in the appropriate profiles folder in the website repository
- Setup the GitHub TOKEN, so the GitHub action can publish into the website repository.
- Commit and push the changes in an intermediate branch. The file has the following name pattern: profile name + today's date concatenated. e.g:
ComputationalTool-2022-08-17
.
- Creates a Pull Request from the branch to be integrated into the master branch.
3.3 To the Web
Now, if you go to the bioschemas repository pull requests, you should find a PR for the generated branch.
You just need to merge it to master branch and your profile will be taken into consideration in the bioschemas website.
3. Possible Occuring Problems
3.1 At the workflow level
- The Github TOKEN that the github action is using to add and commit a change in the Github action is owned by Sahar Frikha.
3.2 At the python script level
- The format of the generated HTML is tightly coupled to the Jekyll Profile template used to render the profile as a web page. Any modifications to the template should be taken into consideration in the python script. For now, we are following this template.
4. Sequence Diagram
The following diagram illustrates how files are routed through the three main entities: DDE, Bioschemas specifications and Bioschemas website repositories.