A SPARQL endpoint to serve predictions generated using the OpenPredict classifier, using custom SPARQL functions. Built with rdflib-endpoint
Access the SPARQL service endpoint at https://service.openpredict.137.120.31.102.nip.io/sparql
OpenAPI docs at https://service.openpredict.137.120.31.102.nip.io
Query OpenPredict classifier to get drug/disease predictions
PREFIX openpredict: <https://w3id.org/um/openpredict/>
SELECT ?drugOrDisease ?predictedForTreatment ?predictedForTreatmentScore WHERE {
BIND("OMIM:246300" AS ?drugOrDisease)
BIND(openpredict:prediction(?drugOrDisease) AS ?predictedForTreatment)
Use this federated query to retrieve predicted treatments for a drug or disease (OMIM or DRUGBANK) from any other SPARQL endpoint supporting federated queries.
From another SPARQL endpoint
PREFIX openpredict: <https://w3id.org/um/openpredict/>
SELECT * WHERE
{
SERVICE <https://service.openpredict.137.120.31.102.nip.io/sparql> {
SELECT ?drugOrDisease ?predictedForTreatment WHERE {
BIND("OMIM:246300" AS ?drugOrDisease)
BIND(openpredict:prediction(?drugOrDisease) AS ?predictedForTreatment)
}
}
}
- Install dependencies
pip install -r requirements.txt
- Run the server on http://localhost:8000
uvicorn main:app --reload --app-dir app
Checkout the Dockerfile
to see how the image is built, and run it with the docker-compose.yml
:
docker-compose up -d --build