MaastrichtU-IDS / d2s-api

📬 OpenAPI services to query a RDF knowledge graph.
https://api.trek.semanticscience.org
MIT License
1 stars 0 forks source link

About

This project aims to generate useful web services described following the OpenAPI 3.0 specifications using SpringDoc. The generated services enable the user to query a BioLink-compliant RDF knowledge graph using HTTP request following the Reasoner API Specifications.

This services has been developed for the NCATS Translator project.

Pull or build

You can pull the image from DockerHub

docker pull umids/d2s-api

Or build from the git repository. Builds after modifying pom.xml might take some time, since the Dockerfile will resolve all dependencies from scratch. Once cached, builds should be significantly faster.

docker build -t umids/d2s-api .

Run

docker run -it --rm -p 80:8080 umids/d2s-api

Use -e ENDPOINT=<biolink_sparql_endpoint_url> environment switch to override default endpoint.

Using a specific endpoint and the DockerHub image:

docker run -it --rm -p 80:8080 --net d2s-core_network -e ENDPOINT="http://graphdb:7200/repositories/test" umids/d2s-api

Access at http://localhost/

Access the Swagger Apidoc at http://localhost/v3/api-docs

Development

Change the default endpoint in src/main/resources/application.yml

Use the convenience script:

./restart_local.sh

Access at http://localhost:8080

Or manually:

# Build
mvn package spring-boot:repackage
# Run
java -jar target/d2s-api-0.9.0.jar

Acknowledgments

Alexander Malic for his concept and contribution with rdfServices

Desson Ariawan for its detailed tutorial on documenting Spring Boot REST API with SpringDoc + OpenAPI 3.

Tutorial about documenting a Spring REST API Using OpenAPI 3.0.