Skip to content

sgort/ttl-editor

Repository files navigation

Core Public Service Editor

Generate CPSV-AP 3.2.0 compliant RDF/Turtle files for Dutch government services

🌐 Live Application: cpsv.open-regels.nl
πŸ§ͺ Acceptance Environment: acc.cpsv.open-regels.nl

CPSV-AP Version License


πŸ“‹ Table of Contents


🎯 Overview

The Core Public Service Editor is a React-based web application that simplifies the creation and management of RDF/Turtle files for government services in the Netherlands. It provides an intuitive interface for creating service definitions that comply with EU CPSV-AP 3.2.0 and Dutch RONL/CPRMV standards.

Key Features:

  • βœ… CPSV-AP 3.2.0 compliant TTL generation
  • βœ… DMN integration with Operaton rule engine
  • βœ… RPP Architecture (Rules--Policy--Parameters separation)
  • βœ… iKnow integration for legislative analysis import
  • βœ… Import/Export with perfect round-trip fidelity
  • βœ… Live preview panel with real-time TTL generation

✨ Features

Core Functionality

πŸ“ Service Definition

  • Public service metadata (title, description, keywords)
  • Thematic areas and sector classification
  • Cost and output specification
  • Legal resource linking

πŸ›οΈ Organization Management

  • Public organization details
  • Geographic jurisdiction (mandatory)
  • Homepage and contact information
  • URI support (short IDs or full URIs)

βš–οΈ Legal Resource Integration

  • BWB ID support for Dutch legislation
  • Version and consolidation tracking
  • Direct linking to wetten.overheid.nl
  • Validation of BWB formats

πŸ”΅ Rules (Decision Logic) - RPP Layer

  • Temporal rules with validity periods
  • Rule versioning and inheritance chains
  • Confidence level tracking (high/medium/low)
  • Rule-to-policy traceability

🟒 Parameters (Configuration) - RPP Layer

  • Configurable values for rule behavior
  • Multiple unit types (EUR, PCT, NUM, DAYS, MONTHS, YEARS)
  • Temporal validity per parameter
  • Regional variation support

🟣 CPRMV (Policy/Norms) - RPP Layer

  • Normative values from legislation
  • CPRMV Rules API integration
  • JSON import from normenbrief format
  • Policy-to-legal-source traceability

🎯 DMN (Decision Models)

  • Upload and deploy DMN files to Operaton
  • Test decision evaluations with live data
  • Automatic input variable extraction
  • Rule extraction with CPRMV attributes
  • Import preservation for existing DMN

πŸ“Š iKnow Integration

  • Parse iKnow XML exports
  • Configurable field mappings
  • Import legislative analysis data
  • Support for multiple legal concept types

πŸ—οΈ Architecture

Rules--Policy--Parameters (RPP) Separation

The editor implements the RPP architectural pattern for Business Rule Management:

Layer Color Description Examples
Rules πŸ”΅ Blue Executable decision logic that operationalizes policies Eligibility checks, calculations
Policy 🟣 Purple Normative values derived from laws Legal thresholds, mandated rates
Parameters 🟒 Green Configurable values that tune rules Regional rates, pilot adjustments

Benefits:

  • Legal Traceability: Law β†’ Policy β†’ Rule β†’ Parameter β†’ Decision
  • Organizational Agility: Adjust parameters without changing rules or laws
  • Governance: Clear ownership and approval workflows per layer

Documentation: See docs/RULES-POLICY-PARAMETERS-SEPARATION.md

Code Architecture (v1.5.1)

Modularization Journey:

  • v1.0: Monolithic App.js
  • v1.3: Component extraction
  • v1.5.1: Full modularization

Key Modules:

  • useEditorState.js - State management hook
  • ttlGenerator.js - TTL generation class
  • importHandler.js - Import logic
  • useArrayHandlers.js - DRY array operations

Documentation: See docs/PROJECT-STRUCTURE.md


πŸ“š Standards Compliance

CPSV-AP 3.2.0 βœ…

The editor generates TTL files compliant with the Core Public Service Vocabulary Application Profile 3.2.0.

Compliance Status:

  • βœ… All mandatory properties implemented
  • βœ… Correct class types (cv:PublicOrganisation, cpsv:PublicService)
  • βœ… Proper relationships (cv:hasLegalResource, cv:hasCompetentAuthority)
  • βœ… Mandatory identifiers for all entities

Documentation: See docs/FIELD-MAPPING-CPSV-AP-3_2_0.md

Dutch Extensions

RONL (Regels Overheid Nederland):

  • ronl:TemporalRule - Time-bounded rules
  • ronl:ParameterWaarde - Configuration parameters
  • ronl:validFrom / ronl:validUntil - Temporal validity
  • ronl:confidenceLevel - Rule confidence tracking
  • ronl:extends - Rule versioning chains

