Skip to content

Extending Schema.org

Alasdair Gray edited this page May 21, 2020 · 15 revisions

Bioschemas intends to have a hosted extension of Schema.org.

The purpose of this page is to document the process for developing that extension.

Once a new type has stablised, it should be copied to the Bioschemas website using these instructions.

Resources

Note: Need to update the instructions here to work with the new Schema.org software infrastructure

Old Infrastructure

Resources

Code

The Bioschemas copy of the schema.org repository can be found in the schemaorg repository on GitHub. This is a fork of the main schema.org repository and must be regularly synchronised with the upstream/master.

Development work is taking place on the BioChemEntity branch. The guidance from schema.org has been not to work directly on the master branch, even on the forked repository.

The development files are located in data/ext/bio.

As of May 2019, all files within the bio directory need to be explicitly added to the configuration file in order for them to appear in the bio extension. The two configuration files are

  • sdoconfig.json
  • sdoconfigTermsData.json

It is sdoconfigTermsData.json that you need to edit to make new files accessible in the web application.

Setting up your development environment

  • Install gcloud: note that we are currently working with python 2.7
  • Checkout schemaorg repository: note do not work on master as this repository is synchronised with the main schema.org repository
  • Change to your newly checked out repository

Developing locally

  • Setup your cloud SDK to use python 2.7 export CLOUDSDK_PYTHON=python2.7
  • Run the cloud app, execute the following command from directory that contains the schemaorg directory dev_appserver.py schemaorg

By default, the app will be available from http://bio.localhost:8080/

Note that if you are working in the bio extension, then you will need to disable the host checking flag. Use the following form of the command. dev_appserver.py schemaorg --enable_host_checking 0

Note that the Schema.org navigation bar and examples require a working Internet connection to render correctly.

Regularly used gcloud commands

  • Deploy code to app engine
    gcloud app deploy app.yaml --project sdo-bioschemas-227516
  • View deployment
    gcloud app browse --project=sdo-bioschemas-227516
  • Follow logs
    gcloud app logs tail -s default

Note that gcloud only permits 15 versions of the app to be deployed. Old versions should be regularly removed. This can be done through the online dashboard.