Skip to content

Extending Schema.org

Alasdair Gray edited this page Jul 28, 2020 · 15 revisions

New Schema.org Infrastructure

These instructions are still a work in progress, please edit and update these as required.

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

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.

Setting up your development environment

  • Install gcloud: note that we are currently working with python 2.7
    • Ensure that python2 is defined and runs a version of Python 2.x. The following can be used to add a symbolic link on linux and MacOS
      ln -s /usr/bin/python2.7 /usr/local/bin/python2
  • Checkout the Bioschemas fork of the schemaorg repository: note do not work on the main branch as this repository is synchronised with the main schema.org repository
  • Change to your newly checked out repository

To run the schema.org infrastructure, run the command runpythonapp.sh. Accept the default options to run it locally L and to not build the static site N.

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

Note that the Schema.org navigation bar and examples require a working Internet connection to render correctly, i.e. they will not work if you are offline.

Old Infrastructure

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

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.