Quick Start
A working example end to end with the current library, from installation to a typed, validated result. No prior Archi or ArchiMate® knowledge needed.
1. Install
Section titled “1. Install”npm install @cda/archi-semantic-coreRequirements: Node.js ^20 || ^22 || >=24, ESM-only, TypeScript types
bundled in the package.
2. Load
Section titled “2. Load”parseArchiModel accepts native Archi .archimate XML text. For a real
file, read it from disk (or fetch it) and pass the XML string — the
archive guide
covers zip-archive .archimate files:
import { readFile } from 'node:fs/promises';import { parseArchiModel } from '@cda/archi-semantic-core';
const xmlText = await readFile('MyModel.archimate', 'utf8');const model = parseArchiModel(xmlText);3. Inspect
Section titled “3. Inspect”The parsed model is a typed ArchiModel with flat collections of folders,
elements, relationships, views, diagram objects and connections:
model.elements.map((e) => e.type); // ["BusinessActor", ...]model.elements.map((e) => e.name); // ["Customer", ...]model.relationships.length; // 2Types are namespace-prefix-stripped ("BusinessActor", not
"archimate:BusinessActor"), and cross-references such as
relationship.sourceId are plain string ids — see
IDs and references.
4. Result
Section titled “4. Result”Run the structural validator on the parsed model — missing or duplicate ids and dangling references are reported as typed issues:
import { validateArchiModel } from '@cda/archi-semantic-core';
const { valid, errors } = validateArchiModel(model);
if (!valid) { for (const issue of errors) { console.error(`[${issue.code}] ${issue.path} — ${issue.message}`); } process.exit(1);}That is the whole loop: parse a native model, read it as typed data, and gate your pipeline on its structural integrity — the same way linting gates source code.
Next steps
Section titled “Next steps”- Parse your first model — a closer walkthrough.
- Validate a model — every check the validator performs.
- Working with .archimate archives — plain XML vs. zip files.
- Structural validation in CI — wire this into a pipeline.