Read-only mirror of https://github.com/metadata-swiss/structure_generator — Bundesamt für Statistik. Issues & pull requests at the source.
  • Python 53.2%
  • JavaScript 26.7%
  • HTML 19.5%
  • CSS 0.6%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Sergiy Goloviatinski 03f0565d39
Merge pull request #31 from metadata-swiss/dependabot/pip/pip-minor-patch-9c7f54076e
Bump werkzeug from 3.1.8 to 3.1.9 in the pip-minor-patch group
2026-10-13 09:36:11 +02:00
.github Bump the github-actions-minor-patch group with 2 updates 2026-09-23 09:44:35 +00:00
exports Created modules for import and export 2026-06-22 14:42:22 +02:00
imports xsd import fix 2026-08-03 14:33:25 +02:00
static attempt to fix problems since migration 2026-08-05 12:55:12 +02:00
templates attempt to fix problems since migration 2026-08-05 12:55:12 +02:00
.dockerignore Added Dockerfile + workflow to push docker image on azure 2026-06-29 16:13:29 +02:00
.gitleaks.toml avoid scanning mimified vendor stuff with gitleaks 2026-08-03 17:19:43 +02:00
app.py xsd import fix 2026-08-03 14:33:25 +02:00
app.yaml Getting the app ready for deployment. 2025-09-04 11:43:36 +02:00
csv_converter.py fixed potential vulnerabilities, added quality gates in azure deploy pipeline 2026-08-03 13:42:36 +02:00
Dockerfile.azure Bump python in the docker-minor-patch group 2026-09-01 09:55:42 +00:00
Procfile Getting the app ready for deployment. 2025-09-04 11:43:36 +02:00
README.md Added XSD import 2025-09-04 15:57:02 +02:00
requirements.txt Bump werkzeug from 3.1.8 to 3.1.9 in the pip-minor-patch group 2026-10-07 09:46:00 +00:00
xsd_importer.py xsd import fix 2026-08-03 14:33:25 +02:00

SHACL Creator for I14Y

A web-based visual editor for creating SHACL shapes compatible with the Swiss I14Y interoperability platform.

Features

  • Visual Graph Editor: Drag-and-drop interface for datasets, concepts, and classes
  • I14Y Integration: Direct search and integration with I14Y concept catalog
  • Multilingual Support: German, French, Italian, and English
  • TTL Export: Generates I14Y-compatible SHACL files for upload
  • Data Import: Import from CSV files and XSD schemas
  • Project Management: Save/load projects as JSON
  • Multi-User Support: Session-based isolation allowing concurrent users without workspace interference
  • Automatic Cleanup: Expired user sessions are automatically cleaned up to prevent memory leaks

Quick Start

  1. Setup virtual environment (recommended):

    python -m venv .venv
    source .venv/bin/activate  # On Windows: .venv\Scripts\activate
    
  2. Install dependencies:

    pip install -r requirements.txt
    
  3. Run the application:

    python app.py
    
  4. Open browser: Navigate to http://localhost:5002

Usage

Graph Elements

  • Dataset (red): Main data structure definition
  • Concepts (blue): Data fields (searchable from I14Y or custom)
  • Classes (green): Groupings of related concepts

Import Options

  • CSV Import: Upload structured data from CSV files
  • XSD Import: Convert XML Schema Definitions (XSD) to SHACL shapes
  • TTL Import: Load existing SHACL TTL files

Export Format

Generates TTL files following I14Y standards:

  • Uses proper I14Y namespaces and URIs
  • Includes dcterms:conformsTo references to I14Y concepts
  • Maintains multilingual labels and descriptions
  • Adds proper SHACL constraints and datatypes

Technical Details

  • Backend: Flask with RDFLib for TTL generation
  • Frontend: HTML/JavaScript with Bootstrap UI
  • I14Y API: REST integration for concept search
  • Export: SHACL-compliant TTL with I14Y-specific formatting
  • Production: Gunicorn WSGI server for production deployment
  • Multi-User Architecture: Session-based user isolation with automatic cleanup
    • Each user gets a unique session ID and isolated workspace
    • Expired sessions (default: 2 hours inactivity) are automatically cleaned up
    • Background cleanup thread runs every 30 minutes to free memory
    • Concurrent users can work independently without interference