|
1 | 1 | # Ingestion service
|
2 | 2 |
|
3 |
| - |
| 3 | + # Ingestion Service Flow Diagram |
| 4 | + |
| 5 | +```mermaid |
| 6 | +sequenceDiagram |
| 7 | + participant Client as Client/User |
| 8 | + participant API as Producer API |
| 9 | + participant Validator as Producer Shared.py |
| 10 | + participant Publisher as RabbitMQ Publisher |
| 11 | + participant RabbitMQ as RabbitMQ Queue |
| 12 | + participant Consumer as Worker Consumer/Listener |
| 13 | + participant Processor as Worker Shared.py |
| 14 | + participant QueryService as Query Service |
| 15 | + participant GraphDB as Graph Database |
| 16 | +
|
| 17 | + %% Client submits data |
| 18 | + Client->>API: 1. POST data (JSON-LD, TTL, etc.) |
| 19 | + activate API |
| 20 | + |
| 21 | + %% Producer service validates and publishes |
| 22 | + API->>Validator: 2. Validate data format |
| 23 | + activate Validator |
| 24 | + Validator-->>API: Validation result |
| 25 | + deactivate Validator |
| 26 | + |
| 27 | + alt is valid data |
| 28 | + API->>Publisher: 3. Format data for publishing |
| 29 | + activate Publisher |
| 30 | + Publisher->>RabbitMQ: 4. Publish message to exchange |
| 31 | + Publisher-->>API: Publish confirmation |
| 32 | + deactivate Publisher |
| 33 | + API-->>Client: 200 OK Response |
| 34 | + else invalid data |
| 35 | + API-->>Client: 400 Bad Request |
| 36 | + end |
| 37 | + deactivate API |
| 38 | + |
| 39 | + %% Worker service processes the message |
| 40 | + RabbitMQ->>Consumer: 5. Consume message |
| 41 | + activate Consumer |
| 42 | + Consumer->>Processor: 6. Process data |
| 43 | + activate Processor |
| 44 | + |
| 45 | + %% Processing steps |
| 46 | + Processor->>Processor: 7. Add provenance metadata |
| 47 | + |
| 48 | + %% Acknowledge message |
| 49 | + Processor-->>Consumer: Processing complete, i.e., attached provenance |
| 50 | +
|
| 51 | + %% Send to query service |
| 52 | + Consumer->>QueryService: 8. Send processed data |
| 53 | + activate QueryService |
| 54 | + |
| 55 | + %% Store in database |
| 56 | + QueryService->>GraphDB: 9. Store in graph database |
| 57 | + activate GraphDB |
| 58 | + GraphDB-->>QueryService: Storage confirmation |
| 59 | + deactivate GraphDB |
| 60 | + |
| 61 | + QueryService-->>Processor: Processing confirmation |
| 62 | + deactivate QueryService |
| 63 | + |
| 64 | + %% Acknowledge message |
| 65 | + Processor-->>Consumer: Processing complete |
| 66 | + deactivate Processor |
| 67 | + Consumer->>RabbitMQ: 10. Acknowledge message |
| 68 | + deactivate Consumer |
| 69 | +``` |
0 commit comments