Generating Outputs Guide

Overview

Once your data model is published, SDCStudio generates one package of outputs: the XSD schema, a Governed Data Record template as XML and a sample as JSON (the "XML instance" and "JSON instance" files), JSON-LD, RDF, SHACL, GQL and HTML documentation. From the same page you can then generate a web application. This guide covers all generation capabilities.

Prerequisites

Before generating outputs: - ✅ Data model created - ✅ All child components finalized and published - ✅ Model published (ONE-TIME operation - cannot be unpublished) - ✅ Credits: publishing and generating the package are free; Download App (or Download Kit) is 1,500 credits the first time per model, free after (see Wallet and Billing)

IMPORTANT: Publication and generation are ONE-TIME, irreversible operations. Once a model is published and its package is generated, it CANNOT be edited, regenerated, or unpublished. Ensure your model is complete and correct before publishing.

XSD Schema Generation

What is XSD?

XSD (XML Schema Definition) is a W3C standard for defining XML document structure. SDCStudio generates SDC4-compliant XSD schemas from your data models.

Generate XSD

  1. Navigate to Models: Go to /app/models
  2. Find Your Published Model: Click on the model to view its detail page
  3. Generate (One-Time Only):
  4. In the Model Generation card, click Generate. The project owner, its team admins and staff can generate; anyone else gets a permission error
  5. This generates ALL export files (XSD, XML, JSON, JSON-LD, RDF, SHACL, GQL, HTML) in a single operation
  6. This can only be done ONCE - regeneration is not allowed
  7. Download: Click Download Complete Package (ZIP); the XSD is dm-<ct_id>.xsd inside it

Note: The model page has no per-file download buttons. The schema of any published model is also served at https://sdcstudio.axius-sdc.com/dmlib/dm-<ct_id>.xsd, and for published models in public projects single artifacts are available from the catalog API (see Download Options).

XSD Features

Full SDC4 Compliance: - All SDC4 data types supported - Proper namespace declarations - Valid XML Schema structure

Validation Rules: - Min/max constraints - Pattern validation - Required/optional fields - Enumeration values

Documentation: - Each component's label, description and RDF Object links are carried as RDF inside its xsd:annotation/xsd:appinfo; enumeration descriptions are xsd:documentation - The model's Dublin Core metadata is carried the same way at the top of the schema

Shape of the output (abbreviated):

<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema
  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  xmlns:sdc4="https://semanticdatacharter.com/ns/sdc4/"
  xmlns:sdc4-meta="https://semanticdatacharter.com/ontology/sdc4-meta/"
  xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
  xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
  targetNamespace="https://semanticdatacharter.com/ns/sdc4/"
  vc:minVersion="1.1">
  <!-- Dublin Core metadata for the model -->
  <xsd:include schemaLocation="https://semanticdatacharter.com/ns/sdc4/sdc4.xsd"/>

  <!-- one complexType per component, named mc-<component id>,
       restricting the SDC4 base type with your constraints -->
  <xsd:complexType name="mc-cpq0lpgg887vpys05bucuep3" xml:lang="en-US">
    <xsd:annotation>
      <xsd:appinfo>
        <rdf:Description rdf:about="https://semanticdatacharter.com/ns/sdc4/mc-cpq0lpgg887vpys05bucuep3">
          <rdf:type rdf:resource="https://semanticdatacharter.com/ontology/sdc4-meta/ModelComponent"/>
          <sdc4-meta:isConstrainedByRmComponent rdf:resource="https://semanticdatacharter.com/ns/sdc4/XdStringType"/>
          <rdfs:label>Customer Email Address</rdfs:label>
          <rdfs:comment>Primary contact email for customer communications</rdfs:comment>
        </rdf:Description>
      </xsd:appinfo>
    </xsd:annotation>
    <xsd:complexContent>
      <xsd:restriction base="sdc4:XdStringType">
        <xsd:sequence>
          <xsd:element maxOccurs="1" minOccurs="1" name="label" type="xsd:string" fixed="Customer Email Address"/>
          <!-- the XdAny elements (act, ExceptionalValue, vtb, vte, tr, modified, latitude, longitude),
               each required or optional according to the Advanced Settings flags -->
          <!-- the value is optional so that an Exceptional Value can stand in its place; the assertion below
               requires one of the two -->
          <xsd:element maxOccurs="1" minOccurs="0" name="xdstring-value">
            <xsd:simpleType>
              <xsd:restriction base="xsd:string">
                <xsd:minLength value="5"/>
                <xsd:maxLength value="320"/>
                <xsd:pattern value="[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}"/>
              </xsd:restriction>
            </xsd:simpleType>
          </xsd:element>
        </xsd:sequence>
        <xsd:assert test="exists(xdstring-value) or exists(*[exists(ev-name)])"/>
      </xsd:restriction>
    </xsd:complexContent>
  </xsd:complexType>
</xsd:schema>

The real file contains every component in the model, an adapter type for each component placed in a cluster, the cluster types, and the mc-<ct_id> type of the model itself with its dm-<ct_id> element; open the generated XSD for the exact structure.

XML Instance Generation

What is XML Instance?

The XML instance file is a Governed Data Record template. A Governed Data Record is one record of data, validated against a published Semantic Data Charter model, that carries its own definitions, provenance and governance, fixed once made. Its canonical serialization is XML (W3C XSD 1.1); JSON and RDF are projections of the same record. The generated file is a template for data entry: labels and the other fixed values are filled in from the schema, and every data value is a placeholder, _PH_ for a required element and _OPT_PH_ for an optional one. The generator checks it for well-formedness only; it validates against the schema once the placeholders are replaced with real values (or, for optional elements, removed).

Generate XML Instance

  1. Navigate to Models: Go to /app/models
  2. Find Your Published Model: Click on the model to view its detail page
  3. Generate (One-Time Only):
  4. In the Model Generation card, click Generate
  5. This generates ALL export files including the XML instance
  6. This can only be done ONCE - regeneration is not allowed
  7. Download: Click Download Complete Package (ZIP); the XML instance is dm-<ct_id>.xml inside it

Note: The XML instance is part of the complete package generated once after publication. It cannot be generated separately or regenerated.

Schema-Aware Generation

SDCStudio reads the elements from YOUR generated schema, not from the entire SDC4 reference model:

  • Every element your schema declares for a component appears, in schema order; required ones carry _PH_, optional ones (validity times, time recorded, modified, location, magnitude status, accuracy margin and the like) carry _OPT_PH_
  • Fixed values are pre-filled: labels, language, encoding, a link's relation, an ordinal's first state, a boolean's first true value, the units label
  • The abstract ExceptionalValue and generic ReferenceRange slots are not emitted
  • The file validates against your schema once the placeholders are replaced

Example (abbreviated):

<?xml version="1.0" encoding="UTF-8"?>
<sdc4:dm-jsi5yxnvzsmsisgn2bvelkni
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:sdc4="https://semanticdatacharter.com/ns/sdc4/"
  xsi:schemaLocation="https://semanticdatacharter.com/ns/sdc4/ https://semanticdatacharter.com/dmlib/dm-jsi5yxnvzsmsisgn2bvelkni.xsd">

  <dm-label>StatePopulation</dm-label>
  <dm-language>en-US</dm-language>
  <dm-encoding>utf-8</dm-encoding>
  <creation_timestamp>_PH_</creation_timestamp>
  <instance_id>w4jp7sd4j7n7p7jyr7q5qzvq</instance_id>
  <instance_version>_PH_</instance_version>
  <source_instance_id>_OPT_PH_</source_instance_id>
  <source_version_id>_OPT_PH_</source_version_id>
  <current-state>_OPT_PH_</current-state>

  <sdc4:ms-wnpz4qyrk369gnsivfsmysdf>
    <label>StatePopulation Data Cluster</label>
    <sdc4:ms-a7hd2p0v6yq1x3k9m2n4r8t6>
      <sdc4:ms-cpq0lpgg887vpys05bucuep3>
        <label>State</label>
        <vtb>_OPT_PH_</vtb>
        <vte>_OPT_PH_</vte>
        <tr>_OPT_PH_</tr>
        <modified>_OPT_PH_</modified>
        <latitude>_OPT_PH_</latitude>
        <longitude>_OPT_PH_</longitude>
        <xdstring-value>_PH_</xdstring-value>
      </sdc4:ms-cpq0lpgg887vpys05bucuep3>
    </sdc4:ms-a7hd2p0v6yq1x3k9m2n4r8t6>
    <sdc4:ms-b3kq9wz2e5rt7yu1io4pa6sd>
      <sdc4:ms-q1ey1sf5otsa97e76kb06hco>
        <label>Adult Population</label>
        <!-- optional XdAny elements, each _OPT_PH_ -->
        <xdcount-value>_PH_</xdcount-value>
        <xdcount-units>
          <label>Count Units</label>
          <xdstring-value>_PH_</xdstring-value>
        </xdcount-units>
      </sdc4:ms-q1ey1sf5otsa97e76kb06hco>
    </sdc4:ms-b3kq9wz2e5rt7yu1io4pa6sd>
  </sdc4:ms-wnpz4qyrk369gnsivfsmysdf>
</sdc4:dm-jsi5yxnvzsmsisgn2bvelkni>

Each component placed in a cluster is wrapped twice: the outer ms- element is the adapter the cluster schema declares for that position, the inner one is the component itself.

See XML Instance Generation for the full structure.

Using XML Instances

As Templates: - Replace the _PH_ placeholders with data, fill or remove the _OPT_PH_ elements, keep the fixed values - Understand expected structure - Test validation rules

For Testing: - Validate the completed record against the XSD (sdcvalidate dm-<ct_id>.xsd record.xml, from the open-source sdcvalidator package) - Test data processing pipelines - Verify transformations

For Documentation: - Show data structure - Provide examples - Training materials

JSON and JSON-LD Generation

What are JSON Outputs?

SDCStudio generates two types of JSON files that serve different purposes:

JSON Instance (dm-{id}-instance.json): - Complete data example mirroring the XML structure - Includes all components, each with a sample value - Developer-friendly format for API development - Sample values generated from the constraints (a default value, one of the enumerations, a string matching the pattern, a number within the magnitude range)

JSON-LD Schema (dm-{id}.jsonld): - Semantic description of the data model - Links to formal ontologies and vocabularies - Machine-readable metadata for linked data - Rich documentation and relationships

Generate JSON Outputs

JSON files are generated as part of the one-time package generation:

  1. Navigate to Models: Go to /app/models
  2. Find Your Published Model: Click on the model to view its detail page
  3. Generate (One-Time Only):
  4. In the Model Generation card, click Generate
  5. This generates ALL export files including the JSON instance and the JSON-LD description
  6. This can only be done ONCE - regeneration is not allowed
  7. Download: Click Download Complete Package (ZIP); the files are dm-<ct_id>-instance.json and dm-<ct_id>.jsonld

JSON Instance Features

Complete Data Structure: - Mirrors the XML instance structure (the adapter wrappers are not repeated) - All components with sample values, unlike the XML template, which carries placeholders - Each component's constraints are listed beside its value - Constraint-aware data generation

Example JSON Instance:

{
  "@context": "https://semanticdatacharter.com/ns/sdc4/",
  "dm_id": "jsi5yxnvzsmsisgn2bvelkni",
  "dm_type": "dm-jsi5yxnvzsmsisgn2bvelkni",
  "metadata": {
    "dm_language": "en-US",
    "dm_label": "StatePopulation",
    "dm_encoding": "utf-8",
    "instance_id": "w4jp7sd4j7n7p7jyr7q5qzvq",
    "instance_version": "1.0",
    "creation_timestamp": "2025-10-17T16:33:50.115552",
    "current_state": ""
  },
  "data": {
    "component_id": "wnpz4qyrk369gnsivfsmysdf",
    "label": "StatePopulation Data Cluster",
    "type": "Cluster",
    "items": [
      {
        "component_id": "cpq0lpgg887vpys05bucuep3",
        "label": "State",
        "type": "XdString",
        "value": "California"
      },
      {
        "component_id": "q1ey1sf5otsa97e76kb06hco",
        "label": "Adult Population",
        "type": "XdCount",
        "value": 29500000,
        "units": {
          "label": "Count Units",
          "value": "people"
        }
      }
    ]
  }
}

JSON-LD Schema Features

Semantic Description: - Component types, and what each cluster contains - Constraints (length, pattern, enumeration, numeric facets, units) and the XSD datatype of each value - The RDF Object links you added, as semanticLinks (predicate and object URIs) - Dublin Core metadata, the same block the XSD header carries

Example JSON-LD Schema:

{
  "@context": {
    "@vocab": "https://semanticdatacharter.com/ns/sdc4/",
    "sdc4": "https://semanticdatacharter.com/ns/sdc4/",
    "sdc4-meta": "https://semanticdatacharter.com/ontology/sdc4-meta/",
    "xsd": "http://www.w3.org/2001/XMLSchema#",
    "rdfs": "http://www.w3.org/2000/01/rdf-schema#",
    "rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
    "dc": "http://purl.org/dc/elements/1.1/",
    "sh": "http://www.w3.org/ns/shacl#",
    "label": "rdfs:label",
    "description": "rdfs:comment",
    "type": "@type",
    "id": "@id"
  },
  "@type": "DataModel",
  "@id": "sdc4:dm-jsi5yxnvzsmsisgn2bvelkni",
  "identifier": "jsi5yxnvzsmsisgn2bvelkni",
  "label": "StatePopulation",
  "description": "Population data by state",
  "metadata": {
    "dc:title": "StatePopulation",
    "dc:creator": "Your Name",
    "dc:contributor": [],
    "dc:language": "en-US"
  },
  "components": [
    {
      "@type": "ClusterType",
      "@id": "sdc4:mc-wnpz4qyrk369gnsivfsmysdf",
      "label": "StatePopulation Data Cluster",
      "cardinality": { "minOccurs": 0, "maxOccurs": 1 },
      "contains": [
        { "@id": "sdc4:mc-cpq0lpgg887vpys05bucuep3" },
        { "@id": "sdc4:mc-q1ey1sf5otsa97e76kb06hco" }
      ]
    },
    {
      "@type": "XdStringType",
      "@id": "sdc4:mc-cpq0lpgg887vpys05bucuep3",
      "label": "State",
      "cardinality": { "minOccurs": 0, "maxOccurs": 1 },
      "constraints": { "maxLength": 50 },
      "dataType": "xsd:string",
      "semanticLinks": [
        { "predicate": "http://www.w3.org/2004/02/skos/core#exactMatch",
          "object": "http://www.wikidata.org/entity/Q7275" }
      ]
    },
    {
      "@type": "XdCountType",
      "@id": "sdc4:mc-q1ey1sf5otsa97e76kb06hco",
      "label": "Adult Population",
      "cardinality": { "minOccurs": 0, "maxOccurs": 1 },
      "constraints": {
        "minInclusive": 0.0,
        "units": { "@type": "Units", "label": "people", "@id": "sdc4:mc-r2ab8q7c0zxl4mnp9t3kue5v" }
      },
      "dataType": "xsd:integer"
    }
  ]
}

The full metadata block carries every Dublin Core field the schema header writes (title, creator, contributors, subject, source, rights, relation, coverage, type, identifier, description, publisher, date, format, language).

Using JSON Outputs

JSON Instance Use Cases: - API Development: REST API request/response examples - Testing: Sample data for automated tests - Documentation: Show data structure to developers - Code Generation: Generate TypeScript/JavaScript interfaces - Data Exchange: the Governed Data Record in JSON, beside its XML serialization

JSON-LD Schema Use Cases: - Semantic Web: Integration with linked data systems - Knowledge Graphs: Import into graph databases - Metadata Catalogs: Machine-readable schema description - Ontology Mapping: Link to formal vocabularies - RDF Processing: Convert to RDF triples

Differences from JSON Schema

Important Note: SDCStudio generates JSON instances and semantic descriptions, not JSON Schema validation files.

  • ✅ JSON Instance: the JSON serialization of the Governed Data Record, with sample values
  • ✅ JSON-LD: Semantic metadata (ontology description)
  • ❌ JSON Schema: Validation schema (not currently generated)

For validation, use the XSD schema with an XSD 1.1 validator such as sdcvalidate from the open-source sdcvalidator package (pip install sdcvalidator); the generated applications include XML validation as well.

Application Generation

After the package is generated, the model page shows Generate App (choose one). Pick Lightweight or Enterprise and click its Generate button; when the build finishes click Download App (1,500 credits the first time per model, free after). Each profile is generated once; afterwards its card reads "App already generated" and offers only Download App. Retry is offered if the build fails. The third box, Supabase kit, has no build step: Download Kit generates the kit for a Supabase project when you click it, and the first download of the model, app or kit, is the one charged (see App Generation).

Generated applications are standalone Django applications built from your published Data Model and include: - Database Models: Automatically mapped from your DM components - Forms: Auto-generated with validation and Bootstrap styling - Views & URLs: Complete CRUD interface - Templates: Responsive, mobile-friendly HTML templates - Docker Support: Ready-to-run Docker configuration - XML Support: creates Governed Data Records (XML) that validate against the model - Validation: Integrated SDC validation using the XML Catalog

Two deployment profiles are available: - Lightweight: PostgreSQL, Apache Fuseki, Redis and Celery, Django's built-in auth; for local development, prototyping and small deployments - Enterprise: PostgreSQL, GraphDB (OWL 2) in place of Fuseki, SirixDB (temporal), Keycloak (SSO/RBAC), Redis and Celery; needs 6 GB or more of free RAM

For complete details, see the Application Generation Guide.

Export Formats

Generated Output Files

When you click Generate on a published model, SDCStudio produces one package. It contains:

Core Files: - dm-{id}.xsd: XML Schema for validation - dm-{id}.xml: XML instance, a Governed Data Record template with placeholders - dm-{id}-instance.json: JSON instance with the same structure as the XML - dm-{id}.jsonld: JSON-LD semantic description - dm-{id}.html: Human-readable documentation - dm-{id}.sha1: SHA-1 checksum of the schema

Additional Files: - dm-{id}.ttl: RDF triples extracted from the XSD (Turtle) - dm-{id}.rdf: The same triples as RDF/XML - dm-{id}_shacl.ttl: SHACL shapes for RDF validation - dm-{id}.gql: GQL CREATE statements for property graphs - SHACL_README.md: How to use the SHACL shapes - dm-description.xsl: The stylesheet that renders the schema's description - README-AI-PROMPT.md: A description of the package written for people and for AI assistants

Download Options

Complete Package: - Click Download Complete Package (ZIP) on the model page; it is the only download button for the package - Available immediately after the one-time generation - Note: The package can only be generated once - download and save it carefully

Single artifacts: - The schema of any published model is served at https://sdcstudio.axius-sdc.com/dmlib/dm-<ct_id>.xsd - For published models in public projects, the catalog API serves one artifact at a time: https://sdcstudio.axius-sdc.com/api/v1/catalog/dm/<ct_id>/<artifact>/, where <artifact> is one of xsd, xml, json, jsonld, html, sha1, zip, ttl, shacl, gql - Anonymous downloads are rate limited (60 per hour)

Use Cases: - XSD: Schema validation, XML processing - XML Instance: Data entry templates, testing - JSON Instance: API development, JavaScript apps - JSON-LD: Linked data, semantic web, knowledge graphs - HTML: Documentation, training, compliance - SHACL: RDF validation, ontology work - RDF: Triple stores, graph databases - GQL: Property graph databases (one CREATE statement with the nodes and relationships) - ZIP: Distribution, archival, deployment

Several Models

Generation is per model. Publish each model, click Generate on each, and download each package. There is no batch generation and no version history: a published model is fixed, and a change means a Copy of the model, edited and published as a new model.

Through the API, POST /api/v1/dmgen/assemble/ publishes the model it builds and generates its package in the same call (the publish and generate flags, both true by default), and POST /api/v1/dmgen/dms/<ct_id>/generate/ with {"async": true} generates a published model's package as a job. See the assembly reference.

Best Practices

Before Generation

⚠️ CRITICAL: Publication and generation are ONE-TIME, irreversible operations

Validate Thoroughly: - Check all components are complete and correct - Test validation rules extensively - Review all documentation and labels - Verify all relationships and references - Ensure all components are published and finalized - Remember: Once published, models CANNOT be edited

Plan Usage: - Know exactly what you'll use the model for - Understand all export formats you'll need - Verify your model meets all requirements - Consider creating a test model first to validate your approach

Final Checklist Before Publishing: - [ ] All components tested and validated - [ ] All descriptions and labels are accurate - [ ] All relationships properly configured - [ ] Validation rules tested with sample data - [ ] Model reviewed by stakeholders - [ ] Certain this is the final version

After Generation

Immediately Save All Files: - Download the complete ZIP package immediately - Save individual files you need - Store in version control or backup system - Remember: You cannot regenerate these files

Test Generated Outputs: - Validate XML against XSD - Test JSON structure - Verify all export formats - Confirm all components are present

Document and Archive: - Save the complete package in a secure location - Document what the model represents - Record any important decisions made - Keep backups of all generated files

Troubleshooting

Generation Fails

Model not ready: - The Generate button appears only on a published model - A model can be published only when every child component is published

Insufficient credits: - Only Download App and Download Kit are charged (1,500 credits, the first download of each model, whichever it is); a 402 response means the balance is too low (see Troubleshooting)

Generation error: - Reload the model page; if the Generate button is still shown, click it again - If it fails again, contact contact@axius-sdc.com with the model's ct_id

Invalid Output

XSD Validation Fails: - Check component types - Verify constraints - Review namespace declarations

XML Doesn't Validate: - The unedited template does not validate: replace every _PH_, and fill or remove each _OPT_PH_ element - Check the values against the component constraints - Verify element structure

Application Won't Run: - Check dependencies installed - Verify database configuration - Review error logs

Next Steps

Getting Help


Ready to generate? Publish your model and start creating schemas and applications.