Skip to content

infinitedreams9586/RDF

Repository files navigation

How to setup Django Application

  1. Application can be run as a docker image.
  2. Pull the source code and find the Dockerfile. Please make sure to have docker installed and running.
  3. Build the docker image using the command as follows.
docker build -t tib-assignment .
  1. 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 
  1. 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.
  1. Access following URL on the browser.
http://127.0.0.1:8000/covid/download
  1. Download page will be shown. Don't perform any operation as of now, as
    we need to setup database first.

download page screenshot

How to setup GraphDB repository

  1. Pull GraphDB Standard Edition docker image.
docker pull ontotext/graphdb:9.9.0-se
  1. 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
  1. Access GraphDB through your local browser.
  2. Apply Standard Edition Trial license in GraphDB.
  3. Create a repository name "ECDC" with "RDFS(Optimized)" Ruleset.

How to Run Application

  1. Make sure that Django application and GraphDB container is running.
  2. Access following URL on the browser.
http://127.0.0.1:8000/covid/download
  1. Enter this path in the textbox and click Download button.
https://opendata.ecdc.europa.eu/covid19/nationalcasedeath_eueea_daily_ei/csv/data.csv
  1. 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.

Download and process complete screenshot

  1. Once GraphDB finishes the processing of file. It is possible to execute queries and see the visualization.
  2. 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
  1. Query result and verification.

Query & Result

  1. Verification with CSV
    Verification

9.GraphDB Visualization

Visualization

Files

  1. Downloaded CSV file
    CSV Data File

  2. Generated Turtle file
    Turtle file

About

RDFS and Turtle Representation of COVID-19 dataset from European Centre for Disease Prevention and Control (ECDC) and Graph representation in GraphDB.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published