Query Bio2RDF using the Translator Reasoner API (TRAPI)
🔗 https://api.bio2rdf.137.120.31.102.nip.io
Starts the Translator Reasoner API to query the Bio2RDF SPARQL endpoint
- The TRAPI-SPARQL interface is implemented in Python in the
src/
folder - Uses OpenAPI 3 with Swagger UI, built in Python using zalando/connexion
Requires Python 3.7+ and pip
- Clone the repository
git clone https://github.com/MaastrichtU-IDS/bio2rdf-trapi.git
cd bio2rdf-trapi
- Install dependencies
pip3 install -r requirements.txt
If you are facing conflict with already installed packages, then you might want to use a Virtual Environment to isolate the installation in the current folder before installing bio2rdf-trapi:
# Create the virtual environment folder in your workspace python3 -m venv .venv # Activate it using a script in the created folder source .venv/bin/activate
- Start the API in production mode on http://localhost:8808 with Tornado:
python3 src/api.py
Or start the API in debug mode with Flask (the API will be reloaded automatically at each change to the code):
python3 src/api.py debug
Check CONTRIBUTING.md for more details on how to run the API locally and contribute.
Requirements: Docker.
Build and start the container with docker-compose on http://localhost:8808
docker-compose up -d --build
We use nginx-proxy and docker-letsencrypt-nginx-proxy-companion as reverse proxy for HTTP and HTTPS in production. You can change the proxy URL and port via environment variables
VIRTUAL_HOST
,VIRTUAL_PORT
andLETSENCRYPT_HOST
in the docker-compose.yml file.
Check the logs:
docker-compose logs
Stop the container:
docker-compose down
Overview of the different operations available in Bio2RDF Translator Reasoner API (supporting kgx
)
The user sends a ReasonerAPI query to Bio2RDF Nanopublications in the BioLink format (e.g. drug indications). The query is a graph with nodes and edges defined in JSON, and uses classes from the BioLink model.
The /predicates
operation will return the entities and relations provided by this API in a JSON object (following the ReasonerAPI specifications).
Service funded by the NIH NCATS Translator project.