FLUJOS/FLUJOS_DATOS/DOCS/extraer_info_bbdd.txt
CAPITANSITO 25953376cd Reorganize POCs and demos under POCS/ folder
- Move BACK_BACK/ → POCS/BACK_BACK/ (image pipeline scripts)
- Move VISUALIZACION/ → POCS/VISUALIZACION/ (demos + static assets)
- No path changes needed: ../VISUALIZACION/public still resolves correctly
  from POCS/BACK_BACK/FLUJOS_APP_PRUEBAS.js
- Add FLUJOS_DATOS/DOCS/extraer_info_bbdd.txt (DB state snapshot + commands)

FLUJOS/ and FLUJOS_DATOS/ untouched (production).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-01 01:22:27 +02:00

172 lines
7.9 KiB
Text

================================================================================
EXTRAER INFO DE LA BASE DE DATOS — ESTADO DE DATOS FLUJOS_DATOS
Fecha: 2026-04-01
================================================================================
Este documento recoge el estado actual de los datos del proyecto FLUJOS,
tanto en disco como en MongoDB, y los comandos necesarios para replicar
esta extracción en cualquier momento futuro.
================================================================================
1. ESTADO DE MONGODB (base de datos: FLUJOS_DATOS)
================================================================================
+------------------+----------------+------------------------------------------+
| Colección | Documentos | Campos |
+------------------+----------------+------------------------------------------+
| comparaciones | 52.568.835 | noticia1, noticia2, porcentaje_similitud |
| wikipedia | 25.448 | archivo, tema, subtema, fecha, texto |
+------------------+----------------+------------------------------------------+
NOTA: NOTICIAS y WikiLeaks/Torrents NO están en MongoDB todavía.
Solo existen como ficheros en disco.
================================================================================
2. ESTADO EN DISCO — ARCHIVOS FÍSICOS
================================================================================
NOTICIAS
+-------------------------------+-------------------------------+-----------+---------+
| Sección | Directorio | Archivos | Tamaño |
+-------------------------------+-------------------------------+-----------+---------+
| Artículos (txt scrapeados) | NOTICIAS/articulos/ | 41.467 | |
| Archivos raw (PDF, HTML...) | NOTICIAS/archivos/ | 1.870 | |
| TOTAL NOTICIAS | | 43.337 | 1.9 GB |
+-------------------------------+-------------------------------+-----------+---------+
WIKIPEDIA
+-------------------------------+--------------------------------------+-----------+---------+
| Sección | Directorio | Archivos | Tamaño |
+-------------------------------+--------------------------------------+-----------+---------+
| Artículos Wikipedia | WIKIPEDIA/articulos_wikipedia/ | 25.448 | |
| Artículos tokenizados | WIKIPEDIA/articulos_tokenizados/ | 25.448 | |
| TOTAL WIKIPEDIA | (25.448 artículos + sus tokens) | 50.896 | 611 MB |
+-------------------------------+--------------------------------------+-----------+---------+
TORRENTS / WIKILEAKS
+-------------------------------+------------------------------------------+-----------+---------+
| Sección | Directorio | Archivos | Tamaño |
+-------------------------------+------------------------------------------+-----------+---------+
| Textos extraídos | TORRENTS/TORRENTS_WIKILEAKS_COMPLETO/txt/| 36.183 | |
| Tokenizados | TORRENTS/TORRENTS_WIKILEAKS_COMPLETO/ | | |
| | tokenized/ | 36.183 | |
| TOTAL TORRENTS | | 72.370 | 1.1 GB |
+-------------------------------+------------------------------------------+-----------+---------+
MongoDB (datos físicos en disco)
+-------------------------------+-----------+
| Directorio MONGO/ | Tamaño |
+-------------------------------+-----------+
| MONGO/ | 3.2 GB |
+-------------------------------+-----------+
================================================================================
3. COMPARACIONES — AVANCE DEL PROCESADO
================================================================================
Las 52.5M comparaciones corresponden a artículos WIKIPEDIA cruzados entre sí
(los nombres en la colección son del tipo "ISO_IEC 27032.txt",
"Auditorio _Benito Juárez_.txt", etc.).
Estimación matemática usando N*(N-1)/2 = total_comparaciones:
sqrt(2 * 52.568.835) ≈ 10.254 artículos ya cruzados entre sí
+---------------------------+-----------+-----------+-----------+
| | Wikipedia | NOTICIAS | WikiLeaks |
+---------------------------+-----------+-----------+-----------+
| Archivos en disco | 25.448 | 43.337 | 36.183 |
| Cargados en MongoDB | 25.448 ✓ | 0 ✗ | 0 ✗ |
| Artículos comparados | ~10.254 | - | - |
| % comparado | ~40% | - | - |
| Artículos pendientes | ~15.194 | - | - |
| Pares pendientes aprox. | ~115M | - | - |
+---------------------------+-----------+-----------+-----------+
================================================================================
4. COMANDOS UTILIZADOS PARA EXTRAER ESTA INFORMACIÓN
================================================================================
--- Ver variable de entorno y configuración MongoDB ---
cat /var/www/theflows.net/flujos/.env
--- Listar colecciones en MongoDB ---
mongosh --quiet FLUJOS_DATOS --eval "db.getCollectionNames()"
--- Contar documentos por colección ---
mongosh --quiet FLUJOS_DATOS --eval "
db.getCollectionNames().forEach(col => {
print(col + ': ' + db[col].countDocuments() + ' docs');
})"
--- Ver colecciones con campos y conteo ---
mongosh --quiet FLUJOS_DATOS --eval "
db.getCollectionNames().forEach(col => {
var count = db[col].countDocuments();
var sample = db[col].findOne();
var keys = sample ? Object.keys(sample).join(', ') : 'empty';
print(col + ': ' + count + ' docs | fields: ' + keys);
})"
--- Ver un documento de muestra de comparaciones ---
mongosh --quiet FLUJOS_DATOS --eval "
var s = db.comparaciones.findOne();
print(JSON.stringify(s, null, 2));"
--- Contar archivos en disco por sección ---
# NOTICIAS artículos
find /var/www/theflows.net/flujos/FLUJOS_DATOS/NOTICIAS/articulos/ -type f | wc -l
# NOTICIAS archivos raw
find /var/www/theflows.net/flujos/FLUJOS_DATOS/NOTICIAS/archivos/ -type f | wc -l
# WIKIPEDIA artículos
find /var/www/theflows.net/flujos/FLUJOS_DATOS/WIKIPEDIA/articulos_wikipedia/ -type f | wc -l
# WIKIPEDIA tokenizados
find /var/www/theflows.net/flujos/FLUJOS_DATOS/WIKIPEDIA/articulos_tokenizados/ -type f | wc -l
# TORRENTS total
find /var/www/theflows.net/flujos/FLUJOS_DATOS/TORRENTS/ -type f | wc -l
# WikiLeaks txt
find /var/www/theflows.net/flujos/FLUJOS_DATOS/TORRENTS/TORRENTS_WIKILEAKS_COMPLETO/txt/ -type f | wc -l
# WikiLeaks tokenizados
find /var/www/theflows.net/flujos/FLUJOS_DATOS/TORRENTS/TORRENTS_WIKILEAKS_COMPLETO/tokenized/ -type f | wc -l
--- Tamaño en disco por sección ---
du -sh /var/www/theflows.net/flujos/FLUJOS_DATOS/NOTICIAS/
du -sh /var/www/theflows.net/flujos/FLUJOS_DATOS/WIKIPEDIA/
du -sh /var/www/theflows.net/flujos/FLUJOS_DATOS/TORRENTS/
du -sh /var/www/theflows.net/flujos/FLUJOS_DATOS/MONGO/
--- Estimación de artículos únicos comparados (cálculo matemático) ---
mongosh --quiet FLUJOS_DATOS --eval "
var total = db.comparaciones.countDocuments();
var approxN = Math.round(Math.sqrt(2 * total));
print('Total comparaciones: ' + total);
print('Artículos únicos comparados (estimación): ' + approxN);"
================================================================================
FIN DEL DOCUMENTO
================================================================================