CPRMV (Core Public Rule Management Vocabulary):

  • cprmv:Rule - Normative rules from legislation
  • cprmv:definition - Full legal text
  • cprmv:situatie - Situational context
  • cprmv:norm - Normative value
  • cprmv:ruleIdPath - Legal source path
  • cprmv:DecisionModel - DMN model linking

Documentation: See docs/NAMESPACE-PROPERTIES.md


πŸš€ Getting Started

Prerequisites

  • Node.js 14+ and npm
  • Modern web browser (Chrome, Firefox, Edge, Safari)

Installation

# Clone the repository
git clone https://github.com/your-org/ttl-editor.git
cd ttl-editor

# Install dependencies
npm install

# Start development server
npm start

The application will open at http://localhost:3000

Build for Production

# Create optimized production build
npm run build

# The build folder contains the static files

πŸ“– Usage Guide

Quick Start

  1. Fill in Service Details - Basic service metadata
  2. Add Organization - Competent authority information
  3. Link Legal Resource - BWB ID or legal document
  4. Define Rules - Decision logic (optional)
  5. Add Parameters - Configuration values (optional)
  6. Add Policy - CPRMV normative rules (optional)
  7. Validate - Check for errors
  8. Download TTL - Export compliant RDF/Turtle file

Import Existing Files

  • Click "Import TTL File" button
  • Select a .ttl file
  • All fields populate automatically
  • Edit and re-export for round-trip editing

DMN Integration

  1. DMN Tab - Upload .dmn file
  2. Deploy - Send to Operaton rule engine
  3. Test - Evaluate with sample data
  4. Export - TTL includes DMN metadata and rules

iKnow Integration

  1. iKnow Tab - Upload iKnow XML export
  2. Configure Mapping - Map XML fields to CPSV-AP
  3. Preview - Review mapped data
  4. Import - Populate editor tabs

πŸ› οΈ Development

Project Structure

ttl-editor/
β”œβ”€β”€ public/                 # Static assets
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ components/        # React components
β”‚   β”‚   └── tabs/         # Tab components
β”‚   β”œβ”€β”€ hooks/            # Custom React hooks
β”‚   β”œβ”€β”€ utils/            # Business logic
β”‚   β”œβ”€β”€ data/             # Configuration data
β”‚   └── config/           # App configuration
β”œβ”€β”€ docs/                  # Documentation
└── package.json

Key Technologies

  • React 18.3.1 - UI framework
  • Tailwind CSS 3 - Styling
  • Lucide React - Icons
  • RDF/Turtle - Semantic web standards

Code Style

  • ESLint for code quality
  • Prettier for formatting
  • Functional components with hooks
  • Modular architecture

🚒 Deployment

Production Deployment

The application is deployed to:

Manual Deployment

# Build
npm run build

# Deploy build/ folder to your hosting provider

Environment Variables

No environment variables required - fully client-side application.


πŸ—ΊοΈ Roadmap

Completed Features βœ…

  • βœ… CPSV-AP 3.2.0 compliance (v1.4.0)
  • βœ… DMN integration (v1.5.0)
  • βœ… iKnow integration (v1.5.0)
  • βœ… Full modularization (v1.5.1)
  • βœ… RPP architecture visualization (v1.5.1)

Planned Features πŸ”œ

Phase B: RPP Deep Integration

  • Cross-references between layers
  • "This rule implements Policy X" indicators
  • "This parameter is used by Rules Y, Z" tracking
  • Traceability visualization
  • Impact analysis

Phase C - Governance Features (Optional)

  • Add approval workflows
  • Layer-specific validation
  • Separate exports

Phase 2: Extended CPSV-AP

  • Channel support (cv:Channel)
  • Contact points (cv:ContactPoint)
  • Criteria requirements
  • Evidence requirements
  • Agent relationships

Phase 3: Advanced Features

  • Multi-language support
  • Collaboration features
  • Version control integration
  • Automated testing
  • Quality metrics

See src/data/roadmap.json for detailed roadmap.


πŸ“š Documentation

User Documentation

Technical Documentation

Architecture Documentation


🀝 Contributing

This is a Dutch government project. For contributions or questions:

  1. Check existing issues
  2. Create detailed bug reports or feature requests
  3. Follow the code style guidelines
  4. Submit pull requests to acc branch

πŸ“„ License

EUPL v. 1.2 License - See LICENSE file for details


πŸ”— Links


πŸ“ž Support

For support or questions about this project, please create an issue in the repository.


Built with ❀️ for Dutch Government Services

Version 1.5.1 - January 2026

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages