-
Notifications
You must be signed in to change notification settings - Fork 3
API
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
curl --header "Content-Type: application/json" \
--request POST \
--data '{
"Drugs":[
"C0031623",
"C0751995",
"C0030106"
]
}' \
https://labs.tib.eu/sdm/covid19kg-exp/covid19kg-exp?target=Pub
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
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
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
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