How alexdgutierrezcordova-nila/smartcity-bcn-knowledge-graph works
This repository implements an ETL and semantic-integration workflow for Barcelona Bicing and CAMS air-quality data. A capture script requests both feeds and records raw payloads and provenance; processing then normalizes and validates each source, performs spatial and time-based matching, and writes integrated CSV datasets. The project also documents an RDF/OWL/SOSA vocabulary and a reproducible analysis notebook. The package modules are excerpted, but the ontology and notebook contents are not; links to those capabilities rely on README statements, so their internal behavior is not expanded here.
Main entry points: procesar_datos.py Processing runner · E2_extraccion_limpieza.ipynb Reproducible analysis · extraccion.py Feed extraction · vocab.ttl RDF vocabulary
Components 18
Data capture
- Capture cycle
E2_extraccion/scripts/capturar.py - Feed extraction
E2_extraccion/src/bcn_kg/extraccion.py - Raw JSON feeds
E2_extraccion/data/raw - Capture provenance
E2_extraccion/data/processed/procedencia.csv
ETL and linking
- Processing runner
E2_extraccion/scripts/procesar_datos.py - Normalize and validate
E2_extraccion/src/bcn_kg/limpieza.py - Spatial station link
E2_extraccion/src/bcn_kg/enlace.py - Temporal observation link
E2_extraccion/src/bcn_kg/enlace.py - Processed datasets
E2_extraccion/data/processed
Semantic model
- RDF vocabulary
E2_extraccion/modelo/vocab.ttl - Ontology specification
E2_extraccion/modelo/modelo_tentativo.md - Semantic field mapping
E2_extraccion/modelo/mapeo_campos.csv - Model diagram
E2_extraccion/src/bcn_kg/diagrama.py
Analysis outputs
- Reproducible analysis
E2_extraccion/notebooks/E2_extraccion_limpieza.ipynb - Analysis report
E2_extraccion/notebooks/E2_extraccion_limpieza.html
Other components
- Pipeline operator
- CityBikes API
- Open-Meteo API
Connections 20
- Pipeline operator → Capture cycle: starts
E2_extraccion/scripts/capturar.py - Capture cycle → Feed extraction: calls
E2_extraccion/scripts/capturar.py - Feed extraction → CityBikes API: requests feed
E2_extraccion/src/bcn_kg/extraccion.py - Feed extraction → Open-Meteo API: requests feed
E2_extraccion/src/bcn_kg/extraccion.py - Feed extraction → Raw JSON feeds: writes raw JSON
E2_extraccion/src/bcn_kg/extraccion.py - Capture cycle → Capture provenance: records capture
E2_extraccion/scripts/capturar.py - Pipeline operator → Processing runner: starts
- Processing runner → Raw JSON feeds: reads feeds
E2_extraccion/scripts/procesar_datos.py - Processing runner → Normalize and validate: calls
E2_extraccion/scripts/procesar_datos.py - Processing runner → Spatial station link: calls
E2_extraccion/scripts/procesar_datos.py - Processing runner → Temporal observation link: calls
E2_extraccion/scripts/procesar_datos.py - Processing runner → Processed datasets: writes CSVs
E2_extraccion/scripts/procesar_datos.py - Reproducible analysis → Feed extraction: uses extraction
- Reproducible analysis → Normalize and validate: uses cleaning
- Reproducible analysis → Spatial station link: uses linking
- Reproducible analysis → RDF vocabulary: documents vocabulary
README.md - Ontology specification → RDF vocabulary: specifies model
README.md - Semantic field mapping → RDF vocabulary: maps terms
README.md - Model diagram → RDF vocabulary: illustrates vocabulary
E2_extraccion/src/bcn_kg/diagrama.py - Reproducible analysis → Analysis report: exports report
README.md