Backend dev environment
Overview
ontologies_api provides a RESTful interface for accessing BioPortal (an open repository of biomedical ontologies). Supported services include downloads, search, access to terms and concepts, text annotation, and much more.
You will use the same backend dev environment for ontologies_api, ontologies_linked_data, and goo
if you’re in windows you need to install WSL or use Github code spaces
OntoPortal API utility script
Install docker
to see how to install docker and docker compose, see https://docs.docker.com/compose/install/
Clone code
Choose a version of code to clone https://github.com/ontoportal-lirmm/ontologies_api , https://github.com/ncbo/ontologies_api, or https://github.com/ontoportal/ontologies_api (or your own version)
Read the help
bin/ontoportal help
You should see something like this:
Usage: bin/ontoportal {dev|test|run|help} [--reset-cache] [--api-url API_URL] [--api-key API_KEY]
dev : Start the Ontoportal API development server.
Example: bin/ontoportal dev --api-url http://localhost:9393
Use --reset-cache to remove volumes: bin/ontoportal dev --reset-cache
test : Run tests.
run : Run a command in the Ontoportal API Docker container.
help : Show this help message.
Description:
This script provides convenient commands for managing an Ontoportal API
application using Docker Compose. It includes options for starting the development server ,
running tests, and executing commands within the Ontoportal API Docker container.
Goals:
- Simplify common tasks related to Ontoportal API development using Docker.
- Provide a consistent and easy-to-use interface for common actions.Run a development server
bin/ontoportal dev
This will run an Ontoportal API server in development mode using docker, see docker-compose.yml and
Dockerfile for the docker configuration.
By default, the script creates and uses these configuration files .env and config/environments/development.rb created respectively from the samples .env.sample and config/environments/config.rb.sample
Run tests
bin/ontoportal [test_file | all] [-v] [--name=name_of_the_test](Optional) Connect a local submodule to ontologies_api
As described in the Architecture documentation, the ontologies_api depends on two dependencies:
ontologies_linked_data, that contains all the real business logic, such as the creation of an ontology, the submission processing, …goothat is responsible for converting our Ruby models(objects as Ontology for example) and code to SPARQL queries to insert, find, and delete triples from our Triple store.
Most of the time the development is done in the ontologies_linked_dataproject, so you should have it locally and connect it to your API server. To do that
Clone the code of
ontologies_linked_datafrom https://github.com/ontoportal-lirmm/ontologies_linked_data , https://github.com/ncbo/ontologies_linked_data or https://github.com/ontoportal/ontologies_linked_data into a directoryRun
ontoportal dev --old-path <path to your ontologies_linked_data folder>