Linked.Archi ArchiMate 3.2 Element & Metamodel Shapes
SHACL shapes for validating ArchiMate element instances and metamodel patterns. Covers structural integrity, assignment/access/serving direction, cross-layer constraints, specialization rules, junction homogeneity, motivation realization direction, strategy realization targets, and deep specialization warnings. Based on ArchiMate 3.2 spec Figures 5, 34, 45, 46, 51, 52, 70, 82, 99, 104-106. For relationship pair validation, see archimate3.2-relationship-shapes.ttl.
Linked.Archi
Every ArchiMate element instance must have at least one skos:prefLabel.
An element cannot compose itself.
SELECT $this WHERE { $this am:composedOf $this . }
An element cannot aggregate itself.
SELECT $this WHERE { $this am:aggregates $this . }
An element cannot specialize itself.
SELECT $this WHERE { $this am:specializes $this . }
Circular composition is not allowed.
SELECT $this WHERE { $this am:composedOf+ $this . }
Circular aggregation is not allowed.
SELECT $this WHERE { $this am:aggregates+ $this . }
A composed part can only belong to one whole (composition implies exclusive ownership).
SELECT $this WHERE { ?whole1 am:composedOf $this . ?whole2 am:composedOf $this . FILTER(?whole1 != ?whole2) }
Specialization must connect elements of the same ArchiMate type.
SELECT $this ?target WHERE { $this am:specializes ?target . $this rdf:type ?sourceType . ?target rdf:type ?targetType . ?sourceType rdfs:subClassOf* arch:Element . ?targetType rdfs:subClassOf* arch:Element . FILTER NOT EXISTS { $this rdf:type ?commonType . ?target rdf:type ?commonType . ?commonType rdfs:subClassOf* arch:Element . } }
In core layers, assignment can only originate from active structure elements.
SELECT $this WHERE { $this am:assignedTo ?target . $this rdf:type/rdfs:subClassOf* am:CoreLayerElement . FILTER NOT EXISTS { $this rdf:type/rdfs:subClassOf* am:ActiveStructureElement . } }
In core layers, assignment can only target behavior elements.
SELECT $this WHERE { ?source am:assignedTo $this . $this rdf:type/rdfs:subClassOf* am:CoreLayerElement . FILTER NOT EXISTS { $this rdf:type/rdfs:subClassOf* am:BehaviorElement . } }
In core layers, access can only originate from behavior elements.
SELECT $this WHERE { $this am:accesses ?target . $this rdf:type/rdfs:subClassOf* am:CoreLayerElement . FILTER NOT EXISTS { $this rdf:type/rdfs:subClassOf* am:BehaviorElement . } }
In core layers, access can only target passive structure elements.
SELECT $this WHERE { ?source am:accesses $this . $this rdf:type/rdfs:subClassOf* am:CoreLayerElement . FILTER NOT EXISTS { $this rdf:type/rdfs:subClassOf* am:PassiveStructureElement . } }
In core layers, triggering can only originate from behavior elements.
SELECT $this WHERE { $this am:triggers ?target . $this rdf:type/rdfs:subClassOf* am:CoreLayerElement . FILTER NOT EXISTS { $this rdf:type/rdfs:subClassOf* am:BehaviorElement . } }
In core layers, triggering can only target behavior elements.
SELECT $this WHERE { ?source am:triggers $this . $this rdf:type/rdfs:subClassOf* am:CoreLayerElement . FILTER NOT EXISTS { $this rdf:type/rdfs:subClassOf* am:BehaviorElement . } }
In core layers, flow can only originate from behavior elements.
SELECT $this WHERE { $this am:flowsTo ?target . $this rdf:type/rdfs:subClassOf* am:CoreLayerElement . FILTER NOT EXISTS { $this rdf:type/rdfs:subClassOf* am:BehaviorElement . } }
In core layers, flow can only target behavior elements.
SELECT $this WHERE { ?source am:flowsTo $this . $this rdf:type/rdfs:subClassOf* am:CoreLayerElement . FILTER NOT EXISTS { $this rdf:type/rdfs:subClassOf* am:BehaviorElement . } }
Serving relationships should flow upward from lower to higher layers (Physical → Technology → Application → Business).
SELECT $this ?target WHERE { $this am:serves ?target . { $this rdf:type/rdfs:subClassOf* am:BusinessLayerElement . ?target rdf:type/rdfs:subClassOf* am:ApplicationLayerElement . } UNION { $this rdf:type/rdfs:subClassOf* am:BusinessLayerElement . ?target rdf:type/rdfs:subClassOf* am:TechnologyLayerElement . } UNION { $this rdf:type/rdfs:subClassOf* am:ApplicationLayerElement . ?target rdf:type/rdfs:subClassOf* am:TechnologyLayerElement . } }
Application and Technology elements cannot realize Business active structure elements — only Business behavior can be realized by lower layers.
SELECT $this ?target WHERE { $this am:realizes ?target . ?target rdf:type/rdfs:subClassOf* am:ActiveStructureElement . ?target rdf:type/rdfs:subClassOf* am:BusinessLayerElement . { $this rdf:type/rdfs:subClassOf* am:ApplicationLayerElement . } UNION { $this rdf:type/rdfs:subClassOf* am:TechnologyLayerElement . } UNION { $this rdf:type/rdfs:subClassOf* am:PhysicalLayerElement . } }
Within Strategy layer, Resource can only be assigned to Capability or ValueStream.
SELECT $this ?target WHERE { $this am:assignedTo ?target . $this rdf:type/rdfs:subClassOf* am:StructureElement . $this rdf:type/rdfs:subClassOf* am:StrategyLayerElement . ?target rdf:type/rdfs:subClassOf* am:StrategyLayerElement . FILTER NOT EXISTS { { ?target a am:Capability . } UNION { ?target a am:ValueStream . } } }
CourseOfAction should not realize Capability or ValueStream — realization flows the other direction.
SELECT $this ?target WHERE { $this am:realizes ?target . $this a am:CourseOfAction . { ?target a am:Capability . } UNION { ?target a am:ValueStream . } }
Interface assignment target must be an external behavior element (service) in the same layer.
SELECT $this ?target WHERE { $this am:assignedTo ?target . $this rdf:type/rdfs:subClassOf* am:ExternalActiveStructureElement . $this rdf:type/rdfs:subClassOf* am:CoreLayerElement . VALUES ?layer { am:BusinessLayerElement am:ApplicationLayerElement am:TechnologyLayerElement } $this rdf:type/rdfs:subClassOf* ?layer . FILTER NOT EXISTS { ?target rdf:type/rdfs:subClassOf* am:ExternalBehaviorElement . ?target rdf:type/rdfs:subClassOf* ?layer . } }
Service should not realize internal behavior — realization flows from process/function toward service.
SELECT $this ?target WHERE { $this am:realizes ?target . $this rdf:type/rdfs:subClassOf* am:ExternalBehaviorElement . VALUES ?layer { am:BusinessLayerElement am:ApplicationLayerElement am:TechnologyLayerElement } $this rdf:type/rdfs:subClassOf* ?layer . ?target rdf:type/rdfs:subClassOf* am:BehaviorElement . ?target rdf:type/rdfs:subClassOf* ?layer . FILTER NOT EXISTS { ?target rdf:type/rdfs:subClassOf* am:ExternalBehaviorElement . } }
In Physical layer, assignment can only originate from active structure elements.
SELECT $this WHERE { $this am:assignedTo ?target . $this rdf:type/rdfs:subClassOf* am:PhysicalLayerElement . FILTER NOT EXISTS { $this rdf:type/rdfs:subClassOf* am:ActiveStructureElement . } }
In Physical layer, assignment can only target active or passive structure elements.
SELECT $this WHERE { ?source am:assignedTo $this . $this rdf:type/rdfs:subClassOf* am:PhysicalLayerElement . FILTER NOT EXISTS { $this rdf:type/rdfs:subClassOf* am:ActiveStructureElement . } FILTER NOT EXISTS { $this rdf:type/rdfs:subClassOf* am:PassiveStructureElement . } }
WorkPackage → Deliverable realization is deprecated per ArchiMate 3.2 — use an access relationship instead.
SELECT $this ?target WHERE { $this am:realizes ?target . $this a am:WorkPackage . ?target a am:Deliverable . }
Gap should be associated with at least one Plateau — a gap represents a difference between two plateaus.
SELECT $this WHERE { FILTER NOT EXISTS { { $this am:associatedWith ?plateau . ?plateau a am:Plateau . } UNION { ?plateau am:associatedWith $this . ?plateau a am:Plateau . } } }
Only Business active structure elements can be assigned to Stakeholder.
SELECT $this ?source WHERE { ?source am:assignedTo $this . $this a am:Stakeholder . FILTER NOT EXISTS { ?source rdf:type/rdfs:subClassOf* am:ActiveStructureElement . ?source rdf:type/rdfs:subClassOf* am:BusinessLayerElement . } }
Motivation elements cannot participate in triggering relationships.
SELECT $this WHERE { $this am:triggers ?target . $this rdf:type/rdfs:subClassOf* am:MotivationElement . }
Motivation elements cannot participate in flow relationships.
SELECT $this WHERE { $this am:flowsTo ?target . $this rdf:type/rdfs:subClassOf* am:MotivationElement . }
accessType must be one of: Read, Write, ReadWrite, Access.
influenceStrength must be one of: +, ++, -, --.
All relationships connected to an AndJunction must be of the same type.
SELECT $this WHERE { { ?a ?rel1 $this . ?b ?rel2 $this . } UNION { $this ?rel1 ?a . $this ?rel2 ?b . } UNION { ?a ?rel1 $this . $this ?rel2 ?b . } ?rel1 rdfs:subPropertyOf* am:composedOf . FILTER NOT EXISTS { ?rel2 rdfs:subPropertyOf* am:composedOf . } FILTER(?rel1 != ?rel2) }
All relationships connected to an OrJunction must be of the same type.
Motivation elements should not realize non-Motivation elements — realization flows from core/strategy toward Motivation.
SELECT $this ?target WHERE { $this am:realizes ?target . $this rdf:type/rdfs:subClassOf* am:MotivationElement . FILTER NOT EXISTS { ?target rdf:type/rdfs:subClassOf* am:MotivationElement . } FILTER NOT EXISTS { ?target a am:Grouping . } }
Motivation elements cannot be targets of triggering relationships.
SELECT $this WHERE { ?source am:triggers $this . $this rdf:type/rdfs:subClassOf* am:MotivationElement . }
Motivation elements cannot be targets of flow relationships.
SELECT $this WHERE { ?source am:flowsTo $this . $this rdf:type/rdfs:subClassOf* am:MotivationElement . }
Strategy elements can only realize other Strategy elements or Motivation elements — not Core layer elements.
SELECT $this ?target WHERE { $this am:realizes ?target . $this rdf:type/rdfs:subClassOf* am:StrategyLayerElement . FILTER NOT EXISTS { ?target rdf:type/rdfs:subClassOf* am:StrategyLayerElement . } FILTER NOT EXISTS { ?target rdf:type/rdfs:subClassOf* am:MotivationElement . } FILTER NOT EXISTS { ?target a am:Grouping . } }
Element has a deep specialization chain (5+ levels) — consider if this complexity is necessary.
SELECT $this WHERE { $this am:specializes+ ?t1 . ?t1 am:specializes+ ?t2 . ?t2 am:specializes+ ?t3 . ?t3 am:specializes+ ?t4 . }