Skip to main content

Agentic XMI/UML to SDC4 data model converter

Project description

XMI2SDC

CI Python 3.11+ License: Apache 2.0

XMI2SDC — Agentic XMI/UML to SDC4 Converter

Agentic XMI/UML to SDC4 data model converter.

XMI2SDC converts enterprise UML models exported from Sparx Enterprise Architect, MagicDraw, and other tools into SDC4-compliant data models. It uses a multi-agent pipeline to parse, analyze, map, and assemble models via the SDCStudio Assembly API.

Built for air-gapped, self-hosted environments. No cloud dependencies required.

Agents

Agent Tools LLM Description
parser 3 No Parse XMI files, auto-detect dialect, normalize to intermediate model
analyzer 3 Yes Semantic analysis of class intent, inheritance, associations
mapper 3 Edge cases Apply UML-to-SDC4 type mapping rules, produce mapping plan
reviewer 2 Yes Review mapping completeness, generate conversion report
assembler 3 No Execute mapping plan via SDCStudio Assembly API
orchestrator -- Yes Multi-agent coordinator: parse, analyze, map, review, assemble

Type Mapping

UML Type SDC4 Type Notes
Boolean XdBoolean
Integer (non-negative) XdCount
Integer (signed) XdQuantity Integer restriction
Real / Float / Double XdQuantity
String XdString
Enumeration XdString Literals become enumerations
Date / DateTime / Time XdTemporal
Class (composite) Cluster
Composition association Cluster containment

Requirements

  • Python 3.11+
  • An LLM endpoint reachable via litellm, a frontier-model API key or a local model, for the LLM-assisted analysis and edge-case mapping steps.
  • For assemble only: a reachable SDCStudio Assembly API (the hosted sdcstudio.axius-sdc.com or a self-hosted instance) plus an API key via SDCSTUDIO_API_KEY (or --api-key).

convert (parse + map to a mapping plan) runs fully standalone; only assemble needs SDCStudio access.

Installation

# Install the package and its dependencies
pip install -e .

# Development (tests, linters)
pip install -e ".[dev]"

A requirements.txt mirroring the runtime dependencies is provided to build an environment directly: pip install -r requirements.txt.

Quick Start

Convert an XMI file

# Configure
cp xmi2sdc.example.yaml xmi2sdc.yaml

# Parse and map (produces JSON mapping plan)
xmi2sdc convert model.xmi

# Specify output path
xmi2sdc convert model.xmi -o mapping_plan.json

MCP Mode

Expose toolsets as MCP servers for LLM clients (Claude Code, Cursor, etc.):

xmi2sdc serve --mcp parser
xmi2sdc serve --mcp mapper

ADK Agent Mode

For standalone agent orchestration, a local LLM is required:

ollama pull qwen2.5:7b-instruct
# Agents use ollama/qwen2.5:7b-instruct by default via LiteLLM

CLI Commands

xmi2sdc convert FILE       # Parse XMI and produce SDC4 mapping plan
xmi2sdc serve --mcp AGENT  # Start MCP stdio server for an agent toolset
xmi2sdc info               # Display config summary and agent inventory
xmi2sdc validate-config    # Validate configuration file
xmi2sdc audit show         # Display audit log with filters

Configuration

Create xmi2sdc.yaml:

sdcstudio:
  base_url: "http://localhost:8000"
  api_key: "${SDC_API_KEY}"

cache:
  root: ".xmi2sdc-cache"

audit:
  path: ".xmi2sdc-cache/audit.jsonl"
  log_level: "standard"  # or "verbose"

output:
  directory: "./output"

Environment variables in ${VAR} syntax are substituted at load time. Missing variables cause an immediate error (fail closed).

Supported Dialects

  • Generic XMI 2.x -- Standard OMG XMI exports
  • Sparx Enterprise Architect -- Auto-detected via sparxsystems.com namespace
  • MagicDraw / Cameo -- Auto-detected via nomagic.com namespace

Dialect is detected automatically from namespace declarations in the XMI file. All dialects normalize to the same ParsedXmiModel intermediate representation.

Docker

docker build -t xmi2sdc .

# MCP server mode
docker run -v $(pwd)/xmi2sdc.yaml:/home/sdc/xmi2sdc.yaml:ro \
    -e XMI2SDC_AGENT=parser \
    xmi2sdc

# CLI mode
docker run -v $(pwd)/xmi2sdc.yaml:/home/sdc/xmi2sdc.yaml:ro \
    xmi2sdc info

Development

Branch Workflow

  • main: Production code (protected, PR required)
  • dev: Active development

All work happens on dev. Create a Pull Request to merge into main.

Testing

pip install -e ".[dev]"
pytest

# With coverage
pytest --cov=xmi2sdc --cov-report=term-missing

Linting

ruff check src/ tests/
black --check src/ tests/

Architecture

XMI File ──> Parser Agent ──> ParsedXmiModel ──> Mapper Agent ──> Mapping Plan JSON
                                                                        |
                                                                        v
                               Conversion Report <── Reviewer <── Assembler ──> SDCStudio API

The pipeline separates deterministic operations (parsing, type mapping) from LLM-assisted operations (semantic analysis, edge-case resolution). If any stage fails, earlier results are cached and the pipeline can resume without re-processing.

Contributing

See CONTRIBUTING.md for development guidelines and contribution workflow.

Security

See SECURITY.md for the security policy and vulnerability reporting process.

Related Projects

  • SDCStudio — the SDC4 data model platform and Assembly API provider that XMI2SDC targets.
  • SDC repositories — the open-source SDC ecosystem (validators, agents, and tooling).

License

Apache License 2.0. Copyright 2026 Axius SDC, Inc. See LICENSE and NOTICE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xmi2sdc-4.0.0.tar.gz (4.1 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

xmi2sdc-4.0.0-py3-none-any.whl (39.2 kB view details)

Uploaded Python 3

File details

Details for the file xmi2sdc-4.0.0.tar.gz.

File metadata

  • Download URL: xmi2sdc-4.0.0.tar.gz
  • Upload date:
  • Size: 4.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for xmi2sdc-4.0.0.tar.gz
Algorithm Hash digest
SHA256 596dcaab1673625174b65dcaf5f2f0c5710c54eed98510423481b7f1f32365aa
MD5 14e1d9778eaf8a63559572bedcc42551
BLAKE2b-256 96244313060d182c3e4becea52b9e58d3d83e5e9237bfdd35080cfa145d84af3

See more details on using hashes here.

Provenance

The following attestation bundles were made for xmi2sdc-4.0.0.tar.gz:

Publisher: release.yml on SemanticDataCharter/XMI2SDC

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file xmi2sdc-4.0.0-py3-none-any.whl.

File metadata

  • Download URL: xmi2sdc-4.0.0-py3-none-any.whl
  • Upload date:
  • Size: 39.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for xmi2sdc-4.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cdf39556501878ea2693a53168490f2aed8b4f3914620da8f62c9c26d3a21bfd
MD5 8f6be194bf8c9336b603aef54b9ed165
BLAKE2b-256 ea26222d08e5daf4473d28450a4a0723db44f1d563a94f275a5b78e24078947a

See more details on using hashes here.

Provenance

The following attestation bundles were made for xmi2sdc-4.0.0-py3-none-any.whl:

Publisher: release.yml on SemanticDataCharter/XMI2SDC

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page