- Application can be run as a docker image.
- Pull the source code and find the Dockerfile. Please make sure to have docker installed and running.
- Build the docker image using the command as follows.
docker build -t tib-assignment .
- Create a network and start a docker container, using following command.
docker network create tib-net
docker run -p 8000:8000 --name my-app -it --network tib-net tib-assignment
- Application is ready to run at,
August 15, 2021 - 06:20:01
Django version 3.2.6, using settings 'tib.settings'
Starting development server at http://0.0.0.0:8000/
Quit the server with CONTROL-C.
- Access following URL on the browser.
http://127.0.0.1:8000/covid/download
- Download page will be shown. Don't perform any operation as of now, as
we need to setup database first.
- Pull GraphDB Standard Edition docker image.
docker pull ontotext/graphdb:9.9.0-se
- Start GraphDB container, with local storage.
docker run -p 0.0.0.0:7200:7200 -v [your local data directory]:/opt/graphdb/home --network tib-net --name graphdbinstance ontotext/graphdb:9.9.0-se
- Access GraphDB through your local browser.
- Apply Standard Edition Trial license in GraphDB.
- Create a repository name "ECDC" with "RDFS(Optimized)" Ruleset.
- Make sure that Django application and GraphDB container is running.
- Access following URL on the browser.
http://127.0.0.1:8000/covid/download
- Enter this path in the textbox and click Download button.
https://opendata.ecdc.europa.eu/covid19/nationalcasedeath_eueea_daily_ei/csv/data.csv
- Please note that, it may take some time for the application to download CSV file, process the file and
generate turtle file and upload the file on GraphDB "ECDC" repository.
- Once GraphDB finishes the processing of file. It is possible to execute queries and see the visualization.
- Here is the sample query executed to find cases and deaths for Germany for July, 2021.
PREFIX eg:<http://example.org/ns#>
PREFIX ns1: <http://purl.org/linked-data/cube#>
SELECT ?geoId (SUM(?y) as ?casesSum) (SUM(?z) as ?deathSum) WHERE {
?x eg:geoId ?geoId .
?x eg:countriesAndTerritories "Germany" .
?x eg:cases ?y .
?x eg:deaths ?z .
?x eg:dateRep ?fil .
FILTER contains(?fil, "07/2021") .
} GROUP BY ?geoId
- Query result and verification.
9.GraphDB Visualization
-
Downloaded CSV file
CSV Data File -
Generated Turtle file
Turtle file