# pablocizq/tfg-pablo-calvo architecture

> Architecture diagram of the GitHub repository pablocizq/tfg-pablo-calvo, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-23). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/pablocizq/tfg-pablo-calvo
- Repository: https://github.com/pablocizq/tfg-pablo-calvo

## Overview

This Django application supports creating and managing datasets with metadata, inferring properties from uploaded files, generating metadata with AI, and publishing datasets to CKAN. The principal workflow runs from browser-based file and metadata interaction through Django views, which coordinate parsing, persistence, and optional CKAN operations. Account and dataset management are additional branches. Source excerpts establish the main routes and several calls; unsampled view logic limits detail about some domain stages.

Main entry points: [`tfg/web/views.py`](https://github.com/pablocizq/tfg-pablo-calvo/blob/main/tfg/web/views.py) (Request handlers), [`tfg/web/services/ckan_service.py`](https://github.com/pablocizq/tfg-pablo-calvo/blob/main/tfg/web/services/ckan_service.py) (CKAN client), [`tfg/web/static/web/js/inferir.js`](https://github.com/pablocizq/tfg-pablo-calvo/blob/main/tfg/web/static/web/js/inferir.js) (Browser interactions), [`tfg/web/static/web/js/ckan_integration.js`](https://github.com/pablocizq/tfg-pablo-calvo/blob/main/tfg/web/static/web/js/ckan_integration.js) (CKAN publishing UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_routes["Web routes<br/>[urls.py]"]
  node_views["Request handlers<br/>[views.py]"]
  node_browser["Browser interactions<br/>[inferir.js]"]
  node_ckan_ui["CKAN publishing UI"]
end

subgraph group_domain["Metadata workflow"]
  node_dataset_workflow["Dataset management<br/>[views.py]"]
  node_property_parser["Property extraction"]
  node_metadata_inference["Metadata inference<br/>[views.py]"]
  node_turtle_export["Turtle export<br/>[views.py]"]
  node_account["Account management<br/>[views.py]"]
end

subgraph group_integration["External integration"]
  node_ckan_proxy["CKAN proxy<br/>[views.py]"]
  node_ckan_client["CKAN client<br/>[ckan_service.py]"]
  node_ckan{{"CKAN service"}}
end

subgraph group_persistence["Persistence"]
  node_models["Dataset and user models<br/>[models.py]"]
  node_database[("PostgreSQL database")]
end

node_user(("Dataset user"))

node_user -->|"uses"| node_routes
node_routes -->|"routes requests"| node_views
node_browser -->|"requests inference"| node_views
node_views -->|"extracts properties"| node_property_parser
node_views -->|"queries records"| node_models
node_views -.->|"reads and writes"| node_database
node_ckan_ui -->|"requests organizations"| node_ckan_proxy
node_ckan_ui -->|"submits publication"| node_views
node_views -->|"publishes datasets"| node_ckan_client
node_ckan_proxy -.->|"dispatches actions"| node_ckan_client
node_ckan_client -->|"reads API token"| node_database
node_ckan_client -->|"calls API"| node_ckan
node_browser -->|"generates metadata"| node_views

click node_routes "https://github.com/pablocizq/tfg-pablo-calvo/blob/main/tfg/web/urls.py"
click node_views "https://github.com/pablocizq/tfg-pablo-calvo/blob/main/tfg/web/views.py"
click node_browser "https://github.com/pablocizq/tfg-pablo-calvo/blob/main/tfg/web/static/web/js/inferir.js"
click node_ckan_ui "https://github.com/pablocizq/tfg-pablo-calvo/blob/main/tfg/web/static/web/js/ckan_integration.js"
click node_dataset_workflow "https://github.com/pablocizq/tfg-pablo-calvo/blob/main/tfg/web/views.py"
click node_property_parser "https://github.com/pablocizq/tfg-pablo-calvo/blob/main/tfg/web/parsers/property_extraction_strategy.py"
click node_metadata_inference "https://github.com/pablocizq/tfg-pablo-calvo/blob/main/tfg/web/views.py"
click node_turtle_export "https://github.com/pablocizq/tfg-pablo-calvo/blob/main/tfg/web/views.py"
click node_account "https://github.com/pablocizq/tfg-pablo-calvo/blob/main/tfg/web/views.py"
click node_ckan_proxy "https://github.com/pablocizq/tfg-pablo-calvo/blob/main/tfg/web/views.py"
click node_ckan_client "https://github.com/pablocizq/tfg-pablo-calvo/blob/main/tfg/web/services/ckan_service.py"
click node_models "https://github.com/pablocizq/tfg-pablo-calvo/blob/main/tfg/web/models.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_routes,node_views,node_browser,node_ckan_ui,node_user toneBlue
class node_dataset_workflow,node_property_parser,node_metadata_inference,node_turtle_export,node_account toneAmber
class node_ckan_proxy,node_ckan_client,node_ckan toneMint
class node_models,node_database toneRose
```

## Components

### Web experience

- [Web routes](https://github.com/pablocizq/tfg-pablo-calvo/blob/main/tfg/web/urls.py): `tfg/web/urls.py`
- [Request handlers](https://github.com/pablocizq/tfg-pablo-calvo/blob/main/tfg/web/views.py): `tfg/web/views.py`
- [Browser interactions](https://github.com/pablocizq/tfg-pablo-calvo/blob/main/tfg/web/static/web/js/inferir.js): `tfg/web/static/web/js/inferir.js`
- [CKAN publishing UI](https://github.com/pablocizq/tfg-pablo-calvo/blob/main/tfg/web/static/web/js/ckan_integration.js): `tfg/web/static/web/js/ckan_integration.js`

### Metadata workflow

- [Dataset management](https://github.com/pablocizq/tfg-pablo-calvo/blob/main/tfg/web/views.py): `tfg/web/views.py`
- [Property extraction](https://github.com/pablocizq/tfg-pablo-calvo/blob/main/tfg/web/parsers/property_extraction_strategy.py): `tfg/web/parsers/property_extraction_strategy.py`
- [Metadata inference](https://github.com/pablocizq/tfg-pablo-calvo/blob/main/tfg/web/views.py): `tfg/web/views.py`
- [Turtle export](https://github.com/pablocizq/tfg-pablo-calvo/blob/main/tfg/web/views.py): `tfg/web/views.py`
- [Account management](https://github.com/pablocizq/tfg-pablo-calvo/blob/main/tfg/web/views.py): `tfg/web/views.py`

### External integration

- [CKAN proxy](https://github.com/pablocizq/tfg-pablo-calvo/blob/main/tfg/web/views.py): `tfg/web/views.py`
- [CKAN client](https://github.com/pablocizq/tfg-pablo-calvo/blob/main/tfg/web/services/ckan_service.py): `tfg/web/services/ckan_service.py`
- **CKAN service**

### Persistence

- [Dataset and user models](https://github.com/pablocizq/tfg-pablo-calvo/blob/main/tfg/web/models.py): `tfg/web/models.py`
- **PostgreSQL database**

### Other components

- **Dataset user**

## Connections

- Dataset user → Web routes: uses
- Web routes → Request handlers: routes requests (evidence: `tfg/web/urls.py`)
- Browser interactions → Request handlers: requests inference (evidence: `tfg/web/static/web/js/inferir.js`)
- Request handlers → Property extraction: extracts properties (evidence: `tfg/web/views.py`)
- Request handlers → Dataset and user models: queries records (evidence: `tfg/web/views.py`)
- Request handlers → PostgreSQL database: reads and writes
- CKAN publishing UI → CKAN proxy: requests organizations (evidence: `tfg/web/static/web/js/ckan_integration.js`)
- CKAN publishing UI → Request handlers: submits publication (evidence: `tfg/web/static/web/js/ckan_integration.js`)
- Request handlers → CKAN client: publishes datasets (evidence: `tfg/web/views.py`)
- CKAN proxy → CKAN client: dispatches actions (evidence: `tfg/web/views.py`)
- CKAN client → PostgreSQL database: reads API token (evidence: `tfg/web/services/ckan_service.py`)
- CKAN client → CKAN service: calls API (evidence: `tfg/web/services/ckan_service.py`)
- Browser interactions → Request handlers: generates metadata (evidence: `tfg/web/static/web/js/inferir.js`)
