| sequenceDiagram | |
| participant User | |
| participant App as MCP4RDF Service | |
| participant Val as Validator | |
| participant SHACL as SHACL Engine | |
| participant LLM as LLM (Llama-3.3) | |
| User->>App: Submit RDF/XML | |
| App->>Val: validate_rdf_tool() | |
| Val->>SHACL: Load template & validate | |
| alt Valid RDF | |
| SHACL-->>Val: Conforms | |
| Val-->>App: {conforms: true, status: "Valid"} | |
| App-->>User: Display success | |
| else Invalid RDF | |
| SHACL-->>Val: Violations found | |
| Val-->>App: {conforms: false, results: "errors..."} | |
| App->>LLM: get_ai_suggestions(errors, rdf) | |
| Note over LLM: Analyze errors<br/>Generate fix steps | |
| LLM-->>App: Structured suggestions | |
| App->>LLM: get_ai_correction(errors, rdf) | |
| Note over LLM: Generate corrected<br/>RDF/XML | |
| LLM-->>App: Fixed RDF/XML | |
| App-->>User: Display errors +<br/>suggestions +<br/>corrected RDF | |
| end |