SDC4 Data Model Container Project
Generated by SDCStudio AppGen (Enterprise Stack) on 2026-03-08
This application uses the Enterprise Stack which includes:
| Service | Purpose | Port | Username | Password |
|---|---|---|---|---|
| Django | Web application | 18000 | admin |
admin123 |
| PostgreSQL | Operational database | 15432 | admin |
admin123 |
| GraphDB | OWL 2 reasoning triplestore | 17200 | admin |
admin123 |
| SirixDB | Temporal JSON/XML database | 19443 | admin |
admin123 |
| Keycloak | SSO/RBAC authentication | 18080 | admin |
admin123 |
| Redis | Celery message broker | 16379 | - | - |
All services use the same default credentials:
admin/admin123Change these in production! See
.env.examplefor configuration.Memory Requirement: 6GB+ free RAM recommended
The Enterprise Stack runs multiple services (GraphDB, SirixDB, Keycloak, PostgreSQL, Redis). Ensure Docker/Podman has at least 6GB of memory allocated for stable operation.
You need either Docker or Podman installed:
Note: Docker Desktop requires a license for organizations with >250 employees or >$10M revenue.
pip install podman-composecp .env.example .env
Using Docker:
docker compose up -d --build
Using Podman:
podman-compose up -d --build
The -d flag runs services in the background. The --build flag ensures images are rebuilt with any changes.
Note: First startup may take 2-3 minutes as GraphDB and Keycloak initialize.
To view logs if needed:
docker compose logs -f # or: podman-compose logs -f
Default Credentials (all services):
- Username: admin
- Password: admin123
Service URLs:
- Django Admin: http://localhost:18000/admin/
- GraphDB Workbench: http://localhost:17200 (repository: sdc4_rdf)
- Keycloak Admin: http://localhost:18080/admin/ (realm: sdc4)
- SirixDB API: https://localhost:19443 (uses self-signed certificate)
- PostgreSQL: localhost:15432 (database: sdc4_db)
Application URLs: - Home Page: http://localhost:18000 (Table of Contents for all apps) - Admin Interface: http://localhost:18000/admin/ - SSO Login: http://localhost:18000/accounts/keycloak/login/
Automatic Initialization:
On first startup, the application automatically:
1. Creates PostgreSQL database and tables
2. Creates Django superuser (admin/admin123)
3. Creates GraphDB repository with OWL 2 RL reasoning (sdc4_rdf)
4. Loads SDC4 ontologies (sdc4.ttl, sdc4-meta.ttl) into GraphDB
5. Initializes Keycloak realm (if realm import is configured)
6. Collects static files
IMPORTANT: Change these passwords in production! See "Production Deployment" section below.
To create more admin users:
Via Django Admin:
docker compose exec web python manage.py createsuperuser
Via Keycloak Admin Console: 1. Go to http://localhost:18080/admin/ 2. Login with admin/admin123 3. Navigate to Users > Add user
This application was generated with a semantic foundation (RDF, SHACL, XSD) and basic CRUD interfaces. You can now customize it to match your specific needs and design preferences.
The generated code is clean, well-structured Django that works great with AI coding assistants like Claude Code, GitHub Copilot, or Cursor:
# In your deployed app directory
claude-code # or: cursor, copilot, etc.
Example customization prompts: - "Add Tailwind CSS and modernize the UI with a dark mode option" - "Create a dashboard with charts and analytics for this data" - "Add a REST API with JWT authentication" - "Integrate with Stripe for payment processing" - "Add real-time updates with WebSockets" - "Create custom reports with PDF export" - "Add email notifications when new records are created" - "Integrate with our existing SSO authentication system"
✅ SDC4-compliant semantic models - Full RDF/OWL ontology integration ✅ RDF/SHACL/XSD schemas - Standards-based validation and interoperability ✅ Knowledge graph integration - GraphDB with OWL 2 RL reasoning ✅ Enterprise SSO - Keycloak authentication with SAML/OAuth2 ✅ Temporal database - SirixDB for time-travel queries ✅ Data validation - Automatic constraint checking and error messages ✅ Database migrations - Django ORM with PostgreSQL backend ✅ Basic CRUD interfaces - Create, read, update, delete functionality ✅ Bulk import/export - CSV/JSON data operations ✅ Docker deployment - Production-ready containerization
🎨 UI/UX Styling - Replace Bootstrap with Tailwind, add custom themes, improve layouts 🔌 Third-party Integrations - Connect to APIs, payment processors, analytics platforms 📊 Custom Dashboards - Create charts, reports, and data visualizations 🔐 Authentication/Authorization - Extend Keycloak, add custom permissions 📧 Notifications & Workflows - Email alerts, Slack integration, automated tasks 🚀 Performance Optimizations - Caching, query optimization, CDN integration 📱 Mobile Support - Progressive web app, native mobile apps 🌐 Localization - Multi-language support, timezone handling
Stage 1 (SDCStudio) solves the hard problems AI struggles with: - Complex semantic modeling decisions - Standards compliance (SDC4, RDF, SHACL, XSD) - Knowledge graph architecture with reasoning - Enterprise SSO configuration - Multi-format consistency - Data validation rules
Stage 2 (AI Assistants) excels at what you need next: - Visual design and user experience - Custom business logic - Integration with your existing systems - Workflow automation - Feature additions
The plain UI is intentional - it's a semantic foundation ready for your customizations, not a limitation!
If default ports conflict with existing services, customize in .env:
DB_PORT=15433 # Default: 15432
GRAPHDB_PORT=17201 # Default: 17200
SIRIX_PORT=19444 # Default: 19443
KEYCLOAK_PORT=18081 # Default: 18080
REDIS_PORT=16380 # Default: 16379
WEB_PORT=18001 # Default: 18000
GraphDB provides semantic reasoning capabilities:
Features: - OWL 2 RL reasoning rules - SHACL validation support - RDF4J-compatible API - Visual SPARQL query builder
SirixDB provides temporal data storage:
sdc4_temporalFeatures: - Time-travel queries - Efficient diff computation - JSON and XML document storage - Revision history
Note: SirixDB uses self-signed certificates. Configure SIRIX_VERIFY_SSL=false for development.
Keycloak provides enterprise authentication:
sdc4sdc4-webSupported Protocols: - OAuth 2.0 - OpenID Connect (OIDC) - SAML 2.0
Features: - Single Sign-On (SSO) - Role-Based Access Control (RBAC) - Identity Provider federation - User self-registration
This application includes a REST API for external integrations. The API allows external systems to: - Upload generated app ZIP files - Upload schema files (XSD, HTML, OWL) - Upload RDF/Turtle files to the triplestore - Validate and store XML instances
The API uses API Key authentication via the X-API-Key header.
Via Django Admin (Recommended):
The generated key will look like: sdc4_xK9mN2pQ7rS4tU6vW8xY0zA3bC5dE7fG...
Security Notes: - API keys are stored as SHA-256 hashes (plaintext never stored) - Keys are shown only once at creation time - Keys can be deactivated without deletion (preserves audit trail) - Usage is tracked (last_used_at, request_count)
When sharing API keys with external systems:
Example sharing instructions for external systems:
API Base URL: http://your-domain.com/api/v1/
Authentication: Add header to all requests:
X-API-Key: sdc4_your_api_key_here
Available Endpoints:
- POST /api/v1/upload/zip/ # Upload app ZIP files
- POST /api/v1/upload/schema/ # Upload schema files
- POST /api/v1/upload/rdf/ # Upload RDF/Turtle files
- POST /api/v1/validate/xml/ # Validate XML instances
See full API documentation: api/README.md
Base URL: http://localhost:18000/api/v1/ (change in production)
All endpoints require the X-API-Key header:
curl -H "X-API-Key: your-api-key" http://localhost:18000/api/v1/...
curl -X POST \
-H "X-API-Key: your-api-key" \
-F "file=@app.zip" \
http://localhost:18000/api/v1/upload/zip/
curl -X POST \
-H "X-API-Key: your-api-key" \
-F "files=@dm-abc123.xsd" \
-F "files=@dm-abc123.html" \
http://localhost:18000/api/v1/upload/schema/
curl -X POST \
-H "X-API-Key: your-api-key" \
-F "file=@dm-abc123.ttl" \
http://localhost:18000/api/v1/upload/rdf/
curl -X POST \
-H "X-API-Key: your-api-key" \
-F "file=@instance.xml" \
http://localhost:18000/api/v1/validate/xml/
Complete API documentation with detailed examples is available at:
- Local: api/README.md in this project
- Online: (Configure your documentation URL)
View All Keys (Django Admin): - Navigate to API → API Keys - See: organization name, key prefix, status, usage stats
Deactivate a Key: 1. Click on the key in Django Admin 2. Uncheck "Is active" 3. Click Save
Note: Deactivated keys are retained for audit purposes. The plaintext key cannot be recovered.
Usage Monitoring: - Request Count: Total API calls made with this key - Last Used: Timestamp of most recent API call - Check these regularly to detect unusual activity
docker compose exec web python manage.py migrate
docker compose exec web python manage.py collectstatic
docker compose exec web python manage.py shell
If you need to reload ontologies:
docker compose exec web python manage.py init_graphdb
docker compose down
Note: This stops containers but preserves all data in mediafiles/ directories.
All application data is stored in the mediafiles/ directory:
mediafiles/postgres/ - PostgreSQL datamediafiles/graphdb/ - GraphDB repository datamediafiles/sirixdb/ - SirixDB temporal datamediafiles/keycloak/ - Keycloak realm configurationtar -czf sdc4_backup_$(date +%Y%m%d).tar.gz sdc4/
bash
docker compose up -d --buildbash
python -c 'from django.core.management.utils import get_random_secret_key; print(get_random_secret_key())'DEBUG=False in .envALLOWED_HOSTS with your domainKEYCLOAK_CLIENT_SECRET properlySIRIX_VERIFY_SSL=trueThis SDC4 project is designed to host multiple data model applications.
The easiest way to add a new data model app is using the automated installer:
Using Management Command (CLI):
# Copy the downloaded ZIP file to your project directory, then run:
docker compose exec web python manage.py install_app /app/path/to/app.zip
# Or with Podman:
podman-compose exec web python manage.py install_app /app/path/to/app.zip
Using Django Admin (Web UI):
1. Access Django Admin: http://localhost:18000/admin/
2. Navigate to "SDC4 Tools" → "Install App from ZIP"
3. Upload your generated app ZIP file
4. The installer will automatically:
- Extract and copy the app to the project
- Copy all schema files (dm-.xsd, dm-.ttl, dm-.rdf, dm-_shacl.ttl) to mediafiles/dmlib/
- Update settings.py (add to INSTALLED_APPS)
- Update urls.py (add URL patterns)
- Run database migrations
- Upload RDF data to GraphDB triplestore with OWL 2 reasoning
5. Restart your server:
bash
docker compose restart web
The home page will automatically detect and list all installed apps!
If you prefer manual control or troubleshooting:
sdc_project/{app_name}/ into this project directorydm-{ct_id}.* files (xsd, ttl, rdf, shacl, html, gql) from the ZIP's mediafiles/dmlib/ folder to this project's mediafiles/dmlib/ directorysettings.py: Add the app name to INSTALLED_APPSurls.py: Add the app's URL configuration:
python
path('newapp/', include('newapp.urls', namespace='newapp')),bash
docker compose exec web python manage.py makemigrations
docker compose exec web python manage.py migratebash
docker compose exec web python manage.py init_graphdbbash
docker compose restart websdc4/ - Django project settings[app_name]/ - Data model applicationsontologies/ - SDC4 ontology filesmediafiles/ - Data volumesdmlib/ - XML Schema librarypostgres/ - PostgreSQL datagraphdb/ - GraphDB repository datasirixdb/ - SirixDB temporal datakeycloak/ - Keycloak configurationstaticfiles/ - Collected static filesdocker-compose.yml - Enterprise stack configurationDockerfile - Application containerrequirements.txt - Python dependencies.env.example - Environment variables templateThe Enterprise Stack requires significant memory. Ensure Docker has at least 6GB RAM allocated.
Check GraphDB logs:
docker compose logs graphdb
Keycloak shares the PostgreSQL database. If Keycloak fails to start:
docker compose down
docker compose up -d --build postgres
# Wait for PostgreSQL to be ready
docker compose up -d --build keycloak
SirixDB uses self-signed certificates by default. For development:
- Set SIRIX_VERIFY_SSL=false in .env
For production: - Configure proper SSL certificates for SirixDB
# Fix ownership of data directories
sudo chown -R 1000:1000 ./mediafiles/graphdb
sudo chown -R 1000:1000 ./mediafiles/sirixdb
sudo chown -R 999:999 ./mediafiles/postgres
If running multiple apps:
1. Stop other apps: docker compose down
2. Customize APP_NAME in .env to make names unique
This application was generated from an SDC4-compliant data model using SDCStudio AppGen (Enterprise Stack).
Key Features: - Semantic data model with OWL 2 reasoning (GraphDB) - Temporal versioning and time-travel queries (SirixDB) - Enterprise SSO/RBAC authentication (Keycloak) - PostgreSQL for operational data storage - Celery for background task processing - Auto-generated forms matching your data model - Bulk import for XML instance files - Docker/Podman compatible deployment
Each data model app includes a Bulk Import feature for importing multiple XML instance files at once. This feature is only available to staff users (users with is_staff=True).
Option 1: Upload ZIP File - Create XML instance files following the template format - Package them into a ZIP file - Upload via the Bulk Import page
Option 2: Server Directory Path (Recommended for batch imports)
- Place XML files in the import_data/{app_name}/ folder next to docker-compose.yml
- Each app has its own subdirectory (e.g., import_data/civil_registry/, import_data/healthcare_record/)
- The directory is volume-mounted into the container at /import_data/{app_name}/
- The form pre-fills with the correct default path for each app
- Example directory structure:
sdc4/
├── docker-compose.yml
├── import_data/
│ ├── civil_registry/ # XML files for Civil Registry app
│ │ ├── person_001.xml
│ │ ├── person_002.xml
│ │ └── ...
│ ├── vital_statistics/ # XML files for Vital Statistics app
│ │ └── ...
│ ├── business_registry/ # XML files for Business Registry app
│ │ └── ...
│ ├── property_registry/ # XML files for Property Registry app
│ │ └── ...
│ ├── education_record/ # XML files for Education app
│ │ └── ...
│ ├── employment_record/ # XML files for Employment app
│ │ └── ...
│ ├── tax_revenue/ # XML files for Tax & Revenue app
│ │ └── ...
│ ├── maritime/ # XML files for Maritime app
│ │ └── ...
│ ├── healthcare_record/ # XML files for Healthcare app
│ │ └── ...
│ └── law_enforcement/ # XML files for Law Enforcement app
│ └── ...
Click Download XML Template on the Bulk Import page to get a skeleton XML file showing the expected format for your data model. Each XML file represents one record.
invalid status and an inv_ filename prefix for easy identificationi-{cuid}) — any existing instance_id in the XML is replacedLearn more: - SDCStudio: https://axius-sdc.com - Semantic Data Charter: https://semanticdatacharter.com