Skip to content

ArchiModel

parseArchiModel returns an ArchiModel — the semantic representation of an Archi .archimate model file.

.archimate XML
↓ parse
ArchiModel
├── metadata ← id, name, native version, purpose, model-level properties
├── folders
├── elements
├── relationships
├── views
├── diagramObjects
├── diagramConnections
├── notes
└── profiles ← Specializations and generic Profiles

Every collection is flat (not nested) and preserves the order entities appear in the source XML. Cross-references between entities (a relationship’s sourceId, a diagram object’s archimateElementId) are plain string ids — look them up in the relevant array, or build a Map keyed by id if repeated lookups are needed.

The parser never requires a specific entity to appear before another: by the time the model is returned, references are just strings waiting to be resolved by the caller.

ArchiModelMetadata holds the model-level attributes:

FieldDescription
idThe model’s own id.
nameThe model’s name.
versionThe model’s native version string.
purposeThe native <purpose> element — Archi’s own name for the model-level narrative field. null when absent.
propertiesModel-level <property> entries.

Note the model root has no separate, generic “documentation” concept — its narrative lives in purpose, unlike elements, relationships, views, and folders, which all carry a documentation field.

CollectionWhat it holdsCross-references you will find
foldersThe model tree: standard buckets (Business, Application, Relations, Views) plus user sub-folders.parentId, containedIds
elementsEvery semantic element, any ArchiMate type.folderId, profiles
relationshipsEvery semantic relationship.sourceId, targetId, folderId, profiles
viewsDiagram/view definitions.folderId, diagramObjectIds, diagramConnectionIds, noteIds
diagramObjectsVisual nodes (diagram objects, groups, model references).viewId, parentId, archimateElementId, referencedModelId
diagramConnectionsVisual connections.viewId, sourceId, targetId, archimateRelationshipId
notesFree-text diagram notes.viewId, parentId
profilesSpecializations and generic Profiles.referenced from elements[].profiles, relationships[].profiles

Archi draws every id — semantic and visual — from one shared pool, so a duplicate-id anywhere in the model is a real integrity problem. The validator exploits exactly this fact; see Validate a model.

All collections preserve source order. If your tooling relies on document order (for example to mirror the model tree), it is available for free — nothing is sorted or re-arranged during parsing.