Skip to content

falcontologist/SHACL-API-Docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

442 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SHACL-API-Docker

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.

Overview

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.

📁 Repository Structure

  • 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.

Local Setup (Docker)

To run this API locally using Docker:

  1. Build the image:
    docker build -t shacl-api .
  2. Run the container:
    docker run -p 8000:8000 shacl-api
  3. Access the API: The service is available at https://shacl-api-docker.onrender.com/.

API Endpoints

GET /api/forms

Returns a JSON schema derived from roles_shacl.ttl. This is used by the frontend to dynamically generate input fields for each situation domain.

POST /api/validate

Accepts a Turtle-formatted string and validates it against the SHACL shapes.

  • Request Body: {"turtle_data": "..."}
  • Response: Returns a boolean conforms status and a detailed report_text if violations are found.

Deployment

This repository is optimized for deployment on Render or Railway:

  1. Connect this GitHub repository to your hosting service.
  2. Ensure the environment is set to Docker.
  3. The service will automatically build and provide a public URL for your CodePen frontend.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors