Skip to content

Modern web-based SHACL validation tool for RDF catalogs. Validate metadata against standard profiles (DCAT-AP-ES, NTI-RISP (2013), DCAT-AP) or custom shapes directly in your browser.

License

Notifications You must be signed in to change notification settings

mjanez/shacl-validator

Repository files navigation

SHACL Validator

SHACL Validator Demo Read in English Documentación en Español

Quality assurance for DCAT-AP-ES metadata
Web application for validating RDF catalogs against SHACL shapes and analyzing validation reports.


Features

Validation Modes

  • Aplication Profiles: Pre-configured SHACL shapes for DCAT-AP-ES, NTI-RISP (2013) and DCAT-AP
  • Custom SHACL: Upload your own SHACL shapes for custom validation rules
  • Report Viewer: Import and analyze existing SHACL validation reports (Turtle format)

Analytics & Visualization

  • Dashboard: Interactive charts with severity breakdown and top failing shapes
  • RDF Snapshot: Real-time statistics of detected resources (datasets, data services, distributions)
  • Advanced Metrics: Property breakdown, focus node distribution, and constraint analysis

Input Methods

  • Direct Input: Monaco editor with syntax highlighting for RDF formats
  • File Upload: Drag & drop or browse for TTL/JSON-LD files with chunked streaming
  • URL Loading: Fetch and validate remote catalogs

Export Options

  • Rich TTL Reports: Enhanced Turtle exports with metadata (creator, profile info, descriptions)
  • CSV Downloads: Spreadsheet-compatible exports for filtering by severity
  • Segment Export: Download violations, recommendations, and infos separately

Screenshots

SHACL Guide

Educational content explaining RDF, SHACL, and data catalog concepts.

SHACL Guide

Pre-configured Profiles

Pre-configured import SHACL shapes for Application Profiles {DCAT-AP-ES, NTI-RISP (2013), DCAT-AP}. DCAT-AP-ES Profiles

Custom SHACL Validation

Upload your own SHACL shapes for custom validation rules.

Custom SHACL Mode

Validator Input Workspace

Monaco editor with syntax highlighting and RDF preview.

Validator Input

Validation Results

Comprehensive validation report with detailed findings and RDF snapshot (JSON-LD).

Validation Results

Report Viewer with Analytics

Import existing SHACL reports and analyze with interactive charts.

Report Viewer

SHACL Glossary

Searchable terminology for understanding validation reports.

Glossary


Quick Start

Prerequisites

  • Node.js 18+ and npm

Installation

# Clone the repository
git clone https://github.com/mjanez/shacl-validator.git
cd shacl-validator

# Install dependencies
npm install

Development

# Start development server
npm run dev

Application available at http://localhost:3000

Build

# Build for production
npm run build

Static files generated in dist/ directory.

Deploy to GitHub Pages

# Deploy to gh-pages branch
npm run deploy

Technology Stack

Category Technologies
Framework React 19 + TypeScript
Build Tool Vite 7.3 with SWC
SHACL Engine shacl-engine 1.1 (lazy loaded)
RDF Parsing N3.js, rdfxml-streaming-parser, jsonld
Editor Monaco Editor
UI Components Radix UI primitives
Styling Tailwind CSS 3
Charts Recharts with D3
i18n i18next + react-i18next

Project Structure

shacl-validator/
├── src/
│   ├── components/
│   │   ├── Validator/          # RDF validation interface
│   │   │   ├── ValidatorInput.tsx
│   │   │   └── ValidationResults.tsx
│   │   ├── Viewer/             # Report analysis interface
│   │   │   └── ReportViewer.tsx
│   │   ├── Guide/              # Educational content
│   │   │   └── EducationalContent.tsx
│   │   ├── Settings/           # Configuration panel
│   │   │   └── SettingsPanel.tsx
│   │   ├── layout/             # App shell components
│   │   │   ├── Layout.tsx
│   │   │   ├── Sidebar.tsx
│   │   │   ├── FloatingRdfStats.tsx
│   │   │   └── CommandPalette.tsx
│   │   └── ui/                 # Reusable UI components
│   ├── services/
│   │   ├── SHACLValidationService.ts   # SHACL validation logic
│   │   ├── RDFService.ts               # RDF parsing & conversion
│   │   └── DataDiscoveryService.ts     # Resource detection
│   ├── config/
│   │   └── mqa-config.json             # Profile definitions
│   ├── workers/
│   │   └── reportWorker.ts             # Web Worker for heavy processing
│   └── types/
│       ├── types.ts
│       └── dataQuality.ts
└── public/
    └── locales/                # i18n translations
        ├── en/
        └── es/

Configuration

Profile Configuration

Edit src/config/mqa-config.json to add or modify validation profiles:

{
  "profiles": {
    "dcat_ap_es": {
      "name": "DCAT-AP-ES",
      "defaultVersion": "1.0.0",
      "defaultBranch": "main",
      "versions": {
        "1.0.0": {
          "name": "DCAT-AP-ES 1.0.0",
          "url": "https://datosgobes.github.io/DCAT-AP-ES/",
          "shaclFiles": [
            "https://raw.githubusercontent.com/datosgobes/DCAT-AP-ES/{branch}/shacl/1.0.0/dcat_ap_es.ttl"
          ]
        }
      }
    }
  }
}

Tip

If you need to use local SHACL files for development, refer to the scripts/README-local-shacl.md guide.

Environment Variables

Vite uses import.meta.env:

  • BASE_URL: Base path for deployment (default: /)
  • MODE: Development or production mode

Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/custom-feature)
  3. Commit your changes (git commit -m 'feat: add custom feature')
  4. Push to the branch (git push origin feature/custom-feature)
  5. Open a Pull Request

License

CC-BY-4.0 - Copyright (c) 2025 mjanez


Acknowledgments

About

Modern web-based SHACL validation tool for RDF catalogs. Validate metadata against standard profiles (DCAT-AP-ES, NTI-RISP (2013), DCAT-AP) or custom shapes directly in your browser.

Topics

Resources

License

Stars

Watchers

Forks

Languages