How quantum-label/quantum_labelling_tool works
Project Type and Purpose
• This is a full-stack Django web application (“QUANTUM Data Quality Labelling Tool”) designed to let data holders catalogue datasets, assess their quality, generate labels/certificates in RDF, and download them.
• Key use cases: guided dataset evaluation, certificate generation (PDF + RDF), visualization dashboards, compliance with HealthDCAT-AP/DCAT/DQV.
High-Level File Structure Analysis
• Top-level Django app:
• quantum/ (settings, URLs, WSGI/ASGI)
• manage.py
• webapp/ (models, views, templates, migrations, admin)
• templates/ & static/ (project-wide UI assets)
• staticfiles/ (collected static assets)
• Modular code under code/:
• code/fdp/ – functions to query Federated Data Points (FDP) and build certificate metadata
• code/label/ – HTML/PDF label generation (template engine, CSS/fonts, PDF creator)
• code/rdf/ – TTL templating for RDF export
• code/helpers/ – shared utilities (e.g., Django integrations)
• Configuration & deployment:
• docker/ (Dockerfile, docker-compose.yml, .env, init SQL)
• requirements.txt / requirements.in
• db.sqlite3 (development DB)
README Insights
• Technology stack: Python 3.11+, Django backend, Bootstrap-based HTML/CSS/JS frontend, SQLite (dev) or MariaDB (prod via Docker).
• Docker compose orchestrates two containers: webapp and database.
• Initial data loaded from docker/init/init.sql into MariaDB.
• Core flows: HTTP requests → Django views → ORM → DB; certificate generation via specialized modules; static/template rendering.
Main Components
a. Frontend Layer
• Browser UI
• Static assets (CSS, JS) and HTML templates (Bootstrap)
• Entry points: home, login, dashboards, dataset/catalogue forms, label download
b. Backend Layer
• Django web server (Django REST/views)
• URL router (quantum/urls.py → webapp/views.py)
• Business logic modules under code/ (fdp, label, rdf)
• ORM layer (webapp/models.py → SQLite3 or MariaDB)
c. Data Layer
• Development: SQLite3
• Production: MariaDB (Docker “database” service) initialized by init.sql
d. Docker & Deployment
• docker-compose: quantumtoolwebapp + quantumtooldatabase services
• Environment configuration (.env)
• build/run commands
e. External Systems
• FDP endpoints (queried by code/fdp)
• Certificate download (PDF)
• RDF export (TTL)
Relationships and Interactions
• Browser ↔ Django HTTP endpoints (GET/POST for forms, JSON or HTML responses)
• Django Views → Templates + Static (render UI)
• Views → code/fdp for metadata retrieval → code/label for PDF → code/rdf for TTL
• Django ORM → Database (read/write catalogue, dataset, assessment records)
• Docker network: webapp ↔ database (TCP 3306)
Architectural Patterns & Design Principles
• MVC (Model in webapp/models, Views in webapp/views, Templates)
• Modular separation of concerns:
• code/fdp (data retrieval)
• code/label (presentation generation)
• code/rdf (semantic export)
• Containerization for reproducibility and isolation
• Use of Django migrations for schema evolution