Skip to content
Samaneh Jozashoori edited this page Apr 20, 2021 · 9 revisions

Knowledge4COVID-19 KG can also be explored using our exploration API. To access the exploration API as a docker image:

docker run -d --name covid19_exploration_api -p 5000:5000 -e ENDPOINT='https://labs.tib.eu/sdm/covid19kg/sparql' sdmtib/covid19_exploration:1.0

To build your own docker image using our source code:

FROM ubuntu:18.04
WORKDIR /covid19exp
ADD . /covid19exp
RUN apt-get --assume-yes update
RUN apt-get --assume-yes install python3 python3-flask python3-sparqlwrapper
# Make port 5000 available to the world outside this container
EXPOSE 5000
# Run app.py when the container launches
CMD python3 ./api.py

The API can also be accessed via POST request

1) Get Publication related to Drugs

curl --header "Content-Type: application/json" \
  --request POST \
  --data '{
   "Drugs":[
  	"C0031623",
  	"C0751995",
  	"C0030106"
   ]
}' \
  https://labs.tib.eu/sdm/covid19kg-exp/covid19kg-exp?target=Pub

2) Get Interactions of a Drug

curl --header "Content-Type: application/json" \
  --request POST \
  --data '{
   "Drugs":[
  	"C0000970",
  	"C0028978",
  	"C0009214"
   ]
}' \
  https://labs.tib.eu/sdm/covid19kg-exp/covid19kg-exp?target=DDI&limit=10&page=0

3) Get all the interaction among the provided Drugs

curl --header "Content-Type: application/json" \
  --request POST \
  --data '{
   "Drugs":[
  	"C0000970",
  	"C0028978",
  	"C0009214"
   ]
}' \
  https://labs.tib.eu/sdm/covid19kg-exp/covid19kg-exp?target=DDIS&limit=10&page=0

4) Get the predicted interactions of a Drug

curl --header "Content-Type: application/json" \
  --request POST \
  --data '{
   "Drugs":[
  	"C0000970",
  	"C0028978",
  	"C0009214"
   ]
}' \
  https://labs.tib.eu/sdm/covid19kg-exp/covid19kg-exp?target=DDIP&limit=10&page=0

5) Get all the predicted interaction among the provided Drugs

curl --header "Content-Type: application/json" \
  --request POST \
  --data '{
   "Drugs":[
  	"C0000970",
  	"C0028978",
  	"C0009214"
   ]
}' \
  https://labs.tib.eu/sdm/covid19kg-exp/covid19kg-exp?target=DDIPS&limit=10&page=0