Add README with API documentation and edge_type reference
This commit is contained in:
73
README.md
Normal file
73
README.md
Normal file
@@ -0,0 +1,73 @@
|
|||||||
|
# HST API
|
||||||
|
|
||||||
|
API Flask para el sistema de tags semánticos HST.
|
||||||
|
|
||||||
|
**Servidor:** 72.62.2.84
|
||||||
|
**Puerto:** 5000
|
||||||
|
**URL pública:** https://tzrtech.org/api/
|
||||||
|
|
||||||
|
## Endpoints
|
||||||
|
|
||||||
|
### Tags
|
||||||
|
|
||||||
|
| Endpoint | Método | Descripción |
|
||||||
|
|----------|--------|-------------|
|
||||||
|
| /api/index.json | GET | Todos los tags por tabla |
|
||||||
|
| /api/tags | GET | Buscar tags (?q=, ?grupo=) |
|
||||||
|
| /api/tags/<mrf> | GET | Tag por hash |
|
||||||
|
| /api/grupos | GET | Lista de grupos |
|
||||||
|
|
||||||
|
### Graph (Relaciones)
|
||||||
|
|
||||||
|
| Endpoint | Método | Descripción |
|
||||||
|
|----------|--------|-------------|
|
||||||
|
| /api/graph | GET | Todas las relaciones (formato legacy) |
|
||||||
|
| /api/graph/edges | GET | Relaciones con edge_type |
|
||||||
|
| /api/graph/edges | POST | Crear relación |
|
||||||
|
| /api/graph/edges/<id> | DELETE | Eliminar relación |
|
||||||
|
|
||||||
|
### Jerarquía
|
||||||
|
|
||||||
|
| Endpoint | Método | Descripción |
|
||||||
|
|----------|--------|-------------|
|
||||||
|
| /api/tree | GET | Relaciones padre-hijo |
|
||||||
|
| /api/tags/<mrf>/children | GET | Hijos de un tag |
|
||||||
|
|
||||||
|
## Esquema Graph
|
||||||
|
|
||||||
|
| Campo | Tipo | Descripción |
|
||||||
|
|-------|------|-------------|
|
||||||
|
| id | integer | PK |
|
||||||
|
| h_a | varchar(64) | Hash tag origen |
|
||||||
|
| h_b | varchar(64) | Hash tag destino |
|
||||||
|
| weight | float | Fuerza relación (0.0-1.0) |
|
||||||
|
| edge_type | varchar(30) | Tipo de relación |
|
||||||
|
| created_at | timestamp | Fecha creación |
|
||||||
|
|
||||||
|
### Tipos de Edge (edge_type)
|
||||||
|
|
||||||
|
| Tipo | Descripción | Ejemplo |
|
||||||
|
|------|-------------|---------|
|
||||||
|
| mirror | Espejo venta/compra | off ↔ qtt, ord ↔ sod |
|
||||||
|
| sequence | Flujo secuencial | off → ord → inv → dnt |
|
||||||
|
| composition | Contiene/compone | bom contiene itm |
|
||||||
|
| dependency | Requiere | ord requiere cli |
|
||||||
|
| maturity | Evolución | crf → mku → prd |
|
||||||
|
| manual | Creado manualmente | - |
|
||||||
|
| db | Default (legacy) | - |
|
||||||
|
|
||||||
|
## Campos en Respuestas
|
||||||
|
|
||||||
|
| Campo | Descripción |
|
||||||
|
|-------|-------------|
|
||||||
|
| ref | Código 3 letras |
|
||||||
|
| als | Alias (ref + nombre_es) |
|
||||||
|
| mrf | Master Reference Hash |
|
||||||
|
| h_maestro | Alias de mrf |
|
||||||
|
| img | Hash de imagen |
|
||||||
|
| nombre_es | Nombre español |
|
||||||
|
| nombre_en | Nombre inglés |
|
||||||
|
|
||||||
|
## Versión
|
||||||
|
|
||||||
|
5.2 (2026-01-02)
|
||||||
Reference in New Issue
Block a user