This readme text was generated by Gemini and lightly edited for accuracy. Last update: 2026-02-15.
A FastAPI-based backend engine for RDF data validation and dynamic form generation. This API serves as the source of truth for the Ontology Template Generator & Visualizer project by processing SHACL shapes to drive user interface forms and run inference and validation.
This project provides a robust bridge between a static frontend and a standardized SHACL validation engine. It uses RDFLib for graph traversal and TopBraid SHACL API for standard-compliant inference and validation.
app.py: The Python FastAPI application.Dockerfile: Instructions for containerizing the application.requirements.txt: Python dependencies (fastapi,uvicorn,rdflib,pyshacl).roles_shacl.ttl: The SHACL shapes file defining situations, roles, and constraints.
To run this API locally using Docker:
- Build the image:
docker build -t shacl-api . - Run the container:
docker run -p 8000:8000 shacl-api
- Access the API: The service is available at https://shacl-api-docker.onrender.com/.
Returns a JSON schema derived from roles_shacl.ttl. This is used by the frontend to dynamically generate input fields for each situation domain.
Accepts a Turtle-formatted string and validates it against the SHACL shapes.
- Request Body:
{"turtle_data": "..."} - Response: Returns a boolean
conformsstatus and a detailedreport_textif violations are found.
This repository is optimized for deployment on Render or Railway:
- Connect this GitHub repository to your hosting service.
- Ensure the environment is set to Docker.
- The service will automatically build and provide a public URL for your CodePen frontend